From 440a0500723b4dec14a57202e89623ff91e34b1b Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 5 Oct 2009 17:16:02 +0000 Subject: Fix viewer-2 build due to duplicate lines in a header merge. --- indra/newview/llpanelteleporthistory.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index ecbe281b7a..c4b7f995e0 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -82,9 +82,6 @@ private: void onAccordionTabRightClick(LLView *view, S32 x, S32 y, MASK mask); void onAccordionTabOpen(LLAccordionCtrlTab *tab); void onAccordionTabClose(LLAccordionCtrlTab *tab); - void onAccordionTabRightClick(LLView *view, S32 x, S32 y, MASK mask); - void onAccordionTabOpen(LLAccordionCtrlTab *tab); - void onAccordionTabClose(LLAccordionCtrlTab *tab); void showTeleportHistory(); void handleItemSelect(LLFlatListView* ); LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *); -- cgit v1.2.3 From 8f4df3a68f9446b8a0c65e49170522e14e0dc703 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 5 Oct 2009 20:53:51 +0000 Subject: text boxes are now *not* mouse_opaque by default fixed some textbox and text editor layout problems (getWidth called with wrong index) EXT-1302 - rewrite LLExpandableTextBox to use new LLTextBase functionality (using custom LLExpanderSegment) reviewed by James --- indra/llrender/llfontgl.cpp | 6 +- indra/llui/llscrolllistctrl.cpp | 2 +- indra/llui/lltextbase.cpp | 317 ++++++++++++-------- indra/llui/lltextbase.h | 4 +- indra/llui/lltextbox.cpp | 75 ++--- indra/llui/lltextbox.h | 1 - indra/newview/llexpandabletextbox.cpp | 322 ++++++--------------- indra/newview/llexpandabletextbox.h | 36 +-- .../skins/default/xui/en/floater_test_widgets.xml | 5 +- .../newview/skins/default/xui/en/panel_profile.xml | 8 +- .../default/xui/en/widgets/expandable_text.xml | 10 - .../newview/skins/default/xui/en/widgets/text.xml | 1 + 12 files changed, 323 insertions(+), 464 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 8f943182b8..f7bab3de67 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -208,10 +208,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons case LEFT: break; case RIGHT: - cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX)); + cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)); break; case HCENTER: - cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX)) / 2; + cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2; break; default: break; @@ -234,7 +234,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (use_ellipses) { // check for too long of a string - if (getWidthF32(wstr.c_str(), 0, max_chars) * sScaleX > scaled_max_pixels) + if (getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX > scaled_max_pixels) { // use four dots for ellipsis width to generate padding const LLWString dots(utf8str_to_wstring(std::string("...."))); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index af05686c70..7b74b1f93b 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1566,7 +1566,7 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, MASK mask) LLToolTipMgr::instance().show(LLToolTip::Params() .message(hit_cell->getValue().asString()) .font(LLFontGL::getFontSansSerifSmall()) - .pos(LLCoordGL(sticky_rect.mLeft - 5, sticky_rect.mTop + 4)) + .pos(LLCoordGL(sticky_rect.mLeft - 5, sticky_rect.mTop + 6)) .delay_time(0.2f) .sticky_rect(sticky_rect)); } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 6c048aa908..62f03f47e6 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -209,7 +209,8 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mWordWrap(p.wrap), mUseEllipses( p.use_ellipses ), mParseHTML(p.allow_html), - mParseHighlights(p.parse_highlights) + mParseHighlights(p.parse_highlights), + mHideScrollbar(p.hide_scrollbar) { LLScrollContainer::Params scroll_params; scroll_params.name = "text scroller"; @@ -278,7 +279,9 @@ bool LLTextBase::truncate() // Truncate safely in UTF-8 std::string temp_utf8_text = wstring_to_utf8str(text); temp_utf8_text = utf8str_truncate( temp_utf8_text, mMaxTextByteLength ); - getViewModel()->setDisplay(utf8str_to_wstring( temp_utf8_text )); + LLWString text = utf8str_to_wstring( temp_utf8_text ); + // remove extra bit of current string, to preserve formatting, etc. + removeStringNoUndo(text.size(), getWText().size() - text.size()); did_truncate = TRUE; } } @@ -755,47 +758,60 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) // split old at start point for new segment cur_segmentp->setEnd(segment_to_insert->getStart()); // advance to next segment - ++cur_seg_iter; // insert remainder of old segment LLTextSegmentPtr remainder_segment = new LLNormalTextSegment( cur_segmentp->getStyle(), segment_to_insert->getStart(), old_segment_end, *this); - cur_seg_iter = mSegments.insert(cur_seg_iter, remainder_segment); + mSegments.insert(cur_seg_iter, remainder_segment); remainder_segment->linkToDocument(this); // insert new segment before remainder of old segment - cur_seg_iter = mSegments.insert(cur_seg_iter, segment_to_insert); + mSegments.insert(cur_seg_iter, segment_to_insert); segment_to_insert->linkToDocument(this); - // move to "remanider" segment and start truncation there - ++cur_seg_iter; + // at this point, there will be two overlapping segments owning the text + // associated with the incoming segment } else { - cur_seg_iter = mSegments.insert(cur_seg_iter, segment_to_insert); - ++cur_seg_iter; + mSegments.insert(cur_seg_iter, segment_to_insert); segment_to_insert->linkToDocument(this); } // now delete/truncate remaining segments as necessary + // cur_seg_iter points to segment before incoming segment while(cur_seg_iter != mSegments.end()) { cur_segmentp = *cur_seg_iter; - if (cur_segmentp->getEnd() <= segment_to_insert->getEnd()) + if (cur_segmentp == segment_to_insert) { - cur_segmentp->unlinkFromDocument(this); - segment_set_t::iterator seg_to_erase(cur_seg_iter++); - mSegments.erase(seg_to_erase); + ++cur_seg_iter; + continue; } - else + + if (cur_segmentp->getStart() >= segment_to_insert->getStart()) { - cur_segmentp->setStart(segment_to_insert->getEnd()); - break; + if(cur_segmentp->getEnd() <= segment_to_insert->getEnd()) + { + cur_segmentp->unlinkFromDocument(this); + // grab copy of iterator to erase, and bump it + segment_set_t::iterator seg_to_erase(cur_seg_iter++); + mSegments.erase(seg_to_erase); + continue; + } + else + { + // last overlapping segment, clip to end of incoming segment + // and stop traversal + cur_segmentp->setStart(segment_to_insert->getEnd()); + break; + } } + ++cur_seg_iter; } } } BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleMouseDown(x, y, mask)) { return TRUE; @@ -806,7 +822,7 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleMouseUp(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleMouseUp(x, y, mask)) { // Did we just click on a link? @@ -824,7 +840,7 @@ BOOL LLTextBase::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleMiddleMouseDown(x, y, mask)) { return TRUE; @@ -835,7 +851,7 @@ BOOL LLTextBase::handleMiddleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleMiddleMouseUp(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleMiddleMouseUp(x, y, mask)) { return TRUE; @@ -846,7 +862,7 @@ BOOL LLTextBase::handleMiddleMouseUp(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleRightMouseDown(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleRightMouseDown(x, y, mask)) { return TRUE; @@ -857,7 +873,7 @@ BOOL LLTextBase::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleRightMouseUp(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleRightMouseUp(x, y, mask)) { return TRUE; @@ -868,7 +884,7 @@ BOOL LLTextBase::handleRightMouseUp(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleDoubleClick(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleDoubleClick(x, y, mask)) { return TRUE; @@ -879,7 +895,7 @@ BOOL LLTextBase::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleHover(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleHover(x, y, mask)) { return TRUE; @@ -890,7 +906,7 @@ BOOL LLTextBase::handleHover(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleScrollWheel(S32 x, S32 y, S32 clicks) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleScrollWheel(x, y, clicks)) { return TRUE; @@ -901,7 +917,7 @@ BOOL LLTextBase::handleScrollWheel(S32 x, S32 y, S32 clicks) BOOL LLTextBase::handleToolTip(S32 x, S32 y, MASK mask) { - LLTextSegment* cur_segment = getSegmentAtLocalPos(x, y); + LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); if (cur_segment && cur_segment->handleToolTip(x, y, mask)) { return TRUE; @@ -1040,109 +1056,106 @@ void LLTextBase::reflow(S32 start_index) S32 cur_top = 0; - if (getLength()) + segment_set_t::iterator seg_iter = mSegments.begin(); + S32 seg_offset = 0; + S32 line_start_index = 0; + const S32 text_width = mTextRect.getWidth(); // optionally reserve room for margin + S32 remaining_pixels = text_width; + LLWString text(getWText()); + S32 line_count = 0; + + // find and erase line info structs starting at start_index and going to end of document + if (!mLineInfoList.empty()) { - segment_set_t::iterator seg_iter = mSegments.begin(); - S32 seg_offset = 0; - S32 line_start_index = 0; - const S32 text_width = mTextRect.getWidth(); // optionally reserve room for margin - S32 remaining_pixels = text_width; - LLWString text(getWText()); - S32 line_count = 0; - - // find and erase line info structs starting at start_index and going to end of document - if (!mLineInfoList.empty()) - { - // find first element whose end comes after start_index - line_list_t::iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), start_index, line_end_compare()); - line_start_index = iter->mDocIndexStart; - line_count = iter->mLineNum; - getSegmentAndOffset(iter->mDocIndexStart, &seg_iter, &seg_offset); - mLineInfoList.erase(iter, mLineInfoList.end()); - } + // find first element whose end comes after start_index + line_list_t::iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), start_index, line_end_compare()); + line_start_index = iter->mDocIndexStart; + line_count = iter->mLineNum; + getSegmentAndOffset(iter->mDocIndexStart, &seg_iter, &seg_offset); + mLineInfoList.erase(iter, mLineInfoList.end()); + } - S32 line_height = 0; + S32 line_height = 0; - while(seg_iter != mSegments.end()) + while(seg_iter != mSegments.end()) + { + LLTextSegmentPtr segment = *seg_iter; + + // track maximum height of any segment on this line + line_height = llmax(line_height, segment->getMaxHeight()); + S32 cur_index = segment->getStart() + seg_offset; + // find run of text from this segment that we can display on one line + S32 end_index = cur_index; + while(end_index < segment->getEnd() && text[end_index] != '\n') { - LLTextSegmentPtr segment = *seg_iter; - - // track maximum height of any segment on this line - line_height = llmax(line_height, segment->getMaxHeight()); - S32 cur_index = segment->getStart() + seg_offset; - // find run of text from this segment that we can display on one line - S32 end_index = cur_index; - while(end_index < segment->getEnd() && text[end_index] != '\n') - { - ++end_index; - } - - // ask segment how many character fit in remaining space - S32 max_characters = end_index - cur_index; - S32 character_count = segment->getNumChars(getWordWrap() ? llmax(0, remaining_pixels) : S32_MAX, - seg_offset, - cur_index - line_start_index, - max_characters); - + ++end_index; + } - S32 segment_width = segment->getWidth(seg_offset, character_count); - remaining_pixels -= segment_width; - S32 text_left = getLeftOffset(text_width - remaining_pixels); + // ask segment how many character fit in remaining space + S32 max_characters = end_index - cur_index; + S32 character_count = segment->getNumChars(getWordWrap() ? llmax(0, remaining_pixels) : S32_MAX, + seg_offset, + cur_index - line_start_index, + max_characters); + - seg_offset += character_count; + S32 segment_width = segment->getWidth(seg_offset, character_count); + remaining_pixels -= segment_width; + S32 text_left = getLeftOffset(text_width - remaining_pixels); - S32 last_segment_char_on_line = segment->getStart() + seg_offset; + seg_offset += character_count; - // if we didn't finish the current segment... - if (last_segment_char_on_line < segment->getEnd()) - { - // set up index for next line - // ...skip newline, we don't want to draw - S32 next_line_count = line_count; - if (text[last_segment_char_on_line] == '\n') - { - seg_offset++; - last_segment_char_on_line++; - next_line_count++; - } + S32 last_segment_char_on_line = segment->getStart() + seg_offset; - // add line info and keep going - mLineInfoList.push_back(line_info( - line_start_index, - last_segment_char_on_line, - LLRect(text_left, - cur_top, - text_left + (text_width - remaining_pixels), - cur_top - line_height), - line_count)); - - line_start_index = segment->getStart() + seg_offset; - cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; - remaining_pixels = text_width; - line_height = 0; - line_count = next_line_count; - } - // ...just consumed last segment.. - else if (++segment_set_t::iterator(seg_iter) == mSegments.end()) - { - mLineInfoList.push_back(line_info( - line_start_index, - last_segment_char_on_line, - LLRect(text_left, - cur_top, - text_left + (text_width - remaining_pixels), - cur_top - line_height), - line_count)); - cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; - break; - } - // finished a segment and there are segments remaining on this line - else + // if we didn't finish the current segment... + if (last_segment_char_on_line < segment->getEnd()) + { + // set up index for next line + // ...skip newline, we don't want to draw + S32 next_line_count = line_count; + if (text[last_segment_char_on_line] == '\n') { - // subtract pixels used and increment segment - ++seg_iter; - seg_offset = 0; + seg_offset++; + last_segment_char_on_line++; + next_line_count++; } + + // add line info and keep going + mLineInfoList.push_back(line_info( + line_start_index, + last_segment_char_on_line, + LLRect(text_left, + cur_top, + text_left + (text_width - remaining_pixels), + cur_top - line_height), + line_count)); + + line_start_index = segment->getStart() + seg_offset; + cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; + remaining_pixels = text_width; + line_height = 0; + line_count = next_line_count; + } + // ...just consumed last segment.. + else if (++segment_set_t::iterator(seg_iter) == mSegments.end()) + { + mLineInfoList.push_back(line_info( + line_start_index, + last_segment_char_on_line, + LLRect(text_left, + cur_top, + text_left + (text_width - remaining_pixels), + cur_top - line_height), + line_count)); + cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; + break; + } + // finished a segment and there are segments remaining on this line + else + { + // subtract pixels used and increment segment + ++seg_iter; + seg_offset = 0; } } @@ -1256,6 +1269,19 @@ S32 LLTextBase::getLineStart( S32 line ) const return mLineInfoList[line].mDocIndexStart; } +S32 LLTextBase::getLineEnd( S32 line ) const +{ + S32 num_lines = getLineCount(); + if (num_lines == 0) + { + return 0; + } + + line = llclamp(line, 0, num_lines-1); + return mLineInfoList[line].mDocIndexEnd; +} + + S32 LLTextBase::getLineNumFromDocIndex( S32 doc_index, bool include_wordwrap) const { @@ -1308,14 +1334,27 @@ S32 LLTextBase::getFirstVisibleLine() const return iter - mLineInfoList.begin(); } -std::pair LLTextBase::getVisibleLines() const +std::pair LLTextBase::getVisibleLines(bool fully_visible) { LLRect visible_region = mScroller->getVisibleContentRect(); + line_list_t::const_iterator first_iter; + line_list_t::const_iterator last_iter; - // binary search for line that starts before top of visible buffer and starts before end of visible buffer - line_list_t::const_iterator first_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_bottom()); - line_list_t::const_iterator last_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mBottom, compare_top()); + // make sure we have an up-to-date mLineInfoList + reflow(); + if (fully_visible) + { + // binary search for line that starts before top of visible buffer and starts before end of visible buffer + first_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_top()); + last_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mBottom, compare_bottom()); + } + else + { + // binary search for line that starts before top of visible buffer and starts before end of visible buffer + first_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_bottom()); + last_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mBottom, compare_top()); + } return std::pair(first_iter - mLineInfoList.begin(), last_iter - mLineInfoList.begin()); } @@ -2147,7 +2186,15 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 start = seg_start; S32 end = llmin( selection_start, seg_end ); S32 length = end - start; - font->render(text, start, rect.mLeft, rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, 0, mStyle->getShadowType(), length, rect.getWidth(), &right_x, mEditor.getUseEllipses()); + font->render(text, start, + rect.mLeft, rect.mTop, + color, + LLFontGL::LEFT, LLFontGL::TOP, + 0, + mStyle->getShadowType(), + length, rect.getWidth(), + &right_x, + mEditor.getUseEllipses()); } rect.mLeft = (S32)ceil(right_x); @@ -2158,9 +2205,15 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 end = llmin( selection_end, seg_end ); S32 length = end - start; - font->render(text, start, rect.mLeft, rect.mTop, - LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ), - LLFontGL::LEFT, LLFontGL::TOP, 0, LLFontGL::NO_SHADOW, length, rect.mRight, &right_x, mEditor.getUseEllipses()); + font->render(text, start, + rect.mLeft, rect.mTop, + LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ), + LLFontGL::LEFT, LLFontGL::TOP, + 0, + LLFontGL::NO_SHADOW, + length, rect.mRight, + &right_x, + mEditor.getUseEllipses()); } rect.mLeft = (S32)ceil(right_x); if( selection_end < seg_end ) @@ -2169,7 +2222,15 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 start = llmax( selection_end, seg_start ); S32 end = seg_end; S32 length = end - start; - font->render(text, start, rect.mLeft, rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, 0, mStyle->getShadowType(), length, rect.mRight, &right_x, mEditor.getUseEllipses()); + font->render(text, start, + rect.mLeft, rect.mTop, + color, + LLFontGL::LEFT, LLFontGL::TOP, + 0, + mStyle->getShadowType(), + length, rect.mRight, + &right_x, + mEditor.getUseEllipses()); } return right_x; } @@ -2263,7 +2324,7 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin S32 num_chars = mStyle->getFont()->maxDrawableChars(text.c_str() + segment_offset + mStart, (F32)num_pixels, max_chars, - mEditor.getWordWrap()); + TRUE); if (num_chars == 0 && line_offset == 0 diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index d0287a99ca..f20134fd6d 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -277,10 +277,11 @@ protected: // manage lines S32 getLineStart( S32 line ) const; + S32 getLineEnd( S32 line ) const; S32 getLineNumFromDocIndex( S32 doc_index, bool include_wordwrap = true) const; S32 getLineOffsetFromDocIndex( S32 doc_index, bool include_wordwrap = true) const; S32 getFirstVisibleLine() const; - std::pair getVisibleLines() const; + std::pair getVisibleLines(bool fully_visible = false); S32 getLeftOffset(S32 width); void reflow(S32 start_index = 0); @@ -344,6 +345,7 @@ protected: bool mTrackEnd; // if true, keeps scroll position at end of document during resize bool mReadOnly; bool mClip; + bool mHideScrollbar; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes // support widgets diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 3feca136be..20bceb4675 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -47,26 +47,19 @@ LLTextBox::LLTextBox(const LLTextBox::Params& p) BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; + BOOL handled = LLTextBase::handleMouseDown(x, y, mask); - // HACK: Only do this if there actually is something to click, so that - // overly large text boxes in the older UI won't start eating clicks. - if (isClickable()) + if (getSoundFlags() & MOUSE_DOWN) { - handled = TRUE; + make_ui_sound("UISndClick"); + } + if (!handled && mClickedCallback) + { // Route future Mouse messages here preemptively. (Release on mouse up.) gFocusMgr.setMouseCapture( this ); - - if (getSoundFlags() & MOUSE_DOWN) - { - make_ui_sound("UISndClick"); - } - } - if (!handled) - { - handled = LLTextBase::handleMouseDown(x, y, mask); + handled = TRUE; } return handled; @@ -76,33 +69,30 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; - // We only handle the click if the click both started and ended within us - - // HACK: Only do this if there actually is something to click, so that - // overly large text boxes in the older UI won't start eating clicks. - if (isClickable() && hasMouseCapture()) + if (getSoundFlags() & MOUSE_UP) { - handled = TRUE; + make_ui_sound("UISndClickRelease"); + } + // We only handle the click if the click both started and ended within us + if (hasMouseCapture()) + { // Release the mouse gFocusMgr.setMouseCapture( NULL ); - if (getSoundFlags() & MOUSE_UP) - { - make_ui_sound("UISndClickRelease"); - } - - // handle clicks on Urls in the textbox first - handled = LLTextBase::handleMouseUp(x, y, mask); - - // DO THIS AT THE VERY END to allow the button to be destroyed + // DO THIS AT THE VERY END to allow the button to be destroyed // as a result of being clicked. If mouseup in the widget, // it's been clicked if (mClickedCallback && !handled) { mClickedCallback(); + handled = TRUE; } } + else + { + handled = LLTextBase::handleMouseUp(x, y, mask); + } return handled; } @@ -149,30 +139,3 @@ void LLTextBox::onUrlLabelUpdated(const std::string &url, const std::string &lab needsReflow(); } -bool LLTextBox::isClickable() const -{ - // return true if we have been given a click callback - if (mClickedCallback) - { - return true; - } - - // also return true if we have a clickable Url in the text - segment_set_t::const_iterator it; - for (it = mSegments.begin(); it != mSegments.end(); ++it) - { - LLTextSegmentPtr segmentp = *it; - if (segmentp) - { - const LLStyleSP style = segmentp->getStyle(); - if (style && style->isLink()) - { - return true; - } - } - } - - // otherwise there is nothing clickable here - return false; -} - diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index f8c4447b62..da0bcbe972 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -79,7 +79,6 @@ public: protected: void onUrlLabelUpdated(const std::string &url, const std::string &label); - bool isClickable() const; LLUIString mText; callback_t mClickedCallback; diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index f8f5db9d7e..28c124d1c6 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -34,253 +34,121 @@ #include "llexpandabletextbox.h" #include "llscrollcontainer.h" +#include "llwindow.h" static LLDefaultChildRegistry::Register t1("expandable_text"); -LLExpandableTextBox::LLTextBoxEx::Params::Params() -: expand_textbox("expand_textbox") +class LLExpanderSegment : public LLTextSegment { -} +public: + LLExpanderSegment(const LLStyleSP& style, S32 start, S32 end, const std::string& more_text, LLTextBase& editor ) + : LLTextSegment(start, end), + mEditor(editor), + mStyle(style), + mMoreText(more_text) + {} + + /*virtual*/ S32 getWidth(S32 first_char, S32 num_chars) const + { + // more label always spans width of text box + return mEditor.getTextRect().getWidth(); + } + /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const + { + return start_offset; + } + /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const { return getEnd() - getStart(); } + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) + { + F32 right_x; + mStyle->getFont()->renderUTF8(mMoreText, start, draw_rect.mRight, draw_rect.mTop, mStyle->getColor(), LLFontGL::RIGHT, LLFontGL::TOP, 0, mStyle->getShadowType(), end - start, draw_rect.getWidth(), &right_x, mEditor.getUseEllipses()); + return right_x; + } + /*virtual*/ S32 getMaxHeight() const { return llceil(mStyle->getFont()->getLineHeight()); } + /*virtual*/ bool canEdit() const { return false; } + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) { mEditor.onCommit(); return TRUE; } + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) + { + LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + return TRUE; + } +private: + LLTextBase& mEditor; + LLStyleSP mStyle; + std::string mMoreText; +}; + + LLExpandableTextBox::LLTextBoxEx::LLTextBoxEx(const Params& p) -: LLTextBox(p) +: LLTextBox(p), + mExpanded(false) { setIsChrome(TRUE); - LLTextBox::Params params = p.expand_textbox; - mExpandTextBox = LLUICtrlFactory::create(params); - addChild(mExpandTextBox); - - LLRect rc = getLocalRect(); - rc.mRight -= getHPad(); - rc.mLeft = rc.mRight - mExpandTextBox->getTextPixelWidth(); - rc.mTop = mExpandTextBox->getTextPixelHeight(); - mExpandTextBox->setRect(rc); } -BOOL LLExpandableTextBox::LLTextBoxEx::handleMouseUp(S32 x, S32 y, MASK mask) +void LLExpandableTextBox::LLTextBoxEx::reshape(S32 width, S32 height, BOOL called_from_parent) { - BOOL ret = LLTextBox::handleMouseUp(x, y, mask); + LLTextBox::reshape(width, height, called_from_parent); - if(mExpandTextBox->getRect().pointInRect(x, y)) + if (getTextPixelHeight() > getRect().getHeight()) { - onCommit(); + showExpandText(); + } + else + { + hideExpandText(); } - - return ret; } -void LLExpandableTextBox::LLTextBoxEx::draw() +void LLExpandableTextBox::LLTextBoxEx::setValue(const LLSD& value) { - // draw text box - LLTextBox::draw(); - // force text box to draw children - LLUICtrl::draw(); -} - -/* LLTextBox has been rewritten, the variables referenced in this code -no longer exist. + LLTextBox::setValue(value); -void LLExpandableTextBox::LLTextBoxEx::drawText( S32 x, S32 y, const LLWString &text, const LLColor4& color ) -{ - // *NOTE:dzaporozhan: - // Copy/paste from LLTextBox::drawText in order to modify last - // line width if needed and who "More" link - F32 alpha = getDrawContext().mAlpha; - if (mSegments.size() > 1) + if (getTextPixelHeight() > getRect().getHeight()) { - // we have Urls (or other multi-styled segments) - drawTextSegments(x, y, text); - } - else if( mLineLengthList.empty() ) - { - // simple case of 1 line of text in one style - mDefaultFont->render(text, 0, (F32)x, (F32)y, color % alpha, - mHAlign, mVAlign, - 0, - mShadowType, - S32_MAX, getRect().getWidth(), NULL, mUseEllipses); - - mExpandTextBox->setVisible(FALSE); + showExpandText(); } else { - // simple case of multiple lines of text, all in the same style - S32 cur_pos = 0; - for (std::vector::iterator iter = mLineLengthList.begin(); - iter != mLineLengthList.end(); ++iter) - { - S32 line_length = *iter; - S32 line_height = llfloor(mDefaultFont->getLineHeight()) + mLineSpacing; - S32 max_pixels = getRect().getWidth(); - - if(iter + 1 != mLineLengthList.end() - && y - line_height < line_height) - { - max_pixels = getCropTextWidth(); - } - - mDefaultFont->render(text, cur_pos, (F32)x, (F32)y, color % alpha, - mHAlign, mVAlign, - 0, - mShadowType, - line_length, max_pixels, NULL, mUseEllipses ); - - cur_pos += line_length + 1; - - y -= line_height; - if(y < line_height) - { - if( mLineLengthList.end() != iter + 1 ) - { - showExpandText(y); - } - else - { - hideExpandText(); - } - break; - } - } + hideExpandText(); } } -*/ -void LLExpandableTextBox::LLTextBoxEx::showExpandText(S32 y) -{ - LLRect rc = mExpandTextBox->getRect(); - rc.mTop = y + mExpandTextBox->getTextPixelHeight(); - rc.mBottom = y; - mExpandTextBox->setRect(rc); - mExpandTextBox->setVisible(TRUE); -} -void LLExpandableTextBox::LLTextBoxEx::hideExpandText() -{ - mExpandTextBox->setVisible(FALSE); -} - -S32 LLExpandableTextBox::LLTextBoxEx::getCropTextWidth() -{ - return mExpandTextBox->getRect().mLeft - getHPad() * 2; -} - -/* -// *NOTE:James: -// LLTextBox::drawText() has been completely rewritten, as it now handles -// arbitrarily styled segments of text. This needs to be rebuilt. - -void LLExpandableTextBox::LLTextBoxEx::drawTextSegments(S32 init_x, S32 init_y, const LLWString &text) +void LLExpandableTextBox::LLTextBoxEx::showExpandText() { - - // *NOTE:dzaporozhan: - // Copy/paste from LLTextBox::drawTextSegments in order to modify last - // line width if needed and who "More" link - F32 alpha = getDrawContext().mAlpha; - - const S32 text_len = text.length(); - if (text_len <= 0) + if (!mExpanded) { - return; + // get fully visible lines + std::pair visible_lines = getVisibleLines(true); + S32 last_line = visible_lines.second - 1; + + LLStyle::Params expander_style = getDefaultStyle(); + expander_style.font.name.setIfNotProvided(LLFontGL::nameFromFont(expander_style.font)); + expander_style.font.style = "UNDERLINE"; + expander_style.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + LLExpanderSegment* expanderp = new LLExpanderSegment(new LLStyle(expander_style), getLineStart(last_line), getLength() + 1, "More", *this); + insertSegment(expanderp); + mExpanded = true; } - S32 cur_line = 0; - S32 num_lines = getLineCount(); - S32 line_start = getLineStart(cur_line); - S32 line_height = llround( mDefaultFont->getLineHeight() ) + mLineSpacing; - F32 text_y = (F32) init_y; - segment_set_t::iterator cur_seg = mSegments.begin(); +} - // render a line of text at a time - const LLRect textRect = getLocalRect(); - while((textRect.mBottom <= text_y) && (cur_line < num_lines)) +//NOTE: obliterates existing styles (including hyperlinks) +void LLExpandableTextBox::LLTextBoxEx::hideExpandText() +{ + if (mExpanded) { - S32 next_start = -1; - S32 line_end = text_len; - - if ((cur_line + 1) < num_lines) - { - next_start = getLineStart(cur_line + 1); - line_end = next_start; - } - if ( text[line_end-1] == '\n' ) - { - --line_end; - } - - // render all segments on this line - F32 text_x = init_x; - S32 seg_start = line_start; - while (seg_start < line_end && cur_seg != mSegments.end()) - { - // move to the next segment (or continue the previous one) - LLTextSegment *cur_segment = *cur_seg; - while (cur_segment->getEnd() <= seg_start) - { - if (++cur_seg == mSegments.end()) - { - return; - } - cur_segment = *cur_seg; - } - - // Draw a segment within the line - S32 clipped_end = llmin( line_end, cur_segment->getEnd() ); - S32 clipped_len = clipped_end - seg_start; - if( clipped_len > 0 ) - { - LLStyleSP style = cur_segment->getStyle(); - if (style && style->isVisible()) - { - // work out the color for the segment - LLColor4 color ; - if (getEnabled()) - { - color = style->isLink() ? mLinkColor.get() : mTextColor.get(); - } - else - { - color = mDisabledColor.get(); - } - color = color % alpha; - - S32 max_pixels = textRect.getWidth(); - - if(cur_line + 1 < num_lines - && text_y - line_height < line_height) - { - max_pixels = getCropTextWidth(); - } - - // render a single line worth for this segment - mDefaultFont->render(text, seg_start, text_x, text_y, color, - mHAlign, mVAlign, 0, mShadowType, clipped_len, - max_pixels, &text_x, mUseEllipses); - } - - seg_start += clipped_len; - } - } - - // move down one line - text_y -= (F32)line_height; - line_start = next_start; - cur_line++; - if(text_y < line_height) - { - if( cur_line < num_lines ) - { - showExpandText((S32)text_y); - } - else - { - hideExpandText(); - } - break; - } + // this will overwrite the expander segment and all text styling with a single style + LLNormalTextSegment* segmentp = new LLNormalTextSegment( + new LLStyle(getDefaultStyle()), 0, getLength() + 1, *this); + insertSegment(segmentp); + + mExpanded = false; } } -*/ S32 LLExpandableTextBox::LLTextBoxEx::getVerticalTextDelta() { @@ -295,24 +163,24 @@ S32 LLExpandableTextBox::LLTextBoxEx::getVerticalTextDelta() ////////////////////////////////////////////////////////////////////////// LLExpandableTextBox::Params::Params() -: textbox("textbox") -, scroll("scroll") -, max_height("max_height", 0) -, bg_visible("bg_visible", false) -, expanded_bg_visible("expanded_bg_visible", true) -, bg_color("bg_color", LLColor4::black) -, expanded_bg_color("expanded_bg_color", LLColor4::black) +: textbox("textbox"), + scroll("scroll"), + max_height("max_height", 0), + bg_visible("bg_visible", false), + expanded_bg_visible("expanded_bg_visible", true), + bg_color("bg_color", LLColor4::black), + expanded_bg_color("expanded_bg_color", LLColor4::black) { } LLExpandableTextBox::LLExpandableTextBox(const Params& p) -: LLUICtrl(p) -, mMaxHeight(p.max_height) -, mBGVisible(p.bg_visible) -, mExpandedBGVisible(p.expanded_bg_visible) -, mBGColor(p.bg_color) -, mExpandedBGColor(p.expanded_bg_color) -, mExpanded(false) +: LLUICtrl(p), + mMaxHeight(p.max_height), + mBGVisible(p.bg_visible), + mExpandedBGVisible(p.expanded_bg_visible), + mBGColor(p.bg_color), + mExpandedBGColor(p.expanded_bg_color), + mExpanded(false) { LLRect rc = getLocalRect(); @@ -474,8 +342,6 @@ void LLExpandableTextBox::collapseTextBox() updateTextBoxRect(); - // Should be handled automatically in reshape above. JC - //mTextBox->setWrappedText(mText); if(gFocusMgr.getTopCtrl() == this) { gFocusMgr.setTopCtrl(NULL); diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index 0b9c3f7258..b78a4dc674 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -54,27 +54,11 @@ protected: public: struct Params : public LLInitParam::Block { - Optional expand_textbox; - - Params(); }; - /** - * Draw text box and "More" link - */ - /*virtual*/ void draw(); - -// /** -// * Draws simple text(no urls) line by line, will show or hide "More" link -// * if needed. -// */ -// /*virtual*/ void drawText( S32 x, S32 y, const LLWString &text, const LLColor4& color ); -// -// /** -// * Draws segmented text(with urls) line by line. Will show or hide "More" link -// * if needed -// */ -// void drawTextSegments(S32 x, S32 y, const LLWString &text); + // adds or removes "More" link as needed + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void setValue(const LLSD& value); /** * Returns difference between text box height and text height. @@ -92,11 +76,6 @@ protected: */ virtual S32 getHPad() { return mHPad; } - /** - * Broadcasts "commit" signal if user clicked "More" link - */ - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - protected: LLTextBoxEx(const Params& p); @@ -105,21 +84,16 @@ protected: /** * Shows "More" link */ - void showExpandText(S32 y); + void showExpandText(); /** * Hides "More" link */ void hideExpandText(); - /** - * Returns cropped line width - */ - S32 getCropTextWidth(); - private: - LLTextBox* mExpandTextBox; + bool mExpanded; }; public: diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml index 5a29c6a319..8ed2047a27 100644 --- a/indra/newview/skins/default/xui/en/floater_test_widgets.xml +++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml @@ -316,13 +316,16 @@ height="40" follows="top|left|bottom" layout="topleft" - name="test_text_editor" + name="test_text_box" tool_tip="text box" top_pad="5" width="200"> Text box with multiple lines +and too +many +line to actually fit diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index b4212aaa34..9cf699ad46 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -43,7 +43,7 @@ layout="topleft" top="0" left="0" - width="284" + width="300" height="700"> + width="285"> + width="285"> Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. diff --git a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml index bcfc2f6472..e470f42d36 100644 --- a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml +++ b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml @@ -9,16 +9,6 @@ tab_stop="true" v_pad="2" h_pad="3" > - Date: Mon, 5 Oct 2009 21:16:35 +0000 Subject: Back out revisions 135028,134955,134953,134939 * Revert Vivox SDK update (transplanted from 2e9e33886f348cb9f2c682c2dbfdf7a48371f12c) --- indra/newview/viewer_manifest.py | 14 ++++---------- install.xml | 12 ++++++------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 036fa4923f..d3b0a2e47e 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -249,12 +249,10 @@ class WindowsManifest(ViewerManifest): # Vivox runtimes if self.prefix(src="vivox-runtime/i686-win32", dst=""): self.path("SLVoice.exe") - self.path("libsndfile-1.dll") - self.path("zlib1.dll") + self.path("alut.dll") self.path("vivoxsdk.dll") - self.path("vivoxplatform.dll") self.path("ortp.dll") - self.path("vivoxoal.dll") + self.path("wrap_oal.dll") self.end_prefix() # pull in the crash logger and updater from other projects @@ -464,11 +462,10 @@ class DarwinManifest(ViewerManifest): self.path("zh-Hans.lproj") # SLVoice and vivox lols - self.path("vivox-runtime/universal-darwin/libsndfile.dylib", "libsndfile.dylib") - self.path("vivox-runtime/universal-darwin/libvivoxoal.dylib", "libvivoxoal.dylib") + self.path("vivox-runtime/universal-darwin/libalut.dylib", "libalut.dylib") + self.path("vivox-runtime/universal-darwin/libopenal.dylib", "libopenal.dylib") self.path("vivox-runtime/universal-darwin/libortp.dylib", "libortp.dylib") self.path("vivox-runtime/universal-darwin/libvivoxsdk.dylib", "libvivoxsdk.dylib") - self.path("vivox-runtime/universal-darwin/libvivoxplatform.dylib", "libvivoxplatform.dylib") self.path("vivox-runtime/universal-darwin/SLVoice", "SLVoice") # need to get the kdu dll from any of the build directories as well @@ -721,10 +718,7 @@ class Linux_i686Manifest(LinuxManifest): self.end_prefix() if self.prefix(src="vivox-runtime/i686-linux", dst="lib"): self.path("libortp.so") - self.path("libsndfile.so.1") - self.path("libvivoxoal.so.1") self.path("libvivoxsdk.so") - self.path("libvivoxplatform.so") self.end_prefix("lib") class Linux_x86_64Manifest(LinuxManifest): diff --git a/install.xml b/install.xml index e5a59ff3b1..6366b3104b 100644 --- a/install.xml +++ b/install.xml @@ -1301,23 +1301,23 @@ anguage Infrstructure (CLI) international standard darwin md5sum - 3eb4b31e92e16567e2fa967df9f9b845 + 8675b5eedef038b514338b17f0e55961 url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.0.0006.7278-darwin-20090930a.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-2.1.3010.6270-darwin-20090309.tar.bz2 linux md5sum - 61ab6acd1f4736c5260c492bb60c26af + 01573510dce7f380f44e561ef2f3dd9f url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.0.0006.7278-linux-20090930a.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-2.1.3010.6270-linux-20090309.tar.bz2 windows md5sum - ad5737dbfab87a13b23451b68248b22a + 752daa90e07c05202d1f76980cb955eb url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-3.0.0006.7278-windows-20090930a.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/vivox-2.1.3010.6270-windows-20090309.tar.bz2 -- cgit v1.2.3 From 895e8ad446ab383e1211f759e8b55aa0fff2efc1 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Mon, 5 Oct 2009 22:45:32 +0000 Subject: * EXT-1301 - Fixed showstopper by eliminating the notification that was blocking testing (by getting triggered every frame on a failed media plugin load) (transplanted from 01e271a99e0d975583d06f6c3af6b487e388ab70) --- indra/newview/llviewermedia.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 100a34291b..2b972614f1 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1378,7 +1378,8 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { LLSD args; args["PLUGIN"] = LLMIMETypes::implType(mMimeType); - LLNotifications::instance().add("MediaPluginFailed", args); + // SJB: This is getting called every frame if the plugin fails to load, continuously respawining the alert! + //LLNotifications::instance().add("MediaPluginFailed", args); } break; -- cgit v1.2.3 From d02906b12ee335676e11ac883981e75f4df2cacc Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 12 Oct 2009 17:21:26 -0700 Subject: Added an optional "loaded_duration" parameter to the 'updated' message. This is the duration through which the time-based media has loaded, and should be between zero and the value of the "duration" parameter. If the parameter is not supplied, it will be implicitly set to the same value as the "duration" parameter, so the movie will appear fully loaded. This can be queried with LLPluginClassMedia::getLoadedDuration(). Made the "loaded_duration" parameter also implicitly set the progress percentage and send out MEDIA_EVENT_PROGRESS_UPDATED messages when it changes. Made the quicktime plugin set the "loaded_duration" parameter in its update messages. --- indra/llplugin/llpluginclassmedia.cpp | 23 ++++++++++++++++++++++ indra/llplugin/llpluginclassmedia.h | 2 ++ .../quicktime/media_plugin_quicktime.cpp | 14 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index e019cdcf21..2a343fd0c9 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -133,6 +133,7 @@ void LLPluginClassMedia::reset() mCurrentTime = 0.0f; mDuration = 0.0f; mCurrentRate = 0.0f; + mLoadedDuration = 0.0f; } void LLPluginClassMedia::idle(void) @@ -705,6 +706,7 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) bool time_duration_updated = false; + int previous_percent = mProgressPercent; if(message.hasValue("current_time")) { @@ -722,11 +724,32 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) mCurrentRate = message.getValueReal("current_rate"); } + if(message.hasValue("loaded_duration")) + { + mLoadedDuration = message.getValueReal("loaded_duration"); + time_duration_updated = true; + } + else + { + // If the message doesn't contain a loaded_duration param, assume it's equal to duration + mLoadedDuration = mDuration; + } + + // Calculate a percentage based on the loaded duration and total duration. + if(mDuration != 0.0f) // Don't divide by zero. + { + mProgressPercent = (int)((mLoadedDuration * 100.0f)/mDuration); + } + if(time_duration_updated) { mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_TIME_DURATION_UPDATED); } + if(previous_percent != mProgressPercent) + { + mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PROGRESS_UPDATED); + } } else if(message_name == "media_status") { diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 97f2a11ef2..697deec353 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -231,6 +231,7 @@ public: F64 getCurrentTime(void) const { return mCurrentTime; }; F64 getDuration(void) const { return mDuration; }; F64 getCurrentPlayRate(void) { return mCurrentRate; }; + F64 getLoadedDuration(void) const { return mLoadedDuration; }; // Initialize the URL history of the plugin by sending // "init_history" message @@ -339,6 +340,7 @@ protected: F64 mCurrentTime; F64 mDuration; F64 mCurrentRate; + F64 mLoadedDuration; }; diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index fbda65120d..556865f771 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -103,6 +103,7 @@ private: message.setValueReal("current_time", getCurrentTime()); message.setValueReal("duration", getDuration()); message.setValueReal("current_rate", Fix2X(GetMovieRate(mMovieHandle))); + message.setValueReal("loaded_duration", getLoadedDuration()); } sendMessage(message); @@ -593,6 +594,19 @@ private: return (F64)duration / (F64)scale; }; + F64 getLoadedDuration() + { + TimeValue duration; + if(GetMaxLoadedTimeInMovie( mMovieHandle, &duration ) != noErr) + { + // If GetMaxLoadedTimeInMovie returns an error, return the full duration of the movie. + duration = GetMovieDuration( mMovieHandle ); + } + TimeValue scale = GetMovieTimeScale( mMovieHandle ); + + return (F64)duration / (F64)scale; + }; + F64 getCurrentTime() { TimeValue curr_time = GetMovieTime( mMovieHandle, 0 ); -- cgit v1.2.3 From 780719c14c6c2921eaf0a6021a4082b5486efafb Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 12 Oct 2009 17:52:33 -0700 Subject: Add some more logging to help triage media client problems --- indra/newview/llmediadataclient.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 3a1b47554c..255f6d1f84 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -357,7 +357,7 @@ BOOL LLMediaDataClient::QueueTimer::tick() return TRUE; } - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, queue is: " << queue << LL_ENDL; + LL_INFOS("LLMediaDataClient") << "QueueTimer::tick() started, queue is: " << queue << LL_ENDL; // Peel one off of the items from the queue, and execute request request_ptr_t request = queue.top(); @@ -382,9 +382,13 @@ BOOL LLMediaDataClient::QueueTimer::tick() } } else { - if (!object->hasMedia()) + if (NULL == object) { - LL_INFOS("LLMediaDataClient") << "Not Sending request for " << *request << " hasMedia() is false!" << LL_ENDL; + LL_WARNS("LLMediaDataClient") << "Not Sending request for " << *request << " NULL object!" << LL_ENDL; + } + else if (!object->hasMedia()) + { + LL_WARNS("LLMediaDataClient") << "Not Sending request for " << *request << " hasMedia() is false!" << LL_ENDL; } } bool exceeded_retries = request->getRetryCount() > mMDC->mMaxNumRetries; @@ -414,6 +418,9 @@ void LLMediaDataClient::startQueueTimer() // LLEventTimer automagically takes care of the lifetime of this object new QueueTimer(mQueueTimerDelay, this); } + else { + LL_DEBUGS("LLMediaDataClient") << "not starting queue timer (it's already running, right???)" << LL_ENDL; + } } void LLMediaDataClient::stopQueueTimer() -- cgit v1.2.3 From f154a3a23f9dad1e4222ad0f90a40f4f79b38508 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 12 Oct 2009 19:47:39 -0700 Subject: Changed llmediaplugintest into a bundled app on the mac, to solve some issues around the newly-dynamic libllcommon.dylib. This includes making it set the current working directory to a known location inside its bundle on launch. Changed indra/test_apps/llplugintest/CMakeLists.txt to copy various bits now needed inside the app bundle on the mac. --- indra/test_apps/llplugintest/CMakeLists.txt | 64 +++++++++++++++++++--- indra/test_apps/llplugintest/llmediaplugintest.cpp | 20 +++++++ 2 files changed, 77 insertions(+), 7 deletions(-) diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt index 295882c49a..88c4ba8ad9 100644 --- a/indra/test_apps/llplugintest/CMakeLists.txt +++ b/indra/test_apps/llplugintest/CMakeLists.txt @@ -28,7 +28,7 @@ include_directories( if (DARWIN) include(CMakeFindFrameworks) - find_library(CARBON_LIBRARY Carbon) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) endif (DARWIN) ### demo_plugin @@ -261,6 +261,7 @@ set(llmediaplugintest_SOURCE_FILES add_executable(llmediaplugintest WIN32 + MACOSX_BUNDLE ${llmediaplugintest_SOURCE_FILES} ) @@ -280,6 +281,13 @@ target_link_libraries(llmediaplugintest ${PLUGIN_API_WINDOWS_LIBRARIES} ) +if (DARWIN) + # The testbed needs to use a couple of CoreFoundation calls now, to deal with being a bundled app. + target_link_libraries(llmediaplugintest + ${COREFOUNDATION_LIBRARY} + ) +endif (DARWIN) + add_dependencies(llmediaplugintest stage_third_party_libs SLPlugin @@ -300,22 +308,64 @@ endif (DARWIN OR LINUX) # Gather build products of the various dependencies into the build directory for the testbed. +if (DARWIN) + # path inside the app bundle where we'll need to copy plugins and other related files + set(PLUGINS_DESTINATION_DIR + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llmediaplugintest.app/Contents/Resources + ) + + # create the Contents/Resources directory + add_custom_command( + TARGET llmediaplugintest POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + -E + make_directory + ${PLUGINS_DESTINATION_DIR} + COMMENT "Creating Resources directory in app bundle." + ) + + # copy the llcommon dylib and its dependencies to Contents/Resources. + get_target_property(BUILT_LLCOMMON llcommon LOCATION) + add_custom_command(TARGET llmediaplugintest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON} ${PLUGINS_DESTINATION_DIR} + DEPENDS ${BUILT_LLCOMMON} + ) + # FIXME: these paths should come from somewhere reliable. The canonical list seems to be in indra/newview/viewer_manifest.py + add_custom_command(TARGET llmediaplugintest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.0.3.7.dylib ${PLUGINS_DESTINATION_DIR} + DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.0.3.7.dylib + ) + add_custom_command(TARGET llmediaplugintest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.0.3.8.dylib ${PLUGINS_DESTINATION_DIR} + DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.0.3.8.dylib + ) + add_custom_command(TARGET llmediaplugintest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.0.5.0.dylib ${PLUGINS_DESTINATION_DIR} + DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.0.5.0.dylib + ) +else (DARWIN) + set(PLUGINS_DESTINATION_DIR + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ + ) +endif (DARWIN) + get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION) add_custom_command(TARGET llmediaplugintest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ + COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_SLPLUGIN} ) if (DARWIN OR WINDOWS) get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION) add_custom_command(TARGET llmediaplugintest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ + COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_WEBKIT_PLUGIN} ) get_target_property(BUILT_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION) add_custom_command(TARGET llmediaplugintest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_QUICKTIME_PLUGIN} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ + COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_QUICKTIME_PLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_QUICKTIME_PLUGIN} ) @@ -325,16 +375,16 @@ if (DARWIN OR WINDOWS) COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/ DEPENDS ${BUILT_LLMEDIAPLUGINTEST} ) - # also copy it to the build configuration directory, which is what the mac wants... + # also copy it to the same place as SLPlugin, which is what the mac wants... add_custom_command(TARGET llmediaplugintest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_LLMEDIAPLUGINTEST} ) endif (DARWIN OR WINDOWS) if (DARWIN) add_custom_command(TARGET llmediaplugintest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib ${PLUGINS_DESTINATION_DIR} DEPENDS ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib ) endif (DARWIN) diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp index f9568a9b5d..ba66b449f3 100644 --- a/indra/test_apps/llplugintest/llmediaplugintest.cpp +++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp @@ -44,6 +44,7 @@ #if __APPLE__ #include + #include #else #define FREEGLUT_STATIC #include "GL/freeglut.h" @@ -2111,6 +2112,25 @@ void glutMouseButton( int button, int state, int x, int y ) // int main( int argc, char* argv[] ) { +#if LL_DARWIN + // Set the current working directory to /Contents/Resources/ + CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); + if(resources_url != NULL) + { + CFStringRef resources_string = CFURLCopyFileSystemPath(resources_url, kCFURLPOSIXPathStyle); + CFRelease(resources_url); + if(resources_string != NULL) + { + char buffer[PATH_MAX] = ""; + if(CFStringGetCString(resources_string, buffer, sizeof(buffer), kCFStringEncodingUTF8)) + { + chdir(buffer); + } + CFRelease(resources_string); + } + } +#endif + glutInit( &argc, argv ); glutInitDisplayMode( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB ); -- cgit v1.2.3 From 630e003347bf638455d35494af4c57c28474139c Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 13 Oct 2009 13:05:19 -0700 Subject: Potential fix for unit test (though I can't run it :( ) --- indra/newview/tests/llmediadataclient_test.cpp | 48 +++++++++++++++----------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index a884ed0265..7d424c9326 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -186,6 +186,15 @@ private: int mNumBounceBacks; }; +// This special timer delay should ensure that the timer will fire on the very +// next pump, no matter what (though this does make an assumption about the +// implementation of LLEventTimer::updateClass()): +const F32 NO_PERIOD = -1000.0f; + +static void pump_timers() +{ + LLEventTimer::updateClass(); +} namespace tut { @@ -256,14 +265,13 @@ namespace tut LLMediaDataClientObject::ptr_t o = new LLMediaDataClientObjectTest(DATA); int num_refs_start = o->getNumRefs(); { - // queue time w/ no delay ensures that LLEventTimer::updateClass() will hit the tick() - LLPointer mdc = new LLObjectMediaDataClient(0,0,4); + LLPointer mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD); mdc->fetchMedia(o); // Make sure no posts happened yet... ensure("post records", gPostRecords->size(), 0); - LLEventTimer::updateClass(); + ::pump_timers(); ensure("post records", gPostRecords->size(), 1); ensure("post url", (*gPostRecords)[0]["url"], FAKE_OBJECT_MEDIA_CAP_URL); @@ -288,11 +296,11 @@ namespace tut LLMediaDataClientObject::ptr_t o = new LLMediaDataClientObjectTest(DATA); { - // queue time w/ no delay ensures that LLEventTimer::updateClass() will hit the tick() - LLPointer mdc = new LLObjectMediaDataClient(0,0,4); + // queue time w/ no delay ensures that ::pump_timers() will hit the tick() + LLPointer mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD); mdc->updateMedia(o); ensure("post records", gPostRecords->size(), 0); - LLEventTimer::updateClass(); + ::pump_timers(); ensure("post records", gPostRecords->size(), 1); ensure("post url", (*gPostRecords)[0]["url"], FAKE_OBJECT_MEDIA_CAP_URL); @@ -318,11 +326,11 @@ namespace tut LLMediaDataClientObject::ptr_t o = new LLMediaDataClientObjectTest(DATA); { - LLPointer mdc = new LLObjectMediaNavigateClient(0,0,4); + LLPointer mdc = new LLObjectMediaNavigateClient(NO_PERIOD,NO_PERIOD); const char *TEST_URL = "http://example.com"; mdc->navigate(o, 0, TEST_URL); ensure("post records", gPostRecords->size(), 0); - LLEventTimer::updateClass(); + ::pump_timers(); // ensure no bounce back ensure("bounce back", dynamic_cast(static_cast(o))->getNumBounceBacks(), 0); @@ -354,7 +362,7 @@ namespace tut LLMediaDataClientObject::ptr_t o3 = new LLMediaDataClientObjectTest( _DATA(VALID_OBJECT_ID_3,"2.0","1.0")); { - LLPointer mdc = new LLObjectMediaDataClient(0,0,4); + LLPointer mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD); const char *ORDERED_OBJECT_IDS[] = { VALID_OBJECT_ID_2, VALID_OBJECT_ID_3, VALID_OBJECT_ID_1 }; mdc->fetchMedia(o1); mdc->fetchMedia(o2); @@ -364,11 +372,11 @@ namespace tut ensure("post records", gPostRecords->size(), 0); // tick 3 times... - LLEventTimer::updateClass(); + ::pump_timers(); ensure("post records", gPostRecords->size(), 1); - LLEventTimer::updateClass(); + ::pump_timers(); ensure("post records", gPostRecords->size(), 2); - LLEventTimer::updateClass(); + ::pump_timers(); ensure("post records", gPostRecords->size(), 3); for( int i=0; i < 3; i++ ) @@ -405,7 +413,7 @@ namespace tut int num_refs_start = o->getNumRefs(); { const int NUM_RETRIES = 5; - LLPointer mdc = new LLObjectMediaDataClient(0,0,NUM_RETRIES); + LLPointer mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD,NUM_RETRIES); // This should generate a retry mdc->fetchMedia(o); @@ -418,15 +426,15 @@ namespace tut // Third, fires queue timer again for (int i=0; isize(), i+1); - LLEventTimer::updateClass(); + ::pump_timers(); } // Do some extre pumps to make sure no other timer work occurs. - LLEventTimer::updateClass(); - LLEventTimer::updateClass(); - LLEventTimer::updateClass(); + ::pump_timers(); + ::pump_timers(); + ::pump_timers(); // Make sure there were 2 posts ensure("post records after", gPostRecords->size(), NUM_RETRIES); @@ -458,11 +466,11 @@ namespace tut FAKE_OBJECT_MEDIA_CAP_URL, FAKE_OBJECT_MEDIA_NAVIGATE_CAP_URL_ERROR)); { - LLPointer mdc = new LLObjectMediaNavigateClient(0,0,4); + LLPointer mdc = new LLObjectMediaNavigateClient(NO_PERIOD,NO_PERIOD); const char *TEST_URL = "http://example.com"; mdc->navigate(o, 0, TEST_URL); ensure("post records", gPostRecords->size(), 0); - LLEventTimer::updateClass(); + ::pump_timers(); // ensure bounce back ensure("bounce back", -- cgit v1.2.3 From d5c43669d504549966083ded67ee59ceaf8c4c26 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 13 Oct 2009 14:07:19 -0700 Subject: DEV-388867, DEV-39246 Escape key cancels zoom, zoom in closer I also refactored the code a little to be able to experiment with more zoom levels. Review #13 --- indra/newview/llviewermediafocus.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index 1b1b7cedb1..db31714f16 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -290,6 +290,11 @@ BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent) { if(mMediaImpl.notNull()) mMediaImpl->handleKeyHere(key, mask); + + if (key == KEY_ESCAPE && mMediaHUD.get()) + { + mMediaHUD.get()->close(); + } return true; } -- cgit v1.2.3 From d9c1237e6f64f61fd9a8c8dc529f4c5e595cfaef Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 13 Oct 2009 16:35:49 -0700 Subject: Disable boost::lexical_cast warning --- indra/newview/tests/llmediadataclient_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index 7d424c9326..b4700c9bbc 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -46,7 +46,14 @@ #include "../../llprimitive/lltextureentry.cpp" #include "../../llmessage/tests/llcurl_stub.cpp" +#if LL_WINDOWS +#pragma warning (push) +#pragma warning (disable : 4702) // boost::lexical_cast generates this warning +#endif #include +#if LL_WINDOWS +#pragma warning (pop) +#endif #define VALID_OBJECT_ID "3607d5c4-644b-4a8a-871a-8b78471af2a2" #define VALID_OBJECT_ID_1 "11111111-1111-1111-1111-111111111111" -- cgit v1.2.3 From 2b435439bbecafeedd94d6c7ea4d21d101172da1 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Tue, 13 Oct 2009 16:48:14 -0700 Subject: Adding debugging info to LLViewerMediaImpl::navigateTo --- indra/newview/llviewermedia.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 3a503f22a0..6a40c76757 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1017,6 +1017,9 @@ void LLViewerMediaImpl::navigateHome() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type, bool server_request) { + // Helpful to have media urls in log file. Shouldn't be spammy. + llinfos << "url=" << url << " mime_type=" << mime_type << llendl; + if(server_request) { setNavState(MEDIANAVSTATE_SERVER_SENT); -- cgit v1.2.3 From 3d2bbe611ab1c94f06381576daaf0e5ea905713a Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Tue, 13 Oct 2009 16:50:31 -0700 Subject: Made VersionChannelName not persist to reduce confusion. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ecad5dfe41..f1e5acdd74 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9981,7 +9981,7 @@ Comment Versioning Channel Name. Persist - 1 + 0 Type String Value -- cgit v1.2.3 From 3f2ba601eabb36958b7baba4d4e8acd4f6c21f98 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Tue, 13 Oct 2009 18:43:55 -0700 Subject: Setting checked in version of llviewerversion.h to 2.0.0(0) --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 9a230516d5..2c3e9c7333 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -36,7 +36,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 0; const S32 LL_VERSION_PATCH = 0; -const S32 LL_VERSION_BUILD = 2822; +const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; -- cgit v1.2.3 From 628e10b08008c578512687a687439108bebeb7b7 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 13 Oct 2009 19:56:38 -0700 Subject: "Fix" unit test: you can't count on timers being scheduled to not actually also fire in the same 'pump' --- indra/newview/tests/llmediadataclient_test.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index b4700c9bbc..445ec7aa34 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -29,6 +29,8 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ + +#include "linden_common.h" #include "../llviewerprecompiledheaders.h" #include @@ -210,9 +212,9 @@ namespace tut mediadataclient() { gPostRecords = &mLLSD; -// LLError::setDefaultLevel(LLError::LEVEL_DEBUG); -// LLError::setClassLevel("LLMediaDataClient", LLError::LEVEL_DEBUG); -// LLError::setTagLevel("MediaOnAPrim", LLError::LEVEL_DEBUG); + //LLError::setDefaultLevel(LLError::LEVEL_DEBUG); + //LLError::setClassLevel("LLMediaDataClient", LLError::LEVEL_DEBUG); + //LLError::setTagLevel("MediaOnAPrim", LLError::LEVEL_DEBUG); } LLSD mLLSD; }; @@ -433,12 +435,13 @@ namespace tut // Third, fires queue timer again for (int i=0; isize(), i+1); - ::pump_timers(); + ::pump_timers(); // Should pump (fire) the queue timer, causing a retry timer to be scheduled + // XXX This ensure is not guaranteed, because scheduling a timer might actually get it pumped in the same loop + //ensure("post records " + STR(i), gPostRecords->size(), i+1); + ::pump_timers(); // Should pump (fire) the retry timer, scheduling the queue timer } - // Do some extre pumps to make sure no other timer work occurs. + // Do some extra pumps to make sure no other timer work occurs. ::pump_timers(); ::pump_timers(); ::pump_timers(); -- cgit v1.2.3 From 2aff213501eb366f32a048150fc81726beba4e6e Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 13 Oct 2009 20:12:52 -0700 Subject: Fix signature of LLError::setTagLevel() --- indra/llcommon/llerrorcontrol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index e069232798..233e9d3389 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -84,7 +84,7 @@ namespace LLError LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel); LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel); LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel); - void setTagLevel(const std::string& file_name, LLError::ELevel); + LL_COMMON_API void setTagLevel(const std::string& file_name, LLError::ELevel); LL_COMMON_API void configure(const LLSD&); // the LLSD can configure all of the settings -- cgit v1.2.3 From 4598a4a621635be9d507534f613d3768edcb62ec Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 13 Oct 2009 20:52:04 -0700 Subject: Another attempt at fixing unit test, this one is weirder. Don't schedule the queue timer in the tick() of the retry timer. Instead, schedule it in the RetryTimer's destructor. This is an artifact of how the LLEventTimer's loop is handled. --- indra/newview/llmediadataclient.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 255f6d1f84..f797f15865 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -182,15 +182,20 @@ LLMediaDataClient::Responder::RetryTimer::RetryTimer(F32 time, Responder *mdr) LLMediaDataClient::Responder::RetryTimer::~RetryTimer() { LL_DEBUGS("LLMediaDataClient") << "~RetryTimer" << *(mResponder->getRequest()) << LL_ENDL; + + // XXX This is weird: Instead of doing the work in tick() (which re-schedules + // a timer, which might be risky), do it here, in the destructor. Yes, it is very odd. + // Instead of retrying, we just put the request back onto the queue + LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *(mResponder->getRequest()) << "retrying" << LL_ENDL; + mResponder->getRequest()->reEnqueue(); + + // Release the ref to the responder. mResponder = NULL; } // virtual BOOL LLMediaDataClient::Responder::RetryTimer::tick() { - // Instead of retrying, we just put the request back onto the queue - LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *(mResponder->getRequest()) << "retrying" << LL_ENDL; - mResponder->getRequest()->reEnqueue(); // Don't fire again return TRUE; } -- cgit v1.2.3 From 47e02d13f7e6307d9eb507177b88bbf0ab496894 Mon Sep 17 00:00:00 2001 From: CG Linden Date: Wed, 14 Oct 2009 16:41:48 -0700 Subject: Increase the .dmg setup size from 500MB to 700MB --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 41aa13614e..f2e89ef062 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -626,7 +626,7 @@ class DarwinManifest(ViewerManifest): # make sure we don't have stale files laying about self.remove(sparsename, finalname) - self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 500 -layout SPUD' % { + self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 700 -layout SPUD' % { 'sparse':sparsename, 'vol':volname}) -- cgit v1.2.3 From 050ae3cf5107140a58f6aeae865d254b74a23d44 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 15 Oct 2009 15:43:59 -0400 Subject: Merge up to latest viewer/viewer-2-0 --- indra/llcommon/llversionserver.h | 2 +- indra/llcommon/llversionviewer.h | 2 +- indra/newview/English.lproj/InfoPlist.strings | 4 ++-- indra/newview/Info-SecondLife.plist | 2 +- indra/newview/res/viewerRes.rc | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llversionserver.h index aee7c6ee1e..71c6fc0591 100644 --- a/indra/llcommon/llversionserver.h +++ b/indra/llcommon/llversionserver.h @@ -36,7 +36,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 31; const S32 LL_VERSION_PATCH = 0; -const S32 LL_VERSION_BUILD = 2822; +const S32 LL_VERSION_BUILD = 3256; const char * const LL_CHANNEL = "Second Life Server"; diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 2c3e9c7333..082d054ba2 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -36,7 +36,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 0; const S32 LL_VERSION_PATCH = 0; -const S32 LL_VERSION_BUILD = 0; +const S32 LL_VERSION_BUILD = 3256; const char * const LL_CHANNEL = "Second Life Developer"; diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings index afa5a877b5..dceaba9a43 100644 --- a/indra/newview/English.lproj/InfoPlist.strings +++ b/indra/newview/English.lproj/InfoPlist.strings @@ -2,6 +2,6 @@ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 2.0.0.2822"; -CFBundleGetInfoString = "Second Life version 2.0.0.2822, Copyright 2004-2009 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version 2.0.0.3256"; +CFBundleGetInfoString = "Second Life version 2.0.0.3256, Copyright 2004-2009 Linden Research, Inc."; diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 1df5102f5f..7aec8a343d 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -32,7 +32,7 @@ CFBundleVersion - 2.0.0.2822 + 2.0.0.3256 CSResourcesFileMapped diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc index 63b76d4f5d..433070ce34 100644 --- a/indra/newview/res/viewerRes.rc +++ b/indra/newview/res/viewerRes.rc @@ -134,8 +134,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,0,0,2822 - PRODUCTVERSION 2,0,0,2822 + FILEVERSION 2,0,0,3256 + PRODUCTVERSION 2,0,0,3256 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -152,12 +152,12 @@ BEGIN BEGIN VALUE "CompanyName", "Linden Lab" VALUE "FileDescription", "Second Life" - VALUE "FileVersion", "2.0.0.2822" + VALUE "FileVersion", "2.0.0.3256" VALUE "InternalName", "Second Life" VALUE "LegalCopyright", "Copyright © 2001-2008, Linden Research, Inc." VALUE "OriginalFilename", "SecondLife.exe" VALUE "ProductName", "Second Life" - VALUE "ProductVersion", "2.0.0.2822" + VALUE "ProductVersion", "2.0.0.3256" END END BLOCK "VarFileInfo" -- cgit v1.2.3