From cdb223228479e97d9cfe7d80d0afef0d99179d24 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 25 Nov 2009 18:24:39 -0800 Subject: created container for LLFloaterView for future z-swapping with sidetray floaters can now overlap sidetray fixed text selection background color to be inverse of text fg color EXT-2713 Script editor automatically scrolls to the top of script text when text is longer than the window. reviewed by James --- indra/llui/llfloater.cpp | 5 ++--- indra/llui/llscrollcontainer.cpp | 5 +++-- indra/llui/llscrollcontainer.h | 2 +- indra/llui/lltextbase.cpp | 34 +++++++++++++++++----------------- indra/llui/lltooltip.cpp | 5 ++--- 5 files changed, 25 insertions(+), 26 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8cf65fe76a..36a9e0a650 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2347,8 +2347,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } LLRect::tCoordType screen_width = getSnapRect().getWidth(); LLRect::tCoordType screen_height = getSnapRect().getHeight(); - // convert to local coordinate frame - LLRect snap_rect_local = getLocalSnapRect(); + // only automatically resize non-minimized, resizable floaters if( floater->isResizable() && !floater->isMinimized() ) @@ -2388,7 +2387,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } // move window fully onscreen - if (floater->translateIntoRect( snap_rect_local, allow_partial_outside )) + if (floater->translateIntoRect( getLocalRect(), allow_partial_outside )) { floater->clearSnapTarget(); } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 5e17372fe9..53c5a8d07d 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -584,8 +584,9 @@ LLRect LLScrollContainer::getVisibleContentRect() return visible_rect; } -LLRect LLScrollContainer::getContentWindowRect() const +LLRect LLScrollContainer::getContentWindowRect() { + updateScroll(); LLRect scroller_view_rect; S32 visible_width = 0; S32 visible_height = 0; @@ -625,7 +626,7 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const rect_to_constrain.mTop - constraint.mTop); // translate from allowable region for lower left corner to upper left corner - allowable_scroll_rect.translate(0, content_window_rect.getHeight()); + allowable_scroll_rect.translate(0, content_window_rect.getHeight() - 1); S32 vert_pos = llclamp(mScrollbar[VERTICAL]->getDocPos(), mScrollbar[VERTICAL]->getDocSize() - allowable_scroll_rect.mTop, // min vertical scroll diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index ac8ffe5258..25dcd071ab 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -96,7 +96,7 @@ public: void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; } LLRect getVisibleContentRect(); - LLRect getContentWindowRect() const; + LLRect getContentWindowRect(); const LLRect& getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; } void pageUp(S32 overlap = 0); void pageDown(S32 overlap = 0); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7bf10d774c..6f9f98187c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -379,10 +379,10 @@ void LLTextBase::drawSelectionBackground() // Draw the selection box (we're using a box instead of reversing the colors on the selected text). gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - const LLColor4& color = mReadOnly ? mReadOnlyBgColor.get() : mWriteableBgColor.get(); + const LLColor4& color = mReadOnly ? mReadOnlyFgColor.get() : mFgColor.get(); F32 alpha = hasFocus() ? 0.7f : 0.3f; alpha *= getDrawContext().mAlpha; - gGL.color4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha ); + LLColor4 selection_color(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], alpha); for (std::vector::iterator rect_it = selection_rects.begin(); rect_it != selection_rects.end(); @@ -390,7 +390,7 @@ void LLTextBase::drawSelectionBackground() { LLRect selection_rect = *rect_it; selection_rect.translate(mTextRect.mLeft - content_display_rect.mLeft, mTextRect.mBottom - content_display_rect.mBottom); - gl_rect_2d(selection_rect); + gl_rect_2d(selection_rect, selection_color); } } } @@ -1080,6 +1080,8 @@ void LLTextBase::reflow(S32 start_index) mScrollIndex = mLineInfoList[first_line].mDocIndexStart; } LLRect first_char_rect = getLocalRectFromDocIndex(mScrollIndex); + // subtract off effect of horizontal scrollbar from local position of first char + first_char_rect.translate(-mTextRect.mLeft, -mTextRect.mBottom); S32 cur_top = 0; @@ -1195,7 +1197,6 @@ void LLTextBase::reflow(S32 start_index) // apply scroll constraints after reflowing text if (!hasMouseCapture() && mScroller) { - LLRect visible_content_rect = getVisibleDocumentRect(); if (scrolled_to_bottom && mTrackEnd) { // keep bottom of text buffer visible @@ -1204,18 +1205,16 @@ void LLTextBase::reflow(S32 start_index) else if (hasSelection() && follow_selection) { // keep cursor in same vertical position on screen when selecting text - LLRect new_cursor_rect_doc = getLocalRectFromDocIndex(mCursorPos); - new_cursor_rect_doc.translate(visible_content_rect.mLeft, visible_content_rect.mBottom); - mScroller->scrollToShowRect(new_cursor_rect_doc, old_cursor_rect); - //llassert_always(getLocalRectFromDocIndex(mCursorPos).mBottom == old_cursor_rect.mBottom); + LLRect new_cursor_rect_doc = getDocRectFromDocIndex(mCursorPos); + LLRect old_cursor_rect_scroller = old_cursor_rect; + old_cursor_rect.translate(-mTextRect.mLeft, -mTextRect.mBottom); + mScroller->scrollToShowRect(new_cursor_rect_doc, old_cursor_rect_scroller); } else { // keep first line of text visible - LLRect new_first_char_rect = getLocalRectFromDocIndex(mScrollIndex); - new_first_char_rect.translate(visible_content_rect.mLeft, visible_content_rect.mBottom); + LLRect new_first_char_rect = getDocRectFromDocIndex(mScrollIndex); mScroller->scrollToShowRect(new_first_char_rect, first_char_rect); - //llassert_always(getLocalRectFromDocIndex(mScrollIndex).mBottom == first_char_rect.mBottom); } } @@ -1464,14 +1463,16 @@ void LLTextBase::setText(const LLStringExplicit &utf8str ,const LLStyle::Params& clearSegments(); // createDefaultSegment(); - startOfDoc(); deselect(); // append the new text (supports Url linking) std::string text(utf8str); LLStringUtil::removeCRLF(text); + // appendText modifies mCursorPos... appendText(text, false, input_params); + // ...so move cursor to top after appending text + startOfDoc(); onValueChange(0, getLength()); } @@ -2065,16 +2066,15 @@ void LLTextBase::updateRects() mContentsRect.unionWith(line_iter->mRect); } - S32 delta_pos_x = -mContentsRect.mLeft; mContentsRect.mTop += mVPad; S32 delta_pos = -mContentsRect.mBottom; // move line segments to fit new document rect for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) { - it->mRect.translate(delta_pos_x, delta_pos); + it->mRect.translate(0, delta_pos); } - mContentsRect.translate(delta_pos_x, delta_pos); + mContentsRect.translate(0, delta_pos); } // update document container dimensions according to text contents @@ -2281,7 +2281,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele LLFontGL::LEFT, LLFontGL::TOP, 0, LLFontGL::NO_SHADOW, - length, rect.mRight, + length, rect.getWidth(), &right_x, mEditor.getUseEllipses()); } @@ -2298,7 +2298,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele LLFontGL::LEFT, LLFontGL::TOP, 0, mStyle->getShadowType(), - length, rect.mRight, + length, rect.getWidth(), &right_x, mEditor.getUseEllipses()); } diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 959313a5b6..cf135997b2 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -300,9 +300,8 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) mTextBox->setText(p.message()); } - LLRect text_contents_rect = mTextBox->getContentsRect(); - S32 text_width = llmin(p.max_width(), text_contents_rect.getWidth()); - S32 text_height = text_contents_rect.getHeight(); + S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth()); + S32 text_height = mTextBox->getTextPixelHeight(); mTextBox->reshape(text_width, text_height); // reshape tooltip panel to fit text box -- cgit v1.2.3 From 617ca79ed073604883f3e0e21b2e81a3786bbe6f Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 25 Nov 2009 18:55:15 -0800 Subject: forgot to apply resize fix for when text is selected EXT-1995 - [BSI] Get rid of the *blop* sound when a textbox contains more text than displayable --- indra/llui/lltextbase.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 6f9f98187c..4a7d17cc62 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -641,8 +641,6 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s if ( truncate() ) { - // The user's not getting everything he's hoping for - make_ui_sound("UISndBadKeystroke"); insert_len = getLength() - old_len; } @@ -1070,6 +1068,8 @@ void LLTextBase::reflow(S32 start_index) LLRect old_cursor_rect = getLocalRectFromDocIndex(mCursorPos); bool follow_selection = mTextRect.overlaps(old_cursor_rect); // cursor is visible + old_cursor_rect.translate(-mTextRect.mLeft, -mTextRect.mBottom); + S32 first_line = getFirstVisibleLine(); // if scroll anchor not on first line, update it to first character of first line @@ -1206,9 +1206,7 @@ void LLTextBase::reflow(S32 start_index) { // keep cursor in same vertical position on screen when selecting text LLRect new_cursor_rect_doc = getDocRectFromDocIndex(mCursorPos); - LLRect old_cursor_rect_scroller = old_cursor_rect; - old_cursor_rect.translate(-mTextRect.mLeft, -mTextRect.mBottom); - mScroller->scrollToShowRect(new_cursor_rect_doc, old_cursor_rect_scroller); + mScroller->scrollToShowRect(new_cursor_rect_doc, old_cursor_rect); } else { -- cgit v1.2.3 From edcd835febac3758d1522b4ec51bba60eeafcd63 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 25 Nov 2009 19:14:55 -0800 Subject: fixed line numbering in script editors --- indra/llui/lltextbase.cpp | 4 ++++ indra/llui/lltexteditor.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 4a7d17cc62..e515170b0c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1180,6 +1180,10 @@ void LLTextBase::reflow(S32 start_index) ++seg_iter; seg_offset = 0; } + if (force_newline) + { + line_count++; + } } // calculate visible region for diplaying text diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 3f4ef24f82..0e8db09980 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2158,7 +2158,7 @@ void LLTextEditor::drawLineNumbers() return; } - S32 cursor_line = getLineNumFromDocIndex(mCursorPos); + S32 cursor_line = mLineInfoList[getLineNumFromDocIndex(mCursorPos)].mLineNum; if (mShowLineNumbers) { -- cgit v1.2.3 From 4885ddab8d729dd036155e479f1ce2221074a4ac Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 25 Nov 2009 19:55:24 -0800 Subject: EXT-1944 - Implement ellipsis in message well EXT-699 - Toasts should display maximum 6 lines of text before ellipses are applied EXT-2453 - TextBox displays an extra line of text --- indra/llui/lltextbase.cpp | 22 ++++++++++++++++++---- indra/llui/lltextbase.h | 5 ++++- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e515170b0c..02fcac8f69 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -156,6 +156,7 @@ LLTextBase::Params::Params() read_only("read_only", false), v_pad("v_pad", 0), h_pad("h_pad", 0), + clip_partial("clip_partial", true), line_spacing("line_spacing"), max_text_length("max_length", 255), font_shadow("font_shadow"), @@ -193,6 +194,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mHAlign(p.font_halign), mLineSpacingMult(p.line_spacing.multiple), mLineSpacingPixels(p.line_spacing.pixels), + mClipPartial(p.clip_partial), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -504,7 +506,7 @@ void LLTextBase::drawText() } LLRect scrolled_view_rect = getVisibleDocumentRect(); - std::pair line_range = getVisibleLines(); + std::pair line_range = getVisibleLines(mClipPartial); S32 first_line = line_range.first; S32 last_line = line_range.second; if (first_line >= last_line) @@ -524,6 +526,7 @@ void LLTextBase::drawText() for (S32 cur_line = first_line; cur_line < last_line; cur_line++) { + S32 next_line = cur_line + 1; line_info& line = mLineInfoList[cur_line]; if ((line.mRect.mTop - scrolled_view_rect.mBottom) < mTextRect.mBottom) @@ -534,15 +537,15 @@ void LLTextBase::drawText() S32 next_start = -1; S32 line_end = text_len; - if ((cur_line + 1) < getLineCount()) + if (next_line < getLineCount()) { - next_start = getLineStart(cur_line + 1); + next_start = getLineStart(next_line); line_end = next_start; } LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft, line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom, - mDocumentView->getRect().getWidth() - scrolled_view_rect.mLeft, + line.mRect.mRight - scrolled_view_rect.mLeft, line.mRect.mBottom - scrolled_view_rect.mBottom + mTextRect.mBottom); // draw a single line of text @@ -562,6 +565,17 @@ void LLTextBase::drawText() } S32 clipped_end = llmin( line_end, cur_segment->getEnd() ) - cur_segment->getStart(); + + if (mUseEllipses + && clipped_end == line_end + && next_line == last_line + && last_line < (S32)mLineInfoList.size()) + { + // more text to go, but we can't fit it + // so attempt to draw one extra character to force ellipses + clipped_end++; + } + text_rect.mLeft = (S32)(cur_segment->draw(seg_start - cur_segment->getStart(), clipped_end, selection_left, selection_right, text_rect)); seg_start = clipped_end + cur_segment->getStart(); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index c376a73615..c60b040655 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -84,11 +84,13 @@ public: wrap, use_ellipses, allow_html, - parse_highlights; + parse_highlights, + clip_partial; Optional v_pad, h_pad; + Optional line_spacing; @@ -347,6 +349,7 @@ protected: bool mTrackEnd; // if true, keeps scroll position at end of document during resize bool mReadOnly; bool mBGVisible; // render background? + bool mClipPartial; // false if we show lines that are partially inside bounding rect S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes // support widgets -- cgit v1.2.3 From 9d52d15db8b61ff3172fadb1b82cd39f892251c5 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 25 Nov 2009 20:11:04 -0800 Subject: fix for ellipses on a single line --- indra/llui/lltextbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 02fcac8f69..64164df17f 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -545,7 +545,7 @@ void LLTextBase::drawText() LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft, line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom, - line.mRect.mRight - scrolled_view_rect.mLeft, + llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft, line.mRect.mBottom - scrolled_view_rect.mBottom + mTextRect.mBottom); // draw a single line of text -- cgit v1.2.3 From 928b7cba3ec0eb675a254ff840f398b70e5a8a8c Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 25 Nov 2009 22:00:15 -0800 Subject: Linker optimization, use extern template for LLView::getChild<> --- indra/llui/llbutton.cpp | 4 ++++ indra/llui/llcheckboxctrl.cpp | 4 ++++ indra/llui/lllineeditor.cpp | 4 ++++ indra/llui/llpanel.cpp | 4 ++++ indra/llui/lltextbox.cpp | 4 ++++ indra/llui/lltexteditor.cpp | 4 ++++ indra/llui/lluictrl.cpp | 4 ++++ indra/llui/llview.cpp | 3 +++ indra/llui/llview.h | 19 +++++++++++++++++++ 9 files changed, 50 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index b91c614424..ae25aec206 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -56,6 +56,10 @@ static LLDefaultChildRegistry::Register r("button"); +// Compiler optimization, generate extern template +template class LLButton* LLView::getChild( + const std::string& name, BOOL recurse) const; + // globals loaded from settings.xml S32 LLBUTTON_H_PAD = 0; S32 LLBUTTON_V_PAD = 0; diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 7f0f9751db..33630dbb5e 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -50,6 +50,10 @@ const U32 MAX_STRING_LENGTH = 10; static LLDefaultChildRegistry::Register r("check_box"); +// Compiler optimization, generate extern template +template class LLCheckBoxCtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; + LLCheckBoxCtrl::Params::Params() : text_enabled_color("text_enabled_color"), text_disabled_color("text_disabled_color"), diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 4ea30dbd4d..cade6e45e1 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -71,6 +71,10 @@ const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click static LLDefaultChildRegistry::Register r1("line_editor"); +// Compiler optimization, generate extern template +template class LLLineEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; + // // Member functions // diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 063822dd56..3a6c55ba0e 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -58,6 +58,10 @@ static LLDefaultChildRegistry::Register r1("panel", &LLPanel::fromXML); +// Compiler optimization, generate extern template +template class LLPanel* LLView::getChild( + const std::string& name, BOOL recurse) const; + LLPanel::LocalizedString::LocalizedString() : name("name"), value("value") diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 4c4123cf45..c0edccd0f3 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -40,6 +40,10 @@ static LLDefaultChildRegistry::Register r("text"); +// Compiler optimization, generate extern template +template class LLTextBox* LLView::getChild( + const std::string& name, BOOL recurse) const; + LLTextBox::LLTextBox(const LLTextBox::Params& p) : LLTextBase(p), mClickedCallback(NULL) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 3f4ef24f82..2df7d12704 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -73,6 +73,10 @@ // static LLDefaultChildRegistry::Register r("simple_text_editor"); +// Compiler optimization, generate extern template +template class LLTextEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; + // // Constants // diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index a30d5b4651..466f45942d 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -40,6 +40,10 @@ static LLDefaultChildRegistry::Register r("ui_ctrl"); +// Compiler optimization, generate extern template +template class LLUICtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; + LLUICtrl::Params::Params() : tab_stop("tab_stop", true), chrome("chrome", false), diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index dba24ee165..4fc52997a1 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -76,6 +76,9 @@ std::vector LLViewDrawContext::sDrawContextStack; BOOL LLView::sIsDrawing = FALSE; #endif +// Compiler optimization, generate extern template +template class LLView* LLView::getChild(const std::string& name, BOOL recurse) const; + static LLDefaultChildRegistry::Register r("view"); LLView::Params::Params() diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 2607120e17..5bf015362d 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -659,4 +659,23 @@ template T* LLView::getChild(const std::string& name, BOOL recurse) co return result; } +// Compiler optimization - don't generate these specializations inline, +// require explicit specialization. See llbutton.cpp for an example. +extern template class LLButton* LLView::getChild( + const std::string& name, BOOL recurse) const; +extern template class LLCheckBoxCtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; +extern template class LLLineEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; +extern template class LLPanel* LLView::getChild( + const std::string& name, BOOL recurse) const; +extern template class LLTextBox* LLView::getChild( + const std::string& name, BOOL recurse) const; +extern template class LLTextEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; +extern template class LLUICtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; +extern template class LLView* LLView::getChild( + const std::string& name, BOOL recurse) const; + #endif //LL_LLVIEW_H -- cgit v1.2.3 From f280c43d616d013747a9aab05141635868e00136 Mon Sep 17 00:00:00 2001 From: James Cook Date: Sat, 28 Nov 2009 16:51:02 -0800 Subject: Use extern template for common singletons to reduce code bloat/link time. --- indra/llui/lluictrlfactory.cpp | 3 +++ indra/llui/lluictrlfactory.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 1c1450d7e9..49182be328 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -75,6 +75,9 @@ public: static LLDefaultChildRegistry::Register r1("locate"); +// Build time optimization, generate this once in .cpp file +template class LLUICtrlFactory* LLSingleton::getInstance(); + //----------------------------------------------------------------------------- // LLUICtrlFactory() //----------------------------------------------------------------------------- diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 8a9c9e23c1..adb3f7202f 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -108,6 +108,9 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; +// Build time optimization, generate this once in .cpp file +extern template class LLUICtrlFactory* LLSingleton::getInstance(); + class LLUICtrlFactory : public LLSingleton { private: -- cgit v1.2.3 From 5531149ad1190ffe2adb14b7df7dbf6a1f2f5365 Mon Sep 17 00:00:00 2001 From: James Cook Date: Sat, 28 Nov 2009 21:25:53 -0800 Subject: Fix merge error --- indra/llui/lltexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 2df7d12704..628d566179 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2162,7 +2162,7 @@ void LLTextEditor::drawLineNumbers() return; } - S32 cursor_line = getLineNumFromDocIndex(mCursorPos); + S32 cursor_line = mLineInfoList[getLineNumFromDocIndex(mCursorPos)].mLineNum; if (mShowLineNumbers) { -- cgit v1.2.3 From b50ba67bd8ab329d598ce47e5d3ac09b59fffb63 Mon Sep 17 00:00:00 2001 From: James Cook Date: Sun, 29 Nov 2009 10:19:17 -0800 Subject: Revert extern template link optimization until I can build/test on PC --- indra/llui/llbutton.cpp | 4 ++-- indra/llui/llcheckboxctrl.cpp | 4 ++-- indra/llui/lllineeditor.cpp | 4 ++-- indra/llui/llpanel.cpp | 4 ++-- indra/llui/lltextbox.cpp | 4 ++-- indra/llui/lltexteditor.cpp | 4 ++-- indra/llui/lluictrl.cpp | 4 ++-- indra/llui/lluictrlfactory.h | 2 +- indra/llui/llview.cpp | 2 +- indra/llui/llview.h | 32 ++++++++++++++++---------------- 10 files changed, 32 insertions(+), 32 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index ae25aec206..617a97b6cf 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -57,8 +57,8 @@ static LLDefaultChildRegistry::Register r("button"); // Compiler optimization, generate extern template -template class LLButton* LLView::getChild( - const std::string& name, BOOL recurse) const; +//template class LLButton* LLView::getChild( +// const std::string& name, BOOL recurse) const; // globals loaded from settings.xml S32 LLBUTTON_H_PAD = 0; diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 33630dbb5e..3c5925f965 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -51,8 +51,8 @@ const U32 MAX_STRING_LENGTH = 10; static LLDefaultChildRegistry::Register r("check_box"); // Compiler optimization, generate extern template -template class LLCheckBoxCtrl* LLView::getChild( - const std::string& name, BOOL recurse) const; +//template class LLCheckBoxCtrl* LLView::getChild( +// const std::string& name, BOOL recurse) const; LLCheckBoxCtrl::Params::Params() : text_enabled_color("text_enabled_color"), diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index cade6e45e1..1551aab192 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -72,8 +72,8 @@ const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click static LLDefaultChildRegistry::Register r1("line_editor"); // Compiler optimization, generate extern template -template class LLLineEditor* LLView::getChild( - const std::string& name, BOOL recurse) const; +//template class LLLineEditor* LLView::getChild( +// const std::string& name, BOOL recurse) const; // // Member functions diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 3a6c55ba0e..dc5db03a44 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -59,8 +59,8 @@ static LLDefaultChildRegistry::Register r1("panel", &LLPanel::fromXML); // Compiler optimization, generate extern template -template class LLPanel* LLView::getChild( - const std::string& name, BOOL recurse) const; +//template class LLPanel* LLView::getChild( +// const std::string& name, BOOL recurse) const; LLPanel::LocalizedString::LocalizedString() : name("name"), diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index c0edccd0f3..4bd9a32b1d 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -41,8 +41,8 @@ static LLDefaultChildRegistry::Register r("text"); // Compiler optimization, generate extern template -template class LLTextBox* LLView::getChild( - const std::string& name, BOOL recurse) const; +//template class LLTextBox* LLView::getChild( +// const std::string& name, BOOL recurse) const; LLTextBox::LLTextBox(const LLTextBox::Params& p) : LLTextBase(p), diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 628d566179..6e07a890ad 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -74,8 +74,8 @@ static LLDefaultChildRegistry::Register r("simple_text_editor"); // Compiler optimization, generate extern template -template class LLTextEditor* LLView::getChild( - const std::string& name, BOOL recurse) const; +//template class LLTextEditor* LLView::getChild( +// const std::string& name, BOOL recurse) const; // // Constants diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 466f45942d..3cf592f351 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -41,8 +41,8 @@ static LLDefaultChildRegistry::Register r("ui_ctrl"); // Compiler optimization, generate extern template -template class LLUICtrl* LLView::getChild( - const std::string& name, BOOL recurse) const; +//template class LLUICtrl* LLView::getChild( +// const std::string& name, BOOL recurse) const; LLUICtrl::Params::Params() : tab_stop("tab_stop", true), diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index adb3f7202f..e021c04ad6 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -109,7 +109,7 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file -extern template class LLUICtrlFactory* LLSingleton::getInstance(); +//extern template class LLUICtrlFactory* LLSingleton::getInstance(); class LLUICtrlFactory : public LLSingleton { diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 4fc52997a1..ef23268a14 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -77,7 +77,7 @@ BOOL LLView::sIsDrawing = FALSE; #endif // Compiler optimization, generate extern template -template class LLView* LLView::getChild(const std::string& name, BOOL recurse) const; +//template class LLView* LLView::getChild(const std::string& name, BOOL recurse) const; static LLDefaultChildRegistry::Register r("view"); diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 5bf015362d..1b12e78509 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -661,21 +661,21 @@ template T* LLView::getChild(const std::string& name, BOOL recurse) co // Compiler optimization - don't generate these specializations inline, // require explicit specialization. See llbutton.cpp for an example. -extern template class LLButton* LLView::getChild( - const std::string& name, BOOL recurse) const; -extern template class LLCheckBoxCtrl* LLView::getChild( - const std::string& name, BOOL recurse) const; -extern template class LLLineEditor* LLView::getChild( - const std::string& name, BOOL recurse) const; -extern template class LLPanel* LLView::getChild( - const std::string& name, BOOL recurse) const; -extern template class LLTextBox* LLView::getChild( - const std::string& name, BOOL recurse) const; -extern template class LLTextEditor* LLView::getChild( - const std::string& name, BOOL recurse) const; -extern template class LLUICtrl* LLView::getChild( - const std::string& name, BOOL recurse) const; -extern template class LLView* LLView::getChild( - const std::string& name, BOOL recurse) const; +//extern template class LLButton* LLView::getChild( +// const std::string& name, BOOL recurse) const; +//extern template class LLCheckBoxCtrl* LLView::getChild( +// const std::string& name, BOOL recurse) const; +//extern template class LLLineEditor* LLView::getChild( +// const std::string& name, BOOL recurse) const; +//extern template class LLPanel* LLView::getChild( +// const std::string& name, BOOL recurse) const; +//extern template class LLTextBox* LLView::getChild( +// const std::string& name, BOOL recurse) const; +//extern template class LLTextEditor* LLView::getChild( +// const std::string& name, BOOL recurse) const; +//extern template class LLUICtrl* LLView::getChild( +// const std::string& name, BOOL recurse) const; +//extern template class LLView* LLView::getChild( +// const std::string& name, BOOL recurse) const; #endif //LL_LLVIEW_H -- cgit v1.2.3 From 7d3b3cc474822db144b623980d08b7addc2f77ff Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 30 Nov 2009 14:41:52 -0800 Subject: Linker optimization - use "extern template" for commonly regenerated templates Also replaced many duplicate calls to LLViewerCamera::getInstance() with local pointer. Reviewed with Ambroff --- indra/llui/llbutton.cpp | 5 +++-- indra/llui/llbutton.h | 5 +++++ indra/llui/llcheckboxctrl.cpp | 5 +++-- indra/llui/llcheckboxctrl.h | 5 +++++ indra/llui/lllineeditor.cpp | 5 +++-- indra/llui/lllineeditor.h | 5 +++++ indra/llui/llpanel.cpp | 5 +++-- indra/llui/llpanel.h | 6 ++++++ indra/llui/lltextbox.cpp | 7 +++++-- indra/llui/lltextbox.h | 6 ++++++ indra/llui/lltexteditor.cpp | 6 +++--- indra/llui/lltexteditor.h | 5 +++++ indra/llui/lluictrl.cpp | 8 +++++--- indra/llui/lluictrl.h | 6 ++++++ indra/llui/lluictrlfactory.cpp | 1 + indra/llui/lluictrlfactory.h | 4 +++- indra/llui/llview.cpp | 4 +++- indra/llui/llview.h | 20 ++++---------------- 18 files changed, 74 insertions(+), 34 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 617a97b6cf..7721137e29 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -32,6 +32,7 @@ #include "linden_common.h" +#define LLBUTTON_CPP #include "llbutton.h" // Linden library includes @@ -57,8 +58,8 @@ static LLDefaultChildRegistry::Register r("button"); // Compiler optimization, generate extern template -//template class LLButton* LLView::getChild( -// const std::string& name, BOOL recurse) const; +template class LLButton* LLView::getChild( + const std::string& name, BOOL recurse) const; // globals loaded from settings.xml S32 LLBUTTON_H_PAD = 0; diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 8c3b4bd859..4c7400220d 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -322,5 +322,10 @@ private: LLFrameTimer mFlashingTimer; }; +// Build time optimization, generate once in .cpp file +#ifndef LLBUTTON_CPP +extern template class LLButton* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_LLBUTTON_H diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 3c5925f965..cd10dfdb1c 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -33,6 +33,7 @@ // The mutants are coming! #include "linden_common.h" +#define LLCHECKBOXCTRL_CPP #include "llcheckboxctrl.h" #include "llgl.h" @@ -51,8 +52,8 @@ const U32 MAX_STRING_LENGTH = 10; static LLDefaultChildRegistry::Register r("check_box"); // Compiler optimization, generate extern template -//template class LLCheckBoxCtrl* LLView::getChild( -// const std::string& name, BOOL recurse) const; +template class LLCheckBoxCtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; LLCheckBoxCtrl::Params::Params() : text_enabled_color("text_enabled_color"), diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index b14e66b915..28d50f957d 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -126,5 +126,10 @@ protected: LLUIColor mTextDisabledColor; }; +// Build time optimization, generate once in .cpp file +#ifndef LLCHECKBOXCTRL_CPP +extern template class LLCheckBoxCtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_LLCHECKBOXCTRL_H diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 1551aab192..8a21155cc3 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -34,6 +34,7 @@ #include "linden_common.h" +#define LLLINEEDITOR_CPP #include "lllineeditor.h" #include "lltexteditor.h" @@ -72,8 +73,8 @@ const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click static LLDefaultChildRegistry::Register r1("line_editor"); // Compiler optimization, generate extern template -//template class LLLineEditor* LLView::getChild( -// const std::string& name, BOOL recurse) const; +template class LLLineEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; // // Member functions diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index b96220e020..49e9539b16 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -395,5 +395,10 @@ private: }; // end class LLLineEditor +// Build time optimization, generate once in .cpp file +#ifndef LLLINEEDITOR_CPP +extern template class LLLineEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_LINEEDITOR_ diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index dc5db03a44..750b190953 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -34,6 +34,7 @@ #include "linden_common.h" +#define LLPANEL_CPP #include "llpanel.h" #include "llalertdialog.h" @@ -59,8 +60,8 @@ static LLDefaultChildRegistry::Register r1("panel", &LLPanel::fromXML); // Compiler optimization, generate extern template -//template class LLPanel* LLView::getChild( -// const std::string& name, BOOL recurse) const; +template class LLPanel* LLView::getChild( + const std::string& name, BOOL recurse) const; LLPanel::LocalizedString::LocalizedString() : name("name"), diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 0a0fed82fb..a8bd5fd5e5 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -275,4 +275,10 @@ private: }; // end class LLPanel +// Build time optimization, generate once in .cpp file +#ifndef LLPANEL_CPP +extern template class LLPanel* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif + #endif diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 4bd9a32b1d..0bd0ab59fb 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -31,7 +31,10 @@ */ #include "linden_common.h" + +#define LLTEXTBOX_CPP #include "lltextbox.h" + #include "lluictrlfactory.h" #include "llfocusmgr.h" #include "llwindow.h" @@ -41,8 +44,8 @@ static LLDefaultChildRegistry::Register r("text"); // Compiler optimization, generate extern template -//template class LLTextBox* LLView::getChild( -// const std::string& name, BOOL recurse) const; +template class LLTextBox* LLView::getChild( + const std::string& name, BOOL recurse) const; LLTextBox::LLTextBox(const LLTextBox::Params& p) : LLTextBase(p), diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 01b4bfa5ed..3a045534d3 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -79,4 +79,10 @@ protected: callback_t mClickedCallback; }; +// Build time optimization, generate once in .cpp file +#ifndef LLTEXTBOX_CPP +extern template class LLTextBox* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif + #endif diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 6e07a890ad..e68affc36c 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1,6 +1,5 @@ /** * @file lltexteditor.cpp - * @brief LLTextEditor base class * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -34,6 +33,7 @@ #include "linden_common.h" +#define LLTEXTEDITOR_CPP #include "lltexteditor.h" #include "llfontfreetype.h" // for LLFontFreetype::FIRST_CHAR @@ -74,8 +74,8 @@ static LLDefaultChildRegistry::Register r("simple_text_editor"); // Compiler optimization, generate extern template -//template class LLTextEditor* LLView::getChild( -// const std::string& name, BOOL recurse) const; +template class LLTextEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; // // Constants diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index fb014b86bf..043dda8fa6 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -334,5 +334,10 @@ private: LLContextMenu* mContextMenu; }; // end class LLTextEditor +// Build time optimization, generate once in .cpp file +#ifndef LLTEXTEDITOR_CPP +extern template class LLTextEditor* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif #endif // LL_TEXTEDITOR_ diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 3cf592f351..1e0af1201f 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -31,9 +31,11 @@ * $/LicenseInfo$ */ -//#include "llviewerprecompiledheaders.h" #include "linden_common.h" + +#define LLUICTRL_CPP #include "lluictrl.h" + #include "llfocusmgr.h" #include "llpanel.h" #include "lluictrlfactory.h" @@ -41,8 +43,8 @@ static LLDefaultChildRegistry::Register r("ui_ctrl"); // Compiler optimization, generate extern template -//template class LLUICtrl* LLView::getChild( -// const std::string& name, BOOL recurse) const; +template class LLUICtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; LLUICtrl::Params::Params() : tab_stop("tab_stop", true), diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index aef1bcd519..ac916c9a43 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -328,4 +328,10 @@ private: class DefaultTabGroupFirstSorter; }; +// Build time optimization, generate once in .cpp file +#ifndef LLUICTRL_CPP +extern template class LLUICtrl* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif + #endif // LL_LLUICTRL_H diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 49182be328..3643bf44f7 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -32,6 +32,7 @@ #include "linden_common.h" +#define LLUICTRLFACTORY_CPP #include "lluictrlfactory.h" #include "llxmlnode.h" diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index e021c04ad6..55d7d745eb 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -109,7 +109,9 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file -//extern template class LLUICtrlFactory* LLSingleton::getInstance(); +#ifndef LLUICTRLFACTORY_CPP +extern template class LLUICtrlFactory* LLSingleton::getInstance(); +#endif class LLUICtrlFactory : public LLSingleton { diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index ef23268a14..e7e8b1b858 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -33,6 +33,7 @@ #include "linden_common.h" +#define LLVIEW_CPP #include "llview.h" #include @@ -77,7 +78,8 @@ BOOL LLView::sIsDrawing = FALSE; #endif // Compiler optimization, generate extern template -//template class LLView* LLView::getChild(const std::string& name, BOOL recurse) const; +template class LLView* LLView::getChild( + const std::string& name, BOOL recurse) const; static LLDefaultChildRegistry::Register r("view"); diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 1b12e78509..8ee05675c1 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -661,21 +661,9 @@ template T* LLView::getChild(const std::string& name, BOOL recurse) co // Compiler optimization - don't generate these specializations inline, // require explicit specialization. See llbutton.cpp for an example. -//extern template class LLButton* LLView::getChild( -// const std::string& name, BOOL recurse) const; -//extern template class LLCheckBoxCtrl* LLView::getChild( -// const std::string& name, BOOL recurse) const; -//extern template class LLLineEditor* LLView::getChild( -// const std::string& name, BOOL recurse) const; -//extern template class LLPanel* LLView::getChild( -// const std::string& name, BOOL recurse) const; -//extern template class LLTextBox* LLView::getChild( -// const std::string& name, BOOL recurse) const; -//extern template class LLTextEditor* LLView::getChild( -// const std::string& name, BOOL recurse) const; -//extern template class LLUICtrl* LLView::getChild( -// const std::string& name, BOOL recurse) const; -//extern template class LLView* LLView::getChild( -// const std::string& name, BOOL recurse) const; +#ifndef LLVIEW_CPP +extern template class LLView* LLView::getChild( + const std::string& name, BOOL recurse) const; +#endif #endif //LL_LLVIEW_H -- cgit v1.2.3 From 6feb42e0095cfb46c11897d759bdd03033045f54 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 30 Nov 2009 15:45:15 -0800 Subject: De-inlined some UI param block definitions. --- indra/llui/lluictrl.cpp | 22 ++++++++++++++++++++++ indra/llui/lluictrl.h | 22 +++------------------- indra/llui/llview.cpp | 5 +++++ indra/llui/llview.h | 5 +---- 4 files changed, 31 insertions(+), 23 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 1e0af1201f..706712ec5e 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -46,6 +46,28 @@ static LLDefaultChildRegistry::Register r("ui_ctrl"); template class LLUICtrl* LLView::getChild( const std::string& name, BOOL recurse) const; +LLUICtrl::CallbackParam::CallbackParam() +: name("name"), + function_name("function"), + parameter("parameter"), + control_name("control") // Shortcut to control -> "control_name" for backwards compatability +{ + addSynonym(parameter, "userdata"); +} + +LLUICtrl::EnableControls::EnableControls() +: enabled("enabled_control"), + disabled("disabled_control") +{} + +LLUICtrl::ControlVisibility::ControlVisibility() +: visible("visibility_control"), + invisible("invisibility_control") +{ + addSynonym(visible, "visiblity_control"); + addSynonym(invisible, "invisiblity_control"); +} + LLUICtrl::Params::Params() : tab_stop("tab_stop", true), chrome("chrome", false), diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index ac916c9a43..b20ff5d798 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -75,14 +75,7 @@ public: Optional control_name; - CallbackParam() - : name("name"), - function_name("function"), - parameter("parameter"), - control_name("control") // Shortcut to control -> "control_name" for backwards compatability - { - addSynonym(parameter, "userdata"); - } + CallbackParam(); }; struct CommitCallbackParam : public LLInitParam::Block @@ -105,23 +98,14 @@ public: Alternative enabled; Alternative disabled; - EnableControls() - : enabled("enabled_control"), - disabled("disabled_control") - {} + EnableControls(); }; struct ControlVisibility : public LLInitParam::Choice { Alternative visible; Alternative invisible; - ControlVisibility() - : visible("visibility_control"), - invisible("invisibility_control") - { - addSynonym(visible, "visiblity_control"); - addSynonym(invisible, "invisiblity_control"); - } + ControlVisibility(); }; struct Params : public LLInitParam::Block { diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index e7e8b1b858..23e4131e6d 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -83,6 +83,11 @@ template class LLView* LLView::getChild( static LLDefaultChildRegistry::Register r("view"); +LLView::Follows::Follows() +: string(""), + flags("flags", FOLLOWS_LEFT | FOLLOWS_TOP) +{} + LLView::Params::Params() : name("name", std::string("unnamed")), enabled("enabled", true), diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 8ee05675c1..d485244a05 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -111,10 +111,7 @@ public: Alternative string; Alternative flags; - Follows() - : string(""), - flags("flags", FOLLOWS_LEFT | FOLLOWS_TOP) - {} + Follows(); }; struct Params : public LLInitParam::Block -- cgit v1.2.3 From d5d1db8833473e9524340071f551d019a13fea21 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 1 Dec 2009 11:29:33 -0800 Subject: EXT-3015 Fixed right and center aligned text boxes Document rect left edge was being computed incorrectly. Made floater_test_textbox.xml have more examples of text. Reviewed with Kelly --- indra/llui/lltextbase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 64164df17f..db16670f79 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2096,7 +2096,8 @@ void LLTextBase::updateRects() // update document container dimensions according to text contents LLRect doc_rect = mContentsRect; // use old mTextRect constraint document to width of viewable region - doc_rect.mRight = doc_rect.mLeft + mTextRect.getWidth(); + doc_rect.mLeft = 0; + doc_rect.mRight = mTextRect.getWidth(); mDocumentView->setShape(doc_rect); -- cgit v1.2.3 From 0ae508c99b6a6ad6d1c37b9686430103a2ed9b8d Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 1 Dec 2009 11:44:49 -0800 Subject: Revert partial fix for EXT-2572 (chat history text clipping) that causes EXT-1597 (script editor scrolls upward while typing) Backed out changeset: e38642e0c21c --- indra/llui/llscrollcontainer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index d91b58b4ea..5e17372fe9 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -111,8 +111,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) LLView::addChild( mBorder ); mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - if ( mBorder->getVisible() ) - mInnerRect.stretch( -mBorder->getBorderWidth() ); + mInnerRect.stretch( -mBorder->getBorderWidth() ); LLRect vertical_scroll_rect = mInnerRect; vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - scrollbar_size; @@ -190,8 +189,7 @@ void LLScrollContainer::reshape(S32 width, S32 height, LLUICtrl::reshape( width, height, called_from_parent ); mInnerRect = getLocalRect(); - if ( mBorder->getVisible() ) - mInnerRect.stretch( -mBorder->getBorderWidth() ); + mInnerRect.stretch( -mBorder->getBorderWidth() ); if (mScrolledView) { -- cgit v1.2.3