diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-06-13 14:59:28 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-06-13 14:59:28 -0700 |
commit | 5e60392c273f0c9c5efa765a05414c618381780a (patch) | |
tree | d1eedbb1dfa86e66532a6d8746b7a81e5a444d3a /indra/newview/lltexturectrl.cpp | |
parent | 0f3c3563b0861e8ea82b201aab8343d99f993bbc (diff) | |
parent | 100ebbab2437de7f5d124a0d7b8279a7a7b57656 (diff) |
Merge branch 'develop' of github.com:secondlife/viewer into roxie/webrtc-voice
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 237 |
1 files changed, 117 insertions, 120 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4744edd5a3..284fff4d8c 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -148,12 +148,12 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( LLUUID image_asset_id, LLUUID default_image_asset_id, LLUUID blank_image_asset_id, - BOOL tentative, - BOOL allow_no_texture, + bool tentative, + bool allow_no_texture, const std::string& label, PermissionMask immediate_filter_perm_mask, PermissionMask dnd_filter_perm_mask, - BOOL can_apply_immediately, + bool can_apply_immediately, LLUIImagePtr fallback_image, EPickInventoryType pick_type) : LLFloater(LLSD()), @@ -168,12 +168,12 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mLabel(label), mTentativeLabel(NULL), mResolutionLabel(NULL), - mActive( TRUE ), + mActive( true ), mFilterEdit(NULL), mImmediateFilterPermMask(immediate_filter_perm_mask), mDnDFilterPermMask(dnd_filter_perm_mask), mContextConeOpacity(0.f), - mSelectedItemPinned( FALSE ), + mSelectedItemPinned( false ), mCanApply(true), mCanPreview(true), mLimitsSet(false), @@ -184,12 +184,12 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mOnFloaterCloseCallback(NULL), mSetImageAssetIDCallback(NULL), mOnUpdateImageStatsCallback(NULL), - mBakeTextureEnabled(FALSE), + mBakeTextureEnabled(false), mInventoryPickType(pick_type) { mCanApplyImmediately = can_apply_immediately; buildFromFile("floater_texture_ctrl.xml"); - setCanMinimize(FALSE); + setCanMinimize(false); } LLFloaterTexturePicker::~LLFloaterTexturePicker() @@ -200,7 +200,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti { if( ((mImageAssetID != image_id) || mTentative) && mActive) { - mNoCopyTextureSelected = FALSE; + mNoCopyTextureSelected = false; mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? mImageAssetID = image_id; @@ -242,7 +242,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti } if (item_id.isNull()) { - item_id = findItemID(mImageAssetID, FALSE); + item_id = findItemID(mImageAssetID, false); } if (item_id.isNull()) { @@ -254,8 +254,8 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture - getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); - mNoCopyTextureSelected = TRUE; + getChild<LLUICtrl>("apply_immediate_check")->setValue(false); + mNoCopyTextureSelected = true; } } @@ -278,7 +278,7 @@ void LLFloaterTexturePicker::setImageIDFromItem(const LLInventoryItem* itemp, bo setImageID(asset_id, set_selection); } -void LLFloaterTexturePicker::setActive( BOOL active ) +void LLFloaterTexturePicker::setActive( bool active ) { if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean()) { @@ -287,7 +287,7 @@ void LLFloaterTexturePicker::setActive( BOOL active ) mActive = active; } -void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) +void LLFloaterTexturePicker::setCanApplyImmediately(bool b) { mCanApplyImmediately = b; @@ -415,14 +415,14 @@ bool LLFloaterTexturePicker::updateImageStats() } // virtual -BOOL LLFloaterTexturePicker::handleDragAndDrop( +bool LLFloaterTexturePicker::handleDragAndDrop( S32 x, S32 y, MASK mask, - BOOL drop, + bool drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { - BOOL handled = FALSE; + bool handled = false; bool is_mesh = cargo_type == DAD_MESH; bool is_texture = cargo_type == DAD_TEXTURE; @@ -446,9 +446,9 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( { LLInventoryItem *item = (LLInventoryItem *)cargo_data; - BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); - BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); - BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, + bool copy = item->getPermissions().allowCopyBy(gAgent.getID()); + bool mod = item->getPermissions().allowModifyBy(gAgent.getID()); + bool xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); PermissionMask item_perm_mask = 0; @@ -477,13 +477,13 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( *accept = ACCEPT_NO; } - handled = TRUE; + handled = true; LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << LL_ENDL; return handled; } -BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) +bool LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) { LLFolderView* root_folder = mInventoryPanel->getRootFolder(); @@ -498,23 +498,23 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) LLFolderViewItem* itemp = mInventoryPanel->getItemByID(gInventory.getRootFolderID()); if (itemp) { - root_folder->setSelection(itemp, FALSE, FALSE); + root_folder->setSelection(itemp, false, false); } } root_folder->scrollToShowSelection(); // move focus to inventory proper - mInventoryPanel->setFocus(TRUE); + mInventoryPanel->setFocus(true); // treat this as a user selection of the first filtered result commitIfImmediateSet(); - return TRUE; + return true; } if (mInventoryPanel->hasFocus() && key == KEY_UP) { - mFilterEdit->focusFirstItem(TRUE); + mFilterEdit->focusFirstItem(true); } } @@ -543,7 +543,7 @@ void LLFloaterTexturePicker::onClose(bool app_quitting) } // virtual -BOOL LLFloaterTexturePicker::postBuild() +bool LLFloaterTexturePicker::postBuild() { LLFloater::postBuild(); @@ -596,7 +596,7 @@ BOOL LLFloaterTexturePicker::postBuild() // Disable auto selecting first filtered item because it takes away // selection from the item set by LLTextureCtrl owning this floater. - mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE); + mInventoryPanel->getRootFolder()->setAutoSelectOverride(true); // Commented out to scroll to currently selected texture. See EXT-5403. // // store this filter as the default one @@ -610,7 +610,7 @@ BOOL LLFloaterTexturePicker::postBuild() if(!mImageAssetID.isNull() || mInventoryPickType == PICK_MATERIAL) { - mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); + mInventoryPanel->setSelection(findItemID(mImageAssetID, false), TAKE_FOCUS_NO); } } @@ -622,7 +622,7 @@ BOOL LLFloaterTexturePicker::postBuild() mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this); refreshLocalList(); - mNoCopyTextureSelected = FALSE; + mNoCopyTextureSelected = false; getChild<LLUICtrl>("apply_immediate_check")->setValue(mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview")); childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); @@ -632,14 +632,14 @@ BOOL LLFloaterTexturePicker::postBuild() childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this); childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this); - mSavedFolderState.setApply(FALSE); + mSavedFolderState.setApply(false); LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); getChild<LLComboBox>("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this); - setBakeTextureEnabled(TRUE); - return TRUE; + setBakeTextureEnabled(mInventoryPickType != PICK_MATERIAL); + return true; } // virtual @@ -658,7 +658,7 @@ void LLFloaterTexturePicker::draw() mPipetteBtn->setEnabled(mActive); mPipetteBtn->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); - //BOOL allow_copy = FALSE; + //bool allow_copy = false; if( mOwner ) { mTexturep = NULL; @@ -716,7 +716,7 @@ void LLFloaterTexturePicker::draw() if (mTentativeLabel) { - mTentativeLabel->setVisible( FALSE ); + mTentativeLabel->setVisible( false ); } mDefaultBtn->setEnabled(mImageAssetID != mDefaultImageAssetID || mTentative); @@ -732,7 +732,7 @@ void LLFloaterTexturePicker::draw() // Border LLRect border = getChildView("preview_widget")->getRect(); - gl_rect_2d( border, LLColor4::black, FALSE ); + gl_rect_2d( border, LLColor4::black, false ); // Interior @@ -767,7 +767,7 @@ void LLFloaterTexturePicker::draw() } else { - gl_rect_2d( interior, LLColor4::grey % alpha, TRUE ); + gl_rect_2d( interior, LLColor4::grey % alpha, true ); // Draw X gl_draw_x(interior, LLColor4::black ); @@ -776,7 +776,7 @@ void LLFloaterTexturePicker::draw() // Draw Tentative Label over the image if( mTentative && !mViewModel->isDirty() ) { - mTentativeLabel->setVisible( TRUE ); + mTentativeLabel->setVisible( true ); drawChild(mTentativeLabel); } @@ -792,19 +792,19 @@ void LLFloaterTexturePicker::draw() // After inventory panel filter is applied we have to update // constraint rect for the selected item because of folder view - // AutoSelectOverride set to TRUE. We force PinningSelectedItem - // flag to FALSE state and setting filter "dirty" to update + // AutoSelectOverride set to true. We force PinningSelectedItem + // flag to false state and setting filter "dirty" to update // scroll container to show selected item (see LLFolderView::doIdle()). if (!is_filter_active && !mSelectedItemPinned) { folder_view->setPinningSelectedItem(mSelectedItemPinned); folder_view->getViewModelItem()->dirtyFilter(); - mSelectedItemPinned = TRUE; + mSelectedItemPinned = true; } } } -const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library) +const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, bool copyable_only, bool ignore_library) { if (asset_id.isNull()) { @@ -1038,7 +1038,7 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata) void LLFloaterTexturePicker::onBtnPipette() { - BOOL pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean(); + bool pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean(); pipette_active = !pipette_active; if (pipette_active) { @@ -1050,13 +1050,13 @@ void LLFloaterTexturePicker::onBtnPipette() } } -void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) +void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, bool user_action) { if (items.size()) { LLFolderViewItem* first_item = items.front(); LLInventoryItem* itemp = gInventory.getItem(static_cast<LLFolderViewModelItemInventory*>(first_item->getViewModelItem())->getUUID()); - mNoCopyTextureSelected = FALSE; + mNoCopyTextureSelected = false; if (itemp) { if (!mTextureSelectedCallback.empty()) @@ -1065,7 +1065,7 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem } if (!itemp->getPermissions().allowCopyBy(gAgent.getID())) { - mNoCopyTextureSelected = TRUE; + mNoCopyTextureSelected = true; } setImageIDFromItem(itemp, false); mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? @@ -1129,7 +1129,7 @@ void LLFloaterTexturePicker::onBtnRemove(void* userdata) LLScrollListItem* list_item = *iter; if (list_item) { - LLSD data = self->mLocalScrollCtrl->getFirstSelected()->getValue(); + LLSD data = list_item->getValue(); LLUUID tracking_id = data["id"]; S32 asset_type = data["type"].asInteger(); @@ -1347,7 +1347,7 @@ void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) return; } - mSavedFolderState.setApply(TRUE); + mSavedFolderState.setApply(true); mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); // add folder with current item to list of previously opened folders LLOpenFoldersWithSelection opener; @@ -1360,7 +1360,7 @@ void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) // first letter in search term, save existing folder open state if (!mInventoryPanel->getFilter().isNotDefault()) { - mSavedFolderState.setApply(FALSE); + mSavedFolderState.setApply(false); mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); } } @@ -1372,19 +1372,19 @@ void LLFloaterTexturePicker::changeMode() { int index = mModeSelector->getValue().asInteger(); - mDefaultBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - mBlankBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - mNoneBtn->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - mFilterEdit->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); - mInventoryPanel->setVisible(index == PICKER_INVENTORY ? TRUE : FALSE); + mDefaultBtn->setVisible(index == PICKER_INVENTORY); + mBlankBtn->setVisible(index == PICKER_INVENTORY); + mNoneBtn->setVisible(index == PICKER_INVENTORY); + mFilterEdit->setVisible(index == PICKER_INVENTORY); + mInventoryPanel->setVisible(index == PICKER_INVENTORY); - getChild<LLButton>("l_add_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); - getChild<LLButton>("l_rem_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); - getChild<LLButton>("l_upl_btn")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); - getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == PICKER_LOCAL ? TRUE : FALSE); + getChild<LLButton>("l_add_btn")->setVisible(index == PICKER_LOCAL); + getChild<LLButton>("l_rem_btn")->setVisible(index == PICKER_LOCAL); + getChild<LLButton>("l_upl_btn")->setVisible(index == PICKER_LOCAL); + getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == PICKER_LOCAL); - getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == PICKER_BAKE ? TRUE : FALSE); - getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(FALSE);// index == 2 ? TRUE : FALSE); + getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == PICKER_BAKE); + getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(false);// index == 2); bool pipette_visible = (index == PICKER_INVENTORY) && (mInventoryPickType != PICK_MATERIAL); @@ -1442,7 +1442,7 @@ void LLFloaterTexturePicker::changeMode() val = 10; } - getChild<LLComboBox>("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE); + getChild<LLComboBox>("l_bake_use_texture_combo_box")->setSelectedByValue(val, true); } } @@ -1488,14 +1488,14 @@ void LLFloaterTexturePicker::refreshInventoryFilter() mInventoryPanel->setFilterTypes(filter_types); } -void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) +void LLFloaterTexturePicker::setLocalTextureEnabled(bool enabled) { mModeSelector->setEnabledByValue(1, enabled); } -void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) +void LLFloaterTexturePicker::setBakeTextureEnabled(bool enabled) { - BOOL changed = (enabled != mBakeTextureEnabled); + bool changed = (enabled != mBakeTextureEnabled); mBakeTextureEnabled = enabled; mModeSelector->setEnabledByValue(2, enabled); @@ -1549,7 +1549,7 @@ void LLFloaterTexturePicker::setInventoryPickType(EPickInventoryType type) // refresh selection if (!mImageAssetID.isNull() || mInventoryPickType == PICK_MATERIAL) { - mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); + mInventoryPanel->setSelection(findItemID(mImageAssetID, false), TAKE_FOCUS_NO); } } @@ -1603,10 +1603,10 @@ void LLFloaterTexturePicker::onPickerCallback(const std::vector<std::string>& fi void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { - LLUUID inventory_item_id = findItemID(te.getID(), TRUE); + LLUUID inventory_item_id = findItemID(te.getID(), true); if (inventory_item_id.notNull()) { - LLToolPipette::getInstance()->setResult(TRUE, ""); + LLToolPipette::getInstance()->setResult(true, ""); if (mInventoryPickType == PICK_MATERIAL) { // tes have no data about material ids @@ -1619,20 +1619,20 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) setImageID(te.getID()); } - mNoCopyTextureSelected = FALSE; + mNoCopyTextureSelected = false; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture - mNoCopyTextureSelected = TRUE; + mNoCopyTextureSelected = true; } commitIfImmediateSet(); } else { - LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); + LLToolPipette::getInstance()->setResult(false, LLTrans::getString("InventoryNoTexture")); } } @@ -1650,12 +1650,12 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mOnSelectCallback(NULL), mBorderColor( p.border_color() ), mAllowNoTexture( p.allow_no_texture ), - mAllowLocalTexture( TRUE ), + mAllowLocalTexture( true ), mImmediateFilterPermMask( PERM_NONE ), - mCanApplyImmediately( FALSE ), - mNeedsRawImageData( FALSE ), - mValid( TRUE ), - mShowLoadingPlaceholder( TRUE ), + mCanApplyImmediately( false ), + mNeedsRawImageData( false ), + mValid( true ), + mShowLoadingPlaceholder( true ), mOpenTexPreview(false), mBakeTextureEnabled(true), mInventoryPickType(p.pick_type), @@ -1716,7 +1716,7 @@ LLTextureCtrl::~LLTextureCtrl() closeDependentFloater(); } -void LLTextureCtrl::setShowLoadingPlaceholder(BOOL showLoadingPlaceholder) +void LLTextureCtrl::setShowLoadingPlaceholder(bool showLoadingPlaceholder) { mShowLoadingPlaceholder = showLoadingPlaceholder; } @@ -1726,7 +1726,7 @@ void LLTextureCtrl::setCaption(const std::string& caption) mCaption->setText( caption ); } -void LLTextureCtrl::setCanApplyImmediately(BOOL b) +void LLTextureCtrl::setCanApplyImmediately(bool b) { mCanApplyImmediately = b; LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); @@ -1762,7 +1762,7 @@ void LLTextureCtrl::setFilterPermissionMasks(PermissionMask mask) setDnDFilterPermMask(mask); } -void LLTextureCtrl::onVisibilityChange(BOOL new_visibility) +void LLTextureCtrl::onVisibilityChange(bool new_visibility) { if (!new_visibility) { @@ -1775,7 +1775,7 @@ void LLTextureCtrl::onVisibilityChange(BOOL new_visibility) } } -void LLTextureCtrl::setVisible( BOOL visible ) +void LLTextureCtrl::setVisible(bool visible ) { if( !visible ) { @@ -1784,7 +1784,7 @@ void LLTextureCtrl::setVisible( BOOL visible ) LLUICtrl::setVisible( visible ); } -void LLTextureCtrl::setEnabled( BOOL enabled ) +void LLTextureCtrl::setEnabled( bool enabled ) { LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); if( floaterp ) @@ -1810,7 +1810,7 @@ void LLTextureCtrl::setEnabled( BOOL enabled ) LLView::setEnabled( enabled ); } -void LLTextureCtrl::setValid(BOOL valid ) +void LLTextureCtrl::setValid(bool valid ) { mValid = valid; if (!valid) @@ -1818,7 +1818,7 @@ void LLTextureCtrl::setValid(BOOL valid ) LLFloaterTexturePicker* pickerp = (LLFloaterTexturePicker*)mFloaterHandle.get(); if (pickerp) { - pickerp->setActive(FALSE); + pickerp->setActive(false); } } } @@ -1836,7 +1836,7 @@ void LLTextureCtrl::setLabel(const std::string& label) mCaption->setText(label); } -void LLTextureCtrl::showPicker(BOOL take_focus) +void LLTextureCtrl::showPicker(bool take_focus) { // show hourglass cursor when loading inventory window // because inventory construction is slooow @@ -1882,7 +1882,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus) { texture_floaterp->setSetImageAssetIDCallback(boost::bind(&LLTextureCtrl::setImageAssetID, this, _1)); - texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled); + texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled && mInventoryPickType != PICK_MATERIAL); } LLFloater* root_floater = gFloaterView->getParentFloater(this); @@ -1899,7 +1899,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus) if (take_focus) { - floaterp->setFocus(TRUE); + floaterp->setFocus(true); } } @@ -1910,7 +1910,7 @@ void LLTextureCtrl::closeDependentFloater() if( floaterp && floaterp->isInVisibleChain()) { floaterp->setOwner(NULL); - floaterp->setVisible(FALSE); + floaterp->setVisible(false); floaterp->closeFloater(); } } @@ -1929,22 +1929,22 @@ public: } }; -BOOL LLTextureCtrl::handleHover(S32 x, S32 y, MASK mask) +bool LLTextureCtrl::handleHover(S32 x, S32 y, MASK mask) { getWindow()->setCursor(mBorder->parentPointInView(x,y) ? UI_CURSOR_HAND : UI_CURSOR_ARROW); - return TRUE; + return true; } -BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) +bool LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = LLUICtrl::handleMouseDown( x, y , mask ); + bool handled = LLUICtrl::handleMouseDown( x, y , mask ); if (!handled && mBorder->parentPointInView(x, y)) { if (!mOpenTexPreview) { - showPicker(FALSE); + showPicker(false); if (mInventoryPickType == PICK_MATERIAL) { //grab materials first... @@ -1960,7 +1960,7 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) { LLInventoryModelBackgroundFetch::instance().start(); } - handled = TRUE; + handled = true; } else { @@ -2015,7 +2015,7 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLPickerSource source, co if(floaterp->isDirty() || asset_id.notNull()) // mModelView->setDirty does not work. { - setTentative( FALSE ); + setTentative( false ); switch(source) { @@ -2036,7 +2036,7 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLPickerSource source, co break; case PICKER_UNKNOWN: default: - mImageItemID = floaterp->findItemID(asset_id, FALSE); + mImageItemID = floaterp->findItemID(asset_id, false); mImageAssetID = asset_id; mLocalTrackingID.setNull(); break; @@ -2112,7 +2112,7 @@ void LLTextureCtrl::setBakeTextureEnabled(bool enabled) LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); if (floaterp) { - floaterp->setBakeTextureEnabled(enabled); + floaterp->setBakeTextureEnabled(enabled && mInventoryPickType != PICK_MATERIAL); } } @@ -2126,12 +2126,12 @@ void LLTextureCtrl::setInventoryPickType(EPickInventoryType type) } } -BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, - BOOL drop, EDragAndDropType cargo_type, void *cargo_data, +bool LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, + bool drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { - BOOL handled = FALSE; + bool handled = false; // this downcast may be invalid - but if the second test below // returns true, then the cast was valid, and we can perform @@ -2167,7 +2167,7 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, // This removes the 'Multiple' overlay, since // there is now only one texture selected. - setTentative( FALSE ); + setTentative( false ); onCommit(); } } @@ -2179,7 +2179,7 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, *accept = ACCEPT_NO; } - handled = TRUE; + handled = true; LL_DEBUGS("UserInput") << "dragAndDrop handled by LLTextureCtrl " << getName() << LL_ENDL; return handled; @@ -2243,11 +2243,8 @@ void LLTextureCtrl::draw() } else { - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); - mTexturep->forceToSaveRawImage(0); - - preview = mTexturep; + preview = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + preview->setBoostLevel(LLGLTexture::BOOST_PREVIEW); } } } @@ -2260,7 +2257,7 @@ void LLTextureCtrl::draw() // Border LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); - gl_rect_2d( border, mBorderColor.get(), FALSE ); + gl_rect_2d( border, mBorderColor.get(), false ); // Interior LLRect interior = border; @@ -2284,7 +2281,7 @@ void LLTextureCtrl::draw() } else { - gl_rect_2d( interior, LLColor4::grey % alpha, TRUE ); + gl_rect_2d( interior, LLColor4::grey % alpha, true ); // Draw X gl_draw_x( interior, LLColor4::black ); @@ -2296,8 +2293,8 @@ void LLTextureCtrl::draw() // Using the discard level, do not show the string if the texture is almost but not // fully loaded. if (mTexturep.notNull() && - (!mTexturep->isFullyLoaded()) && - (mShowLoadingPlaceholder == TRUE)) + !mTexturep->isFullyLoaded() && + mShowLoadingPlaceholder) { U32 v_offset = 25; LLFontGL* font = LLFontGL::getFontSansSerif(); @@ -2343,11 +2340,11 @@ void LLTextureCtrl::draw() LLUICtrl::draw(); } -BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item, EDragAndDropType cargo_type, std::string& tooltip_msg) +bool LLTextureCtrl::allowDrop(LLInventoryItem* item, EDragAndDropType cargo_type, std::string& tooltip_msg) { - BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); - BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); - BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, + bool copy = item->getPermissions().allowCopyBy(gAgent.getID()); + bool mod = item->getPermissions().allowModifyBy(gAgent.getID()); + bool xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); PermissionMask item_perm_mask = 0; @@ -2364,7 +2361,7 @@ BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item, EDragAndDropType cargo_type } else { - return TRUE; + return true; } } else @@ -2375,16 +2372,16 @@ BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item, EDragAndDropType cargo_type { tooltip_msg.assign(LLTrans::getString("TooltipTextureRestrictedDrop")); } - return FALSE; + return false; } } -BOOL LLTextureCtrl::doDrop(LLInventoryItem* item) +bool LLTextureCtrl::doDrop(LLInventoryItem* item) { // call the callback if it exists. if(mDropCallback) { - // if it returns TRUE, we return TRUE, and therefore the + // if it returns true, we return true, and therefore the // commit is called above. return mDropCallback(this, item); } @@ -2400,15 +2397,15 @@ BOOL LLTextureCtrl::doDrop(LLInventoryItem* item) setImageAssetID(asset_id); mImageItemID = item->getUUID(); - return TRUE; + return true; } -BOOL LLTextureCtrl::handleUnicodeCharHere(llwchar uni_char) +bool LLTextureCtrl::handleUnicodeCharHere(llwchar uni_char) { if( ' ' == uni_char ) { - showPicker(TRUE); - return TRUE; + showPicker(true); + return true; } return LLUICtrl::handleUnicodeCharHere(uni_char); } |