Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/adobe/future/widgets/sources/win32 Modified Files: display.cpp event_dispatcher.cpp metrics.cpp ui_core_implementation.cpp ui_overlay.cpp Added Files: os_utilities.cpp Log Message: asl 1.0.13 Index: ui_overlay.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win32/ui_overlay.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ui_overlay.cpp 24 Jan 2006 19:38:49 -0000 1.1 --- ui_overlay.cpp 3 Feb 2006 18:33:37 -0000 1.2 *************** *** 1,6 **** /* ! 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) */ --- 1,6 ---- /* ! 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) */ *************** *** 27,37 **** struct overlay_data_t { ! adobe::point_2d_t origin_m; ! adobe::extents_t extents_m; }; ! typedef adobe::forest<overlay_data_t> overlay_forest_t; ! typedef POINT coord_t; ! typedef std::vector<coord_t> coord_set_t; /****************************************************************************************************/ --- 27,37 ---- struct overlay_data_t { ! adobe::point_2d_t origin_m; ! adobe::extents_t extents_m; }; ! typedef adobe::forest<overlay_data_t> overlay_forest_t; ! typedef POINT coord_t; ! typedef std::vector<coord_t> coord_set_t; /****************************************************************************************************/ *************** *** 39,43 **** overlay_forest_t::iterator unwrap(adobe::ui_overlay_t::position_t& position) { ! return boost::any_cast<overlay_forest_t::iterator>(position); } --- 39,43 ---- overlay_forest_t::iterator unwrap(adobe::ui_overlay_t::position_t& position) { ! return boost::any_cast<overlay_forest_t::iterator>(position); } *************** *** 46,50 **** adobe::ui_overlay_t::position_t wrap(overlay_forest_t::iterator view) { ! return adobe::ui_overlay_t::position_t(view); } --- 46,50 ---- adobe::ui_overlay_t::position_t wrap(overlay_forest_t::iterator view) { ! return adobe::ui_overlay_t::position_t(view); } *************** *** 53,75 **** RECT get_window_client_offset_rect(HWND window) { ! assert(window); ! RECT window_rect; ! RECT client_rect; ! ::GetWindowRect(window, &window_rect); ! ::GetClientRect(window, &client_rect); ! ::ClientToScreen(window, (LPPOINT) &client_rect.left); ! ::ClientToScreen(window, (LPPOINT) &client_rect.right); ! RECT result; ! result.left = std::abs(window_rect.left - client_rect.left); ! result.top = std::abs(window_rect.top - client_rect.top); ! result.right = std::abs(window_rect.right - client_rect.right); ! result.bottom = std::abs(window_rect.bottom - client_rect.bottom); ! return result; } --- 53,75 ---- RECT get_window_client_offset_rect(HWND window) { ! assert(window); ! RECT window_rect; ! RECT client_rect; ! ::GetWindowRect(window, &window_rect); ! ::GetClientRect(window, &client_rect); ! ::ClientToScreen(window, (LPPOINT) &client_rect.left); ! ::ClientToScreen(window, (LPPOINT) &client_rect.right); ! RECT result; ! result.left = std::abs(window_rect.left - client_rect.left); ! result.top = std::abs(window_rect.top - client_rect.top); ! result.right = std::abs(window_rect.right - client_rect.right); ! result.bottom = std::abs(window_rect.bottom - client_rect.bottom); ! return result; } *************** *** 78,86 **** void draw_line_path(HDC context, coord_set_t& points) { ! if (points.size() < 2) return; ! ::Polyline(context, &points[0], static_cast<int>(points.size())); ! points.erase(points.begin(), points.end()); } --- 78,86 ---- void draw_line_path(HDC context, coord_set_t& points) { ! if (points.size() < 2) return; ! ::Polyline(context, &points[0], static_cast<int>(points.size())); ! points.erase(points.begin(), points.end()); } *************** *** 97,150 **** struct ui_overlay_t::implementation_t { ! implementation_t(); ! ~implementation_t(); ! struct draw_element_t ! { ! enum element_type ! { ! element_type_top_left, ! element_type_top_right, ! element_type_bottom_left, ! element_type_bottom_right, ! element_type_horizontal_poi, ! element_type_vertical_poi, ! element_type_count // always be last ! }; ! draw_element_t(element_type type, const RECT& rect, const COLORREF& color) : ! type_m(type), rect_m(rect), color_m(color) ! { } ! draw_element_t(const draw_element_t& rhs) : ! type_m(rhs.type_m), rect_m(rhs.rect_m), color_m(rhs.color_m) ! { } ! element_type type_m; ! RECT rect_m; ! COLORREF color_m; ! }; ! typedef std::vector<draw_element_t> draw_element_set_t; ! position_t root(HWND& element); ! position_t insert(position_t parent); ! void place(position_t node, const point_2d_t& origin, const extents_t& extents); ! void framing(bool do_framing); ! overlay_data_t flatten_overlay_data(overlay_forest_t::iterator iter); ! void tick_extents(const overlay_data_t& overlay_data, HWND main_window, draw_element_set_t& set); ! void draw_tick(HDC context, const draw_element_set_t::value_type& element); ! HWND overlay_m; ! HWND source_m; ! bool framing_m; ! overlay_forest_t tree_m; }; --- 97,150 ---- struct ui_overlay_t::implementation_t { ! implementation_t(); ! ~implementation_t(); ! struct draw_element_t ! { ! enum element_type ! { ! element_type_top_left, ! element_type_top_right, ! element_type_bottom_left, ! element_type_bottom_right, ! element_type_horizontal_poi, ! element_type_vertical_poi, ! element_type_count // always be last ! }; ! draw_element_t(element_type type, const RECT& rect, const COLORREF& color) : ! type_m(type), rect_m(rect), color_m(color) ! { } ! draw_element_t(const draw_element_t& rhs) : ! type_m(rhs.type_m), rect_m(rhs.rect_m), color_m(rhs.color_m) ! { } ! element_type type_m; ! RECT rect_m; ! COLORREF color_m; ! }; ! typedef std::vector<draw_element_t> draw_element_set_t; ! position_t root(HWND& element); ! position_t insert(position_t parent); ! void place(position_t node, const point_2d_t& origin, const extents_t& extents); ! void framing(bool do_framing); ! overlay_data_t flatten_overlay_data(overlay_forest_t::iterator iter); ! void tick_extents(const overlay_data_t& overlay_data, HWND main_window, draw_element_set_t& set); ! void draw_tick(HDC context, const draw_element_set_t::value_type& element); ! HWND overlay_m; ! HWND source_m; ! bool framing_m; ! overlay_forest_t tree_m; }; *************** *** 152,156 **** ui_overlay_t::ui_overlay_t() : ! object_m(new implementation_t()) { } --- 152,156 ---- ui_overlay_t::ui_overlay_t() : ! object_m(new implementation_t()) { } *************** *** 184,188 **** #if 0 ! #pragma mark - #endif --- 184,188 ---- #if 0 ! #pragma mark - #endif *************** *** 190,196 **** ui_overlay_t::implementation_t::implementation_t() : ! overlay_m(0), ! source_m(0), ! framing_m(false) { } --- 190,196 ---- ui_overlay_t::implementation_t::implementation_t() : ! overlay_m(0), ! source_m(0), ! framing_m(false) { } *************** *** 199,205 **** ui_overlay_t::implementation_t::~implementation_t() { ! if (overlay_m) ::DestroyWindow(overlay_m); ! overlay_m = 0; } --- 199,205 ---- ui_overlay_t::implementation_t::~implementation_t() { ! if (overlay_m) ::DestroyWindow(overlay_m); ! overlay_m = 0; } *************** *** 208,216 **** ui_overlay_t::position_t ui_overlay_t::implementation_t::root(HWND& element) { ! assert(element); ! source_m = element; ! return wrap(tree_m.insert(tree_m.begin(), overlay_data_t())); } --- 208,216 ---- ui_overlay_t::position_t ui_overlay_t::implementation_t::root(HWND& element) { ! assert(element); ! source_m = element; ! return wrap(tree_m.insert(tree_m.begin(), overlay_data_t())); } *************** *** 219,227 **** ui_overlay_t::position_t ui_overlay_t::implementation_t::insert(position_t parent) { ! overlay_forest_t::iterator position(unwrap(parent)); position.edge() = adobe::forest_trailing_edge; ! return wrap(tree_m.insert(position, overlay_data_t())); } --- 219,227 ---- ui_overlay_t::position_t ui_overlay_t::implementation_t::insert(position_t parent) { ! overlay_forest_t::iterator position(unwrap(parent)); position.edge() = adobe::forest_trailing_edge; ! return wrap(tree_m.insert(position, overlay_data_t())); } *************** *** 230,237 **** void ui_overlay_t::implementation_t::place(position_t node, const point_2d_t& origin, const extents_t& extents) { ! overlay_forest_t::iterator position(unwrap(node)); ! position->origin_m = origin; ! position->extents_m = extents; } --- 230,237 ---- void ui_overlay_t::implementation_t::place(position_t node, const point_2d_t& origin, const extents_t& extents) { ! overlay_forest_t::iterator position(unwrap(node)); ! position->origin_m = origin; ! position->extents_m = extents; } *************** *** 240,270 **** void ui_overlay_t::implementation_t::framing(bool do_framing) { ! assert(source_m); ! framing_m = do_framing; ! if (!do_framing) ! { ! //set_control_invalid(control_m); ! } ! else ! { ! HWND main_window(source_m);//::GetAncestor(source_m, GA_ROOT)); ! HDC context(::GetWindowDC(main_window)); ! draw_element_set_t tick_set; ! overlay_forest_t::preorder_iterator first(tree_m.begin()); ! overlay_forest_t::preorder_iterator last(tree_m.end()); ! ::BringWindowToTop(main_window); ! for (; first != last; ++first) ! tick_extents(flatten_overlay_data(first.base()), main_window, tick_set); ! if (!tick_set.empty()) ! adobe::for_each(tick_set, boost::bind(&implementation_t::draw_tick, boost::ref(*this), context, _1)); ! ::ReleaseDC(main_window, context); ! } } --- 240,270 ---- void ui_overlay_t::implementation_t::framing(bool do_framing) { ! assert(source_m); ! framing_m = do_framing; ! if (!do_framing) ! { ! //set_control_invalid(control_m); ! } ! else ! { ! HWND main_window(source_m);//::GetAncestor(source_m, GA_ROOT)); ! HDC context(::GetWindowDC(main_window)); ! draw_element_set_t tick_set; ! overlay_forest_t::preorder_iterator first(tree_m.begin()); ! overlay_forest_t::preorder_iterator last(tree_m.end()); ! ::BringWindowToTop(main_window); ! for (; first != last; ++first) ! tick_extents(flatten_overlay_data(first.base()), main_window, tick_set); ! if (!tick_set.empty()) ! adobe::for_each(tick_set, boost::bind(&implementation_t::draw_tick, boost::ref(*this), context, _1)); ! ::ReleaseDC(main_window, context); ! } } *************** *** 273,289 **** overlay_data_t ui_overlay_t::implementation_t::flatten_overlay_data(overlay_forest_t::iterator iter) { ! overlay_data_t result; ! point_2d_t& origin(result.origin_m); ! overlay_forest_t::iterator last(tree_m.end()); ! result.extents_m = iter->extents_m; ! for (; iter != last; iter = find_parent(iter)) ! { ! origin.x_m += iter->origin_m.x_m; ! origin.y_m += iter->origin_m.y_m; ! } ! return result; } --- 273,289 ---- overlay_data_t ui_overlay_t::implementation_t::flatten_overlay_data(overlay_forest_t::iterator iter) { ! overlay_data_t result; ! point_2d_t& origin(result.origin_m); ! overlay_forest_t::iterator last(tree_m.end()); ! result.extents_m = iter->extents_m; ! for (; iter != last; iter = find_parent(iter)) ! { ! origin.x_m += iter->origin_m.x_m; ! origin.y_m += iter->origin_m.y_m; ! } ! return result; } *************** *** 292,353 **** void ui_overlay_t::implementation_t::tick_extents(const overlay_data_t& overlay_data, HWND main_window, draw_element_set_t& set) { ! typedef draw_element_t de_t; ! static const long tick(3); ! static COLORREF blue(RGB(0, 0, 255)); ! static COLORREF red(RGB(255, 0, 0)); ! const point_2d_t& position(overlay_data.origin_m); ! const extents_t& extents(overlay_data.extents_m); ! RECT extra(get_window_client_offset_rect(main_window)); ! long top(position.y_m + extra.top - 1); ! long left(position.x_m + extra.left); ! long bottom(top + extents.height() - 1); ! long right(left + extents.width()); ! long tick_width(std::min(tick, extents.width())); ! long tick_height(std::min(tick, extents.height())); ! long tick_start_right(std::max(right - tick, left)); ! long tick_start_bottom(std::max(bottom - tick, top)); ! RECT top_left_rect = { left, top, left + tick_width, top + tick_height }; ! RECT top_right_rect = { tick_start_right, top, tick_start_right + tick_width, top + tick_height }; ! RECT bottom_left_rect = { left, tick_start_bottom + 1, left + tick_width + 1, tick_start_bottom + tick_height }; ! RECT bottom_right_rect = { tick_start_right - 1, tick_start_bottom + 1, tick_start_right + tick_width, tick_start_bottom + tick_height }; ! set.push_back(de_t(de_t::element_type_top_left, top_left_rect, blue)); ! set.push_back(de_t(de_t::element_type_top_right, top_right_rect, blue)); ! set.push_back(de_t(de_t::element_type_bottom_left, bottom_left_rect, blue)); ! set.push_back(de_t(de_t::element_type_bottom_right, bottom_right_rect, blue)); ! { ! guide_set_t::const_iterator iter(extents.horizontal().poi_m.begin()); ! guide_set_t::const_iterator last(extents.horizontal().poi_m.end()); ! for (; iter != last; ++iter) ! { ! guide_set_t::value_type cur(*iter); ! long poi(left + cur); ! RECT top_tick = { poi, top, poi + 1, top + tick_height }; ! RECT bottom_tick = { poi, bottom - tick_height, poi + 1, bottom }; ! set.push_back(de_t(de_t::element_type_horizontal_poi, top_tick, red)); ! set.push_back(de_t(de_t::element_type_horizontal_poi, bottom_tick, red)); ! } ! } ! { ! guide_set_t::const_iterator iter(extents.vertical().poi_m.begin()); ! guide_set_t::const_iterator last(extents.vertical().poi_m.end()); ! for (; iter != last; ++iter) ! { ! guide_set_t::value_type cur(*iter); ! long poi(top + cur); ! RECT left_tick = { left, poi, left + tick_width, poi + 1 }; ! RECT right_tick = { right - tick_width, poi, right, poi + 1 }; ! set.push_back(de_t(de_t::element_type_vertical_poi, left_tick, red)); ! set.push_back(de_t(de_t::element_type_vertical_poi, right_tick, red)); ! } ! } } --- 292,353 ---- void ui_overlay_t::implementation_t::tick_extents(const overlay_data_t& overlay_data, HWND main_window, draw_element_set_t& set) { ! typedef draw_element_t de_t; ! static const long tick(3); ! static COLORREF blue(RGB(0, 0, 255)); ! static COLORREF red(RGB(255, 0, 0)); ! const point_2d_t& position(overlay_data.origin_m); ! const extents_t& extents(overlay_data.extents_m); ! RECT extra(get_window_client_offset_rect(main_window)); ! long top(position.y_m + extra.top - 1); ! long left(position.x_m + extra.left); ! long bottom(top + extents.height() - 1); ! long right(left + extents.width()); ! long tick_width(std::min(tick, extents.width())); ! long tick_height(std::min(tick, extents.height())); ! long tick_start_right(std::max(right - tick, left)); ! long tick_start_bottom(std::max(bottom - tick, top)); ! RECT top_left_rect = { left, top, left + tick_width, top + tick_height }; ! RECT top_right_rect = { tick_start_right, top, tick_start_right + tick_width, top + tick_height }; ! RECT bottom_left_rect = { left, tick_start_bottom + 1, left + tick_width + 1, tick_start_bottom + tick_height }; ! RECT bottom_right_rect = { tick_start_right - 1, tick_start_bottom + 1, tick_start_right + tick_width, tick_start_bottom + tick_height }; ! set.push_back(de_t(de_t::element_type_top_left, top_left_rect, blue)); ! set.push_back(de_t(de_t::element_type_top_right, top_right_rect, blue)); ! set.push_back(de_t(de_t::element_type_bottom_left, bottom_left_rect, blue)); ! set.push_back(de_t(de_t::element_type_bottom_right, bottom_right_rect, blue)); ! { ! guide_set_t::const_iterator iter(extents.horizontal().poi_m.begin()); ! guide_set_t::const_iterator last(extents.horizontal().poi_m.end()); ! for (; iter != last; ++iter) ! { ! guide_set_t::value_type cur(*iter); ! long poi(left + cur); ! RECT top_tick = { poi, top, poi + 1, top + tick_height }; ! RECT bottom_tick = { poi, bottom - tick_height, poi + 1, bottom }; ! set.push_back(de_t(de_t::element_type_horizontal_poi, top_tick, red)); ! set.push_back(de_t(de_t::element_type_horizontal_poi, bottom_tick, red)); ! } ! } ! { ! guide_set_t::const_iterator iter(extents.vertical().poi_m.begin()); ! guide_set_t::const_iterator last(extents.vertical().poi_m.end()); ! for (; iter != last; ++iter) ! { ! guide_set_t::value_type cur(*iter); ! long poi(top + cur); ! RECT left_tick = { left, poi, left + tick_width, poi + 1 }; ! RECT right_tick = { right - tick_width, poi, right, poi + 1 }; ! set.push_back(de_t(de_t::element_type_vertical_poi, left_tick, red)); ! set.push_back(de_t(de_t::element_type_vertical_poi, right_tick, red)); ! } ! } } *************** *** 356,412 **** void ui_overlay_t::implementation_t::draw_tick(HDC context, const draw_element_set_t::value_type& element) { ! typedef draw_element_set_t::value_type desvt_t; ! coord_set_t points; ! long top(element.rect_m.top + 1); ! long left(element.rect_m.left); ! long bottom(element.rect_m.bottom + 1); ! long right(element.rect_m.right - 1); ! coord_t top_left = { left, top }; ! coord_t top_right = { right, top }; ! coord_t bottom_left = { left, bottom }; ! coord_t bottom_right = { right, bottom }; ! HPEN pen(::CreatePen(PS_SOLID, 1, element.color_m)); ! HPEN old_pen((HPEN) SelectObject(context, pen)); ! if (element.type_m == desvt_t::element_type_top_left) ! { ! points.push_back(top_right); ! points.push_back(top_left); ! points.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_top_right) ! { ! points.push_back(top_left); ! points.push_back(top_right); ! points.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_left) ! { ! points.push_back(top_left); ! points.push_back(bottom_left); ! points.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_right) ! { ! points.push_back(top_right); ! points.push_back(bottom_right); ! points.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_horizontal_poi) ! { ! points.push_back(top_left); ! points.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_vertical_poi) ! { ! points.push_back(top_left); ! points.push_back(top_right); ! } ! draw_line_path(context, points); ! // clean up pen work SelectObject(context, old_pen); DeleteObject(pen); --- 356,412 ---- void ui_overlay_t::implementation_t::draw_tick(HDC context, const draw_element_set_t::value_type& element) { ! typedef draw_element_set_t::value_type desvt_t; ! coord_set_t points; ! long top(element.rect_m.top + 1); ! long left(element.rect_m.left); ! long bottom(element.rect_m.bottom + 1); ! long right(element.rect_m.right - 1); ! coord_t top_left = { left, top }; ! coord_t top_right = { right, top }; ! coord_t bottom_left = { left, bottom }; ! coord_t bottom_right = { right, bottom }; ! HPEN pen(::CreatePen(PS_SOLID, 1, element.color_m)); ! HPEN old_pen((HPEN) SelectObject(context, pen)); ! if (element.type_m == desvt_t::element_type_top_left) ! { ! points.push_back(top_right); ! points.push_back(top_left); ! points.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_top_right) ! { ! points.push_back(top_left); ! points.push_back(top_right); ! points.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_left) ! { ! points.push_back(top_left); ! points.push_back(bottom_left); ! points.push_back(bottom_right); ! } ! else if (element.type_m == desvt_t::element_type_bottom_right) ! { ! points.push_back(top_right); ! points.push_back(bottom_right); ! points.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_horizontal_poi) ! { ! points.push_back(top_left); ! points.push_back(bottom_left); ! } ! else if (element.type_m == desvt_t::element_type_vertical_poi) ! { ! points.push_back(top_left); ! points.push_back(top_right); ! } ! draw_line_path(context, points); ! // clean up pen work SelectObject(context, old_pen); DeleteObject(pen); Index: ui_core_implementation.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win32/ui_core_implementation.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ui_core_implementation.cpp 2 Feb 2006 09:10:30 -0000 1.2 --- ui_core_implementation.cpp 3 Feb 2006 18:33:37 -0000 1.3 *************** *** 1,6 **** /* ! 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) */ --- 1,6 ---- /* ! Copyright 2005-2006 Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt [...8237 lines suppressed...] ! HWND static_disable_ref(adobe::view_for_element<HWND>(element.implementation().static_disabled_text_m)); ! // HWND scroll_ref(adobe::view_for_element<HWND>(element.implementation().scroll_control_m)); ! HWND label_ref(adobe::view_for_element<HWND>(element.implementation().get_label())); ! HWND popup_ref(adobe::view_for_element<HWND>(element.implementation().get_popup())); ! HWND popup_static_disable_ref(adobe::view_for_element<HWND>(element.implementation().get_popup().implementation().static_disabled_text_m)); ! display_t::position_t result; ! // if (scroll_ref) result = display.insert<HWND>(parent, scroll_ref); ! // else ! result = display.insert<HWND>(parent, ref); ! if (label_ref) display.insert<HWND>(parent, label_ref); ! if (static_disable_ref) display.insert<HWND>(parent, static_disable_ref); ! if (popup_static_disable_ref) display.insert<HWND>(parent, popup_static_disable_ref); ! if (popup_ref) display.insert<HWND>(parent, popup_ref); ! return result; } Index: display.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/future/widgets/sources/win32/display.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** display.cpp 24 Jan 2006 19:38:49 -0000 1.1 --- display.cpp 3 Feb 2006 18:33:37 -0000 1.2 *************** *** 1,6 **** /* ! 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) */ --- 1,6 ---- /* ! 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) */ *************** *** 24,32 **** struct view_wrap { ! explicit view_wrap(HWND ref) : ! ref_m(ref) ! { } ! HWND ref_m; }; --- 24,32 ---- struct view_wrap { ! explicit view_wrap(HWND ref) : ! ref_m(ref) ! { } ! HWND ref_m; }; *************** *** 35,39 **** HWND unwrap(adobe::display_t::position_t& position) { ! return (boost::any_cast<view_wrap>(position)).ref_m; } --- 35,39 ---- HWND unwrap(adobe::display_t::position_t& position) { ! return (boost::any_cast<view_wrap>(position)).ref_m; } *************** *** 42,46 **** adobe::display_t::position_t wrap(HWND view) { ! return adobe::display_t::position_t(view_wrap(view)); } --- 42,46 ---- adobe::display_t::position_t wrap(HWND view) { ! return adobe::display_t::position_t(view_wrap(view)); } *************** *** 52,56 **** #if 0 ! #pragma mark - #endif --- 52,56 ---- #if 0 ! #pragma mark - #endif *************** *** 63,69 **** display_t& get_main_display() { ! static display_t display_s; ! return display_s; } --- 63,69 ---- display_t& get_main_display() { ! static display_t display_s; ! return display_s; } *************** *** 72,78 **** struct display_t::implementation_t { ! void erase(display_t::position_t& position); ! HWND root_m; }; --- 72,78 ---- struct display_t::implementation_t { ! void erase(display_t::position_t& position); ! HWND root_m; }; *************** *** 92,96 **** #if 0 ! #pragma mark - #endif --- 92,96 ---- #if 0 ! #pragma mark - #endif *************** *** 98,130 **** display_t::display_t() : ! object_m(new implementation_t()) ! { } display_t::~display_t() ! { delete object_m; object_m = 0; } display_t::implementation_t& display_t::implementation() ! { return *object_m; } const display_t::implementation_t& display_t::implementation() const ! { return *object_m; } template <typename DisplayElement> void display_t::set_root(DisplayElement&) ! { } template <> void display_t::set_root<HWND>(HWND& root) ! { object_m->root_m = root; } display_t::position_t display_t::root() ! { return wrap(object_m->root_m); } void display_t::erase(position_t& position) ! { return object_m->erase(position); } template <typename DisplayElement> display_t::position_t display_t::insert(position_t& parent, DisplayElement& element) ! { return insert(parent, adobe::view_for_element<HWND>(element)); } /****************************************************************************************************/ --- 98,130 ---- display_t::display_t() : ! object_m(new implementation_t()) ! { } display_t::~display_t() ! { delete object_m; object_m = 0; } display_t::implementation_t& display_t::implementation() ! { return *object_m; } const display_t::implementation_t& display_t::implementation() const ! { return *object_m; } template <typename DisplayElement> void display_t::set_root(DisplayElement&) ! { } template <> void display_t::set_root<HWND>(HWND& root) ! { object_m->root_m = root; } display_t::position_t display_t::root() ! { return wrap(object_m->root_m); } void display_t::erase(position_t& position) ! { return object_m->erase(position); } template <typename DisplayElement> display_t::position_t display_t::insert(position_t& parent, DisplayElement& element) ! { return insert(parent, adobe::view_for_element<HWND>(element)); } /****************************************************************************************************/ *************** *** 133,146 **** display_t::position_t display_t::insert<HWND>(position_t& parent, HWND& element) { ! if (parent.type() == typeid(view_wrap)) ! { ! HWND parent_view(unwrap(parent)); ! if (::SetParent(element, parent_view) == 0) throw std::runtime_error("display_t::insert<HWND>"); // ADOBE_REQUIRE_STATUS(::GetLastError()); ! assert(::GetParent(element) == parent_view); ! } ! return wrap(element); } --- 133,146 ---- display_t::position_t display_t::insert<HWND>(position_t& parent, HWND& element) { ! if (parent.type() == typeid(view_wrap)) ! { ! HWND parent_view(unwrap(parent)); ! if (::SetParent(element, parent_view) == 0) throw std::runtime_error("display_t::insert<HWND>"); // ADOBE_REQUIRE_STATUS(::GetLastError()); ! assert(::GetParent(element) == parent_view); ! } ! return wrap(element); } *************** *** 148,152 **** #if 0 ! #pragma mark - #endif --- 148,152 ---- #if 0 ! #pragma mark - #endif *************** *** 155,164 **** void display_t::implement... [truncated message content] |