diff options
Diffstat (limited to 'indra')
44 files changed, 950 insertions, 76 deletions
diff --git a/indra/cmake/ExamplePlugin.cmake b/indra/cmake/ExamplePlugin.cmake new file mode 100644 index 0000000000..599787ad21 --- /dev/null +++ b/indra/cmake/ExamplePlugin.cmake @@ -0,0 +1,16 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) + +if (STANDALONE) + set(EXAMPLEPLUGIN OFF CACHE BOOL + "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") +else (STANDALONE) + set(EXAMPLEPLUGIN ON CACHE BOOL + "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") +endif (STANDALONE) + +if (WINDOWS) +elseif (DARWIN) +elseif (LINUX) +endif (WINDOWS) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c8e26ecaea..6dcc1957a9 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -189,6 +189,7 @@ LLFloater::Params::Params() can_close("can_close", true), can_drag_on_left("can_drag_on_left", false), can_tear_off("can_tear_off", true), + save_dock_state("save_dock_state", false), save_rect("save_rect", false), save_visibility("save_visibility", false), can_dock("can_dock", false), @@ -508,6 +509,7 @@ LLFloater::~LLFloater() storeRectControl(); setVisible(false); // We're not visible if we're destroyed storeVisibilityControl(); + storeDockStateControl(); } void LLFloater::storeRectControl() @@ -526,6 +528,15 @@ void LLFloater::storeVisibilityControl() } } +void LLFloater::storeDockStateControl() +{ + if( !sQuitting && mDocStateControl.size() > 1 ) + { + LLUI::sSettingGroups["floater"]->setBOOL( mDocStateControl, isDocked() ); + } +} + + void LLFloater::setVisible( BOOL visible ) { LLPanel::setVisible(visible); // calls handleVisibilityChange() @@ -784,6 +795,16 @@ void LLFloater::applyRectControl() } } +void LLFloater::applyDockState() +{ + if (mDocStateControl.size() > 1) + { + bool dockState = LLUI::sSettingGroups["floater"]->getBOOL(mDocStateControl); + setDocked(dockState); + } + +} + void LLFloater::applyTitle() { if (!mDragHandle) @@ -1403,7 +1424,10 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock) mButtonsEnabled[BUTTON_DOCK] = !mDocked; mButtonsEnabled[BUTTON_UNDOCK] = mDocked; updateButtons(); + + storeDockStateControl(); } + } // static @@ -2520,6 +2544,11 @@ void LLFloater::setInstanceName(const std::string& name) { mVisibilityControl = LLFloaterReg::declareVisibilityControl(mInstanceName); } + if(!mDocStateControl.empty()) + { + mDocStateControl = LLFloaterReg::declareDockStateControl(mInstanceName); + } + } } @@ -2592,6 +2621,11 @@ void LLFloater::initFromParams(const LLFloater::Params& p) { mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set } + + if(p.save_dock_state) + { + mDocStateControl = "t"; // flag to build mDocStateControl name once mInstanceName is set + } // open callback if (p.open_callback.isProvided()) @@ -2670,6 +2704,8 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o moveResizeHandlesToFront(); + applyDockState(); + return true; // *TODO: Error checking } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index afdc4ccf00..ef0d06a58e 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -124,6 +124,7 @@ public: can_tear_off, save_rect, save_visibility, + save_dock_state, can_dock; Optional<S32> header_height, legacy_header_height; // HACK see initFromXML() @@ -280,8 +281,10 @@ protected: void setRectControl(const std::string& rectname) { mRectControl = rectname; }; void applyRectControl(); + void applyDockState(); void storeRectControl(); void storeVisibilityControl(); + void storeDockStateControl(); void setKey(const LLSD& key); void setInstanceName(const std::string& name); @@ -322,6 +325,7 @@ public: protected: std::string mRectControl; std::string mVisibilityControl; + std::string mDocStateControl; LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg LLDragHandle* mDragHandle; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 3c5a8a6921..d60a879410 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -364,6 +364,26 @@ std::string LLFloaterReg::declareVisibilityControl(const std::string& name) } //static +std::string LLFloaterReg::declareDockStateControl(const std::string& name) +{ + std::string controlname = getDockStateControlName(name); + LLUI::sSettingGroups["floater"]->declareBOOL(controlname, FALSE, + llformat("Window Docking state for %s", name.c_str()), + TRUE); + return controlname; + +} + +//static +std::string LLFloaterReg::getDockStateControlName(const std::string& name) +{ + std::string res = std::string("floater_dock_") + name; + LLStringUtil::replaceChar( res, ' ', '_' ); + return res; +} + + +//static void LLFloaterReg::registerControlVariables() { // Iterate through alll registered instance names and register rect and visibility control variables diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 451bd1dbe3..634a235926 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -121,6 +121,10 @@ public: static std::string declareRectControl(const std::string& name); static std::string getVisibilityControlName(const std::string& name); static std::string declareVisibilityControl(const std::string& name); + + static std::string declareDockStateControl(const std::string& name); + static std::string getDockStateControlName(const std::string& name); + static void registerControlVariables(); // Callback wrappers diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 6e058e4c62..91e7e46195 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2894,8 +2894,8 @@ void hide_top_view( LLView* view ) } -// x and y are the desired location for the popup, NOT necessarily the -// mouse location +// x and y are the desired location for the popup, in the spawning_view's +// coordinate frame, NOT necessarily the mouse location // static void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) { diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 48887ec352..09d9e407c7 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -505,7 +505,7 @@ public: void buildDrawLabels(); void createJumpKeys(); - // Show popup at a specific location. + // Show popup at a specific location, in the spawn_view's coordinate frame static void showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y); // Whether to drop shadow menu bar diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index d35afd8cbd..cc03d9cb72 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -9,3 +9,5 @@ add_subdirectory(gstreamer010) if (WINDOWS OR DARWIN) add_subdirectory(quicktime) endif (WINDOWS OR DARWIN) + +add_subdirectory(example) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt new file mode 100644 index 0000000000..4d82f2747c --- /dev/null +++ b/indra/media_plugins/example/CMakeLists.txt @@ -0,0 +1,74 @@ +# -*- cmake -*- + +project(media_plugin_example) + +include(00-Common) +include(LLCommon) +include(LLImage) +include(LLPlugin) +include(LLMath) +include(LLRender) +include(LLWindow) +include(Linking) +include(PluginAPI) +include(MediaPluginBase) +include(FindOpenGL) + +include(ExamplePlugin) + +include_directories( + ${LLPLUGIN_INCLUDE_DIRS} + ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS} + ${LLCOMMON_INCLUDE_DIRS} + ${LLMATH_INCLUDE_DIRS} + ${LLIMAGE_INCLUDE_DIRS} + ${LLRENDER_INCLUDE_DIRS} + ${LLWINDOW_INCLUDE_DIRS} +) + + +### media_plugin_example + +set(media_plugin_example_SOURCE_FILES + media_plugin_example.cpp + ) + +add_library(media_plugin_example + SHARED + ${media_plugin_example_SOURCE_FILES} +) + +target_link_libraries(media_plugin_example + ${LLPLUGIN_LIBRARIES} + ${MEDIA_PLUGIN_BASE_LIBRARIES} + ${LLCOMMON_LIBRARIES} + ${EXAMPLE_PLUGIN_LIBRARIES} + ${PLUGIN_API_WINDOWS_LIBRARIES} +) + +add_dependencies(media_plugin_example + ${LLPLUGIN_LIBRARIES} + ${MEDIA_PLUGIN_BASE_LIBRARIES} + ${LLCOMMON_LIBRARIES} +) + +if (WINDOWS) + set_target_properties( + media_plugin_example + PROPERTIES + LINK_FLAGS "/MANIFEST:NO" + ) +endif (WINDOWS) + +if (DARWIN) + # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name + set_target_properties( + media_plugin_example + PROPERTIES + PREFIX "" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_NAME_DIR "@executable_path" + LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" + ) + +endif (DARWIN)
\ No newline at end of file diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp new file mode 100644 index 0000000000..e873a0d034 --- /dev/null +++ b/indra/media_plugins/example/media_plugin_example.cpp @@ -0,0 +1,488 @@ +/** + * @file media_plugin_example.cpp + * @brief Example plugin for LLMedia API plugin system + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llgl.h" +#include "llplugininstance.h" +#include "llpluginmessage.h" +#include "llpluginmessageclasses.h" +#include "media_plugin_base.h" + +#include <time.h> + +//////////////////////////////////////////////////////////////////////////////// +// +class MediaPluginExample : + public MediaPluginBase +{ + public: + MediaPluginExample( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data ); + ~MediaPluginExample(); + + /*virtual*/ void receiveMessage( const char* message_string ); + + private: + bool init(); + void update( int milliseconds ); + void write_pixel( int x, int y, unsigned char r, unsigned char g, unsigned char b ); + bool mFirstTime; + + time_t mLastUpdateTime; + enum Constants { ENumObjects = 10 }; + unsigned char* mBackgroundPixels; + int mColorR[ ENumObjects ]; + int mColorG[ ENumObjects ]; + int mColorB[ ENumObjects ]; + int mXpos[ ENumObjects ]; + int mYpos[ ENumObjects ]; + int mXInc[ ENumObjects ]; + int mYInc[ ENumObjects ]; + int mBlockSize[ ENumObjects ]; + bool mMouseButtonDown; + bool mStopAction; +}; + +//////////////////////////////////////////////////////////////////////////////// +// +MediaPluginExample::MediaPluginExample( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data ) : + MediaPluginBase( host_send_func, host_user_data ) +{ + mFirstTime = true; + mWidth = 0; + mHeight = 0; + mDepth = 4; + mPixels = 0; + mMouseButtonDown = false; + mStopAction = false; + mLastUpdateTime = 0; +} + +//////////////////////////////////////////////////////////////////////////////// +// +MediaPluginExample::~MediaPluginExample() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +// +void MediaPluginExample::receiveMessage( const char* message_string ) +{ + LLPluginMessage message_in; + + if ( message_in.parse( message_string ) >= 0 ) + { + std::string message_class = message_in.getClass(); + std::string message_name = message_in.getName(); + + if ( message_class == LLPLUGIN_MESSAGE_CLASS_BASE ) + { + if ( message_name == "init" ) + { + LLPluginMessage message( "base", "init_response" ); + LLSD versions = LLSD::emptyMap(); + versions[ LLPLUGIN_MESSAGE_CLASS_BASE ] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION; + versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION; + versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION; + message.setValueLLSD( "versions", versions ); + + std::string plugin_version = "Example media plugin, Example Version 1.0.0.0"; + message.setValue( "plugin_version", plugin_version ); + sendMessage( message ); + + // Plugin gets to decide the texture parameters to use. + message.setMessage( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" ); + message.setValueS32( "default_width", mWidth ); + message.setValueS32( "default_height", mHeight ); + message.setValueS32( "depth", mDepth ); + message.setValueU32( "internalformat", GL_RGBA ); + message.setValueU32( "format", GL_RGBA ); + message.setValueU32( "type", GL_UNSIGNED_BYTE ); + message.setValueBoolean( "coords_opengl", false ); + sendMessage( message ); + } + else + if ( message_name == "idle" ) + { + // no response is necessary here. + F64 time = message_in.getValueReal( "time" ); + + // Convert time to milliseconds for update() + update( time ); + } + else + if ( message_name == "cleanup" ) + { + // clean up here + } + else + if ( message_name == "shm_added" ) + { + SharedSegmentInfo info; + info.mAddress = message_in.getValuePointer( "address" ); + info.mSize = ( size_t )message_in.getValueS32( "size" ); + std::string name = message_in.getValue( "name" ); + + mSharedSegments.insert( SharedSegmentMap::value_type( name, info ) ); + + } + else + if ( message_name == "shm_remove" ) + { + std::string name = message_in.getValue( "name" ); + + SharedSegmentMap::iterator iter = mSharedSegments.find( name ); + if( iter != mSharedSegments.end() ) + { + if ( mPixels == iter->second.mAddress ) + { + // This is the currently active pixel buffer. + // Make sure we stop drawing to it. + mPixels = NULL; + mTextureSegmentName.clear(); + }; + mSharedSegments.erase( iter ); + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown shared memory region!" << std::endl; + }; + + // Send the response so it can be cleaned up. + LLPluginMessage message( "base", "shm_remove_response" ); + message.setValue( "name", name ); + sendMessage( message ); + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown base message: " << message_name << std::endl; + }; + } + else + if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA ) + { + if ( message_name == "size_change" ) + { + std::string name = message_in.getValue( "name" ); + S32 width = message_in.getValueS32( "width" ); + S32 height = message_in.getValueS32( "height" ); + S32 texture_width = message_in.getValueS32( "texture_width" ); + S32 texture_height = message_in.getValueS32( "texture_height" ); + + if ( ! name.empty() ) + { + // Find the shared memory region with this name + SharedSegmentMap::iterator iter = mSharedSegments.find( name ); + if ( iter != mSharedSegments.end() ) + { + mPixels = ( unsigned char* )iter->second.mAddress; + mWidth = width; + mHeight = height; + + mTextureWidth = texture_width; + mTextureHeight = texture_height; + + init(); + }; + }; + + LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response" ); + message.setValue( "name", name ); + message.setValueS32( "width", width ); + message.setValueS32( "height", height ); + message.setValueS32( "texture_width", texture_width ); + message.setValueS32( "texture_height", texture_height ); + sendMessage( message ); + } + else + if ( message_name == "load_uri" ) + { + std::string uri = message_in.getValue( "uri" ); + if ( ! uri.empty() ) + { + }; + } + else + if ( message_name == "mouse_event" ) + { + std::string event = message_in.getValue( "event" ); + S32 button = message_in.getValueS32( "button" ); + + // left mouse button + if ( button == 0 ) + { + int mouse_x = message_in.getValueS32( "x" ); + int mouse_y = message_in.getValueS32( "y" ); + std::string modifiers = message_in.getValue( "modifiers" ); + + if ( event == "move" ) + { + if ( mMouseButtonDown ) + write_pixel( mouse_x, mouse_y, rand() % 0x80 + 0x80, rand() % 0x80 + 0x80, rand() % 0x80 + 0x80 ); + } + else + if ( event == "down" ) + { + mMouseButtonDown = true; + } + else + if ( event == "up" ) + { + mMouseButtonDown = false; + } + else + if ( event == "double_click" ) + { + }; + }; + } + else + if ( message_name == "key_event" ) + { + std::string event = message_in.getValue( "event" ); + S32 key = message_in.getValueS32( "key" ); + std::string modifiers = message_in.getValue( "modifiers" ); + + if ( event == "down" ) + { + if ( key == ' ') + { + mLastUpdateTime = 0; + update( 0 ); + }; + }; + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown media message: " << message_string << std::endl; + }; + } + else + if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ) + { + if ( message_name == "browse_reload" ) + { + mLastUpdateTime = 0; + mFirstTime = true; + mStopAction = false; + update( 0 ); + } + else + if ( message_name == "browse_stop" ) + { + for( int n = 0; n < ENumObjects; ++n ) + mXInc[ n ] = mYInc[ n ] = 0; + + mStopAction = true; + update( 0 ); + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown media_browser message: " << message_string << std::endl; + }; + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown message class: " << message_class << std::endl; + }; + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// +void MediaPluginExample::write_pixel( int x, int y, unsigned char r, unsigned char g, unsigned char b ) +{ + // make sure we don't write outside the buffer + if ( ( x < 0 ) || ( x >= mWidth ) || ( y < 0 ) || ( y >= mHeight ) ) + return; + + if ( mBackgroundPixels != NULL ) + { + unsigned char *pixel = mBackgroundPixels; + pixel += y * mWidth * mDepth; + pixel += ( x * mDepth ); + pixel[ 0 ] = b; + pixel[ 1 ] = g; + pixel[ 2 ] = r; + + setDirty( x, y, x + 1, y + 1 ); + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// +void MediaPluginExample::update( int milliseconds ) +{ + if ( mWidth < 1 || mWidth > 2048 || mHeight < 1 || mHeight > 2048 ) + return; + + if ( mPixels == 0 ) + return; + + if ( mFirstTime ) + { + for( int n = 0; n < ENumObjects; ++n ) + { + mXpos[ n ] = ( mWidth / 2 ) + rand() % ( mWidth / 16 ) - ( mWidth / 32 ); + mYpos[ n ] = ( mHeight / 2 ) + rand() % ( mHeight / 16 ) - ( mHeight / 32 ); + + mColorR[ n ] = rand() % 0x60 + 0x60; + mColorG[ n ] = rand() % 0x60 + 0x60; + mColorB[ n ] = rand() % 0x60 + 0x60; + + mXInc[ n ] = 0; + while ( mXInc[ n ] == 0 ) + mXInc[ n ] = rand() % 7 - 3; + + mYInc[ n ] = 0; + while ( mYInc[ n ] == 0 ) + mYInc[ n ] = rand() % 9 - 4; + + mBlockSize[ n ] = rand() % 0x30 + 0x10; + }; + + delete [] mBackgroundPixels; + + mBackgroundPixels = new unsigned char[ mWidth * mHeight * mDepth ]; + + mFirstTime = false; + }; + + if ( mStopAction ) + return; + + if ( time( NULL ) > mLastUpdateTime + 3 ) + { + const int num_squares = rand() % 20 + 4; + int sqr1_r = rand() % 0x80 + 0x20; + int sqr1_g = rand() % 0x80 + 0x20; + int sqr1_b = rand() % 0x80 + 0x20; + int sqr2_r = rand() % 0x80 + 0x20; + int sqr2_g = rand() % 0x80 + 0x20; + int sqr2_b = rand() % 0x80 + 0x20; + + for ( int y1 = 0; y1 < num_squares; ++y1 ) + { + for ( int x1 = 0; x1 < num_squares; ++x1 ) + { + int px_start = mWidth * x1 / num_squares; + int px_end = ( mWidth * ( x1 + 1 ) ) / num_squares; + int py_start = mHeight * y1 / num_squares; + int py_end = ( mHeight * ( y1 + 1 ) ) / num_squares; + + for( int y2 = py_start; y2 < py_end; ++y2 ) + { + for( int x2 = px_start; x2 < px_end; ++x2 ) + { + int rowspan = mWidth * mDepth; + + if ( ( y1 % 2 ) ^ ( x1 % 2 ) ) + { + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr1_r; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr1_g; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr1_b; + } + else + { + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr2_r; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr2_g; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr2_b; + }; + }; + }; + }; + }; + + time( &mLastUpdateTime ); + }; + + memcpy( mPixels, mBackgroundPixels, mWidth * mHeight * mDepth ); + + for( int n = 0; n < ENumObjects; ++n ) + { + if ( rand() % 50 == 0 ) + { + mXInc[ n ] = 0; + while ( mXInc[ n ] == 0 ) + mXInc[ n ] = rand() % 7 - 3; + + mYInc[ n ] = 0; + while ( mYInc[ n ] == 0 ) + mYInc[ n ] = rand() % 9 - 4; + }; + + if ( mXpos[ n ] + mXInc[ n ] < 0 || mXpos[ n ] + mXInc[ n ] >= mWidth - mBlockSize[ n ] ) + mXInc[ n ] =- mXInc[ n ]; + + if ( mYpos[ n ] + mYInc[ n ] < 0 || mYpos[ n ] + mYInc[ n ] >= mHeight - mBlockSize[ n ] ) + mYInc[ n ] =- mYInc[ n ]; + + mXpos[ n ] += mXInc[ n ]; + mYpos[ n ] += mYInc[ n ]; + + for( int y = 0; y < mBlockSize[ n ]; ++y ) + { + for( int x = 0; x < mBlockSize[ n ]; ++x ) + { + mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 0 ] = mColorR[ n ]; + mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 1 ] = mColorG[ n ]; + mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 2 ] = mColorB[ n ]; + }; + }; + }; + + setDirty( 0, 0, mWidth, mHeight ); +}; + +//////////////////////////////////////////////////////////////////////////////// +// +bool MediaPluginExample::init() +{ + LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text" ); + message.setValue( "name", "Example Plugin" ); + sendMessage( message ); + + return true; +}; + +//////////////////////////////////////////////////////////////////////////////// +// +int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func, + void* host_user_data, + LLPluginInstance::sendMessageFunction *plugin_send_func, + void **plugin_user_data ) +{ + MediaPluginExample* self = new MediaPluginExample( host_send_func, host_user_data ); + *plugin_send_func = MediaPluginExample::staticReceiveMessage; + *plugin_user_data = ( void* )self; + + return 0; +} diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a7681e4a1d..0133d2222d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -185,6 +185,7 @@ set(viewer_SOURCE_FILES llfloatermediasettings.cpp llfloatermemleak.cpp llfloaternamedesc.cpp + llfloaternearbymedia.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp llfloaterparcel.cpp @@ -665,6 +666,7 @@ set(viewer_HEADER_FILES llfloatermediasettings.h llfloatermemleak.h llfloaternamedesc.h + llfloaternearbymedia.h llfloaternotificationsconsole.h llfloateropenobject.h llfloaterparcel.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f9d4a06de8..c0eefaa642 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3631,6 +3631,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>IMShowControlPanel</key> + <map> + <key>Comment</key> + <string>Show IM Control Panel</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>IgnoreAllNotifications</key> <map> <key>Comment</key> @@ -4875,7 +4886,7 @@ <key>Value</key> <integer>10</integer> </map> - <key>ToastOpaqueTime</key> + <key>ToastFadingTime</key> <map> <key>Comment</key> <string>Number of seconds while a toast is fading </string> @@ -4887,6 +4898,29 @@ <integer>1</integer> </map> <key>StartUpToastLifeTime</key> + <key>NearbyToastFadingTime</key> + <map> + <key>Comment</key> + <string>Number of seconds while a nearby chat toast is fading </string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>3</integer> + </map> + <key>NearbyToastLifeTime</key> + <map> + <key>Comment</key> + <string>Number of seconds while a nearby chat toast exists</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>23</integer> + </map> + <key>StartUpToastLifeTime</key> <map> <key>Comment</key> <string>Number of seconds while a StartUp toast exist</string> diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 670f8717a2..bad61101c1 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -57,8 +57,6 @@ static LLDefaultChildRegistry::Register<LLIMP2PChiclet> t4("chiclet_im_p2p"); static LLDefaultChildRegistry::Register<LLIMGroupChiclet> t5("chiclet_im_group"); S32 LLNotificationChiclet::mUreadSystemNotifications = 0; -S32 LLNotificationChiclet::mUreadIMNotifications = 0; - boost::signals2::signal<LLChiclet* (const LLUUID&), LLIMChiclet::CollectChicletCombiner<std::list<LLChiclet*> > > @@ -99,7 +97,6 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) // connect counter handlers to the signals connectCounterUpdatersToSignal("notify"); connectCounterUpdatersToSignal("groupnotify"); - connectCounterUpdatersToSignal("notifytoast"); } LLNotificationChiclet::~LLNotificationChiclet() @@ -113,16 +110,8 @@ void LLNotificationChiclet::connectCounterUpdatersToSignal(std::string notificat LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type); if(n_handler) { - if(notification_type == "notifytoast") - { - n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::updateUreadIMNotifications, this)); - n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::updateUreadIMNotifications, this)); - } - else - { - n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); - n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); - } + n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); + n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); } } @@ -147,12 +136,6 @@ void LLNotificationChiclet::setToggleState(BOOL toggled) { mButton->setToggleState(toggled); } -void LLNotificationChiclet::updateUreadIMNotifications() -{ - mUreadIMNotifications = gIMMgr->getNumberOfUnreadIM(); - setCounter(mUreadSystemNotifications + mUreadIMNotifications); -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index d1153a075d..6eefd9829f 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -608,10 +608,9 @@ public: /*virtual*/ ~ LLNotificationChiclet(); - // methods for updating a number of unread System or IM notifications - void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications + mUreadIMNotifications); } - void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications + mUreadIMNotifications); } - void updateUreadIMNotifications(); + // methods for updating a number of unread System notifications + void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); } + void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); } void setToggleState(BOOL toggled); protected: @@ -622,7 +621,6 @@ protected: friend class LLUICtrlFactory; static S32 mUreadSystemNotifications; - static S32 mUreadIMNotifications; protected: LLButton* mButton; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index ccfe7d4b64..8ac7f3fd7e 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -35,6 +35,7 @@ // Viewer includes #include "llagent.h" +#include "llcallingcard.h" #include "llfocusmgr.h" #include "llfloaterreg.h" #include "llviewercontrol.h" @@ -76,6 +77,7 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) mCloseOnSelect(FALSE) { // LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml"); + mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this)); } BOOL LLFloaterAvatarPicker::postBuild() @@ -95,7 +97,11 @@ BOOL LLFloaterAvatarPicker::postBuild() LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe"); nearme->setDoubleClickCallback(onBtnSelect, this); childSetCommitCallback("NearMe", onList, this); - + + LLScrollListCtrl* friends = getChild<LLScrollListCtrl>("Friends"); + friends->setDoubleClickCallback(onBtnSelect, this); + childSetCommitCallback("Friends", onList, this); + childSetAction("Select", onBtnSelect, this); childDisable("Select"); @@ -119,6 +125,8 @@ BOOL LLFloaterAvatarPicker::postBuild() center(); + populateFriend(); + return TRUE; } @@ -159,25 +167,37 @@ void LLFloaterAvatarPicker::onBtnSelect(void* userdata) if(self->mCallback) { + std::string acvtive_panel_name; + LLScrollListCtrl* list = NULL; LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs"); - - if(active_panel == self->getChild<LLPanel>("SearchPanel")) + if(active_panel) { - std::vector<std::string> avatar_names; - std::vector<LLUUID> avatar_ids; - getSelectedAvatarData(self->getChild<LLScrollListCtrl>("SearchResults"), avatar_names, avatar_ids); - self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); + acvtive_panel_name = active_panel->getName(); + } + if(acvtive_panel_name == "SearchPanel") + { + list = self->getChild<LLScrollListCtrl>("SearchResults"); + } + else if(acvtive_panel_name == "NearMePanel") + { + list =self->getChild<LLScrollListCtrl>("NearMe"); + } + else if (acvtive_panel_name == "FriendsPanel") + { + list =self->getChild<LLScrollListCtrl>("Friends"); } - else if(active_panel == self->getChild<LLPanel>("NearMePanel")) + + if(list) { std::vector<std::string> avatar_names; std::vector<LLUUID> avatar_ids; - getSelectedAvatarData(self->getChild<LLScrollListCtrl>("NearMe"), avatar_names, avatar_ids); + getSelectedAvatarData(list, avatar_names, avatar_ids); self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); } } self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE); + self->getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE); if(self->mCloseOnSelect) { self->mCloseOnSelect = FALSE; @@ -268,6 +288,26 @@ void LLFloaterAvatarPicker::populateNearMe() } } +void LLFloaterAvatarPicker::populateFriend() +{ + LLScrollListCtrl* friends_scroller = getChild<LLScrollListCtrl>("Friends"); + friends_scroller->deleteAllItems(); + LLCollectAllBuddies collector; + LLAvatarTracker::instance().applyFunctor(collector); + LLCollectAllBuddies::buddy_map_t::iterator it; + + + for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++) + { + friends_scroller->addStringUUIDItem(it->first, it->second); + } + for(it = collector.mOffline.begin(); it!=collector.mOffline.end(); it++) + { + friends_scroller->addStringUUIDItem(it->first, it->second); + } + friends_scroller->sortByColumnIndex(0, TRUE); +} + void LLFloaterAvatarPicker::draw() { LLFloater::draw(); @@ -289,6 +329,10 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const { return getChild<LLScrollListCtrl>("NearMe")->getFirstSelectedIndex() >= 0; } + else if(active_panel == getChild<LLPanel>("FriendsPanel")) + { + return getChild<LLScrollListCtrl>("Friends")->getFirstSelectedIndex() >= 0; + } return FALSE; } @@ -321,6 +365,7 @@ void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) { getChild<LLScrollListCtrl>("SearchResults")->setAllowMultipleSelection(allow_multiple); getChild<LLScrollListCtrl>("NearMe")->setAllowMultipleSelection(allow_multiple); + getChild<LLScrollListCtrl>("Friends")->setAllowMultipleSelection(allow_multiple); } // static diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 85aacb68a5..b8ace985d9 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -67,6 +67,7 @@ private: void onTabChanged(); void populateNearMe(); + void populateFriend(); BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected. void find(); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index f3fec70ac9..b21df87093 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -302,6 +302,8 @@ void LLIMFloater::onSlide() LLPanel* im_control_panel = getChild<LLPanel>("panel_im_control_panel"); im_control_panel->setVisible(!im_control_panel->getVisible()); + gSavedSettings.setBOOL("IMShowControlPanel", im_control_panel->getVisible()); + getChild<LLButton>("slide_left_btn")->setVisible(im_control_panel->getVisible()); getChild<LLButton>("slide_right_btn")->setVisible(!im_control_panel->getVisible()); } @@ -344,6 +346,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } + floater->childSetVisible("panel_im_control_panel", gSavedSettings.getBOOL("IMShowControlPanel")); + return floater; } @@ -405,8 +409,6 @@ bool LLIMFloater::toggle(const LLUUID& session_id) { // ensure the list of messages is updated when floater is made visible show(session_id); - // update number of unread notifications in the SysWell - LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); return true; } } diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 9a05812847..e63daac4af 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -517,8 +517,8 @@ void LLNavigationBar::showTeleportHistoryMenu() // *TODO: why to draw/update anything before showing the menu? mTeleportHistoryMenu->buildDrawLabels(); mTeleportHistoryMenu->updateParent(LLMenuGL::sMenuContainer); - LLRect btnBackRect = mBtnBack->getRect(); - LLMenuGL::showPopup(this, mTeleportHistoryMenu, btnBackRect.mLeft, btnBackRect.mBottom); + const S32 MENU_SPAWN_PAD = -1; + LLMenuGL::showPopup(mBtnBack, mTeleportHistoryMenu, 0, MENU_SPAWN_PAD); // *HACK pass the mouse capturing to the drop-down menu gFocusMgr.setMouseCapture( NULL ); diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 217007fb15..32dc5e5927 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -224,7 +224,6 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setIgnoreTab(TRUE); mChatBox->setPassDelete(TRUE); mChatBox->setReplaceNewlinesWithSpaces(FALSE); - mChatBox->setMaxTextLength(1023); mChatBox->setEnableLineHistory(TRUE); mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator"); diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 6b0d6d61e0..957513e154 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -162,6 +162,8 @@ bool LLNearbyChatScreenChannel::createPoolToast() LLToast::Params p; p.panel = panel; + p.lifetime_secs = gSavedSettings.getS32("NearbyToastLifeTime"); + p.fading_time_secs = gSavedSettings.getS32("NearbyToastFadingTime"); LLToast* toast = new LLToast(p); @@ -326,6 +328,12 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) initChannel(); } + //only messages from AGENTS + if(CHAT_SOURCE_OBJECT == chat_msg.mSourceType) + { + return;//dn't show toast for messages from objects + } + LLUUID id; id.generate(); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 3d0db71045..48a93f0d42 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -131,6 +131,9 @@ void LLLandmarksPanel::onSearchEdit(const std::string& string) { LLAccordionCtrlTab* tab = *iter; tab->setVisible(true); + + // expand accordion to see matched items in all ones. See EXT-2014. + tab->changeOpenClose(false); } } @@ -883,7 +886,7 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg return true; } - +// static void LLLandmarksPanel::doIdle(void* landmarks_panel) { LLLandmarksPanel* panel = (LLLandmarksPanel* ) landmarks_panel; diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 6a3617f008..a198499b47 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -134,6 +134,11 @@ void LLPanelMediaSettingsGeneral::draw() LLPluginClassMedia* media_plugin = mPreviewMedia->getMediaPlugin();
if( media_plugin )
{
+ // turn off volume (if we can) for preview. Note: this really only
+ // works for QuickTime movies right now - no way to control the
+ // volume of a flash app embedded in a page for example
+ media_plugin->setVolume( 0 );
+
// some controls are only appropriate for time or browser type plugins
// so we selectively enable/disable them - need to do it in draw
// because the information from plugins arrives assynchronously
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 93a931dc78..419603e14e 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -427,7 +427,6 @@ void LLSysWellWindow::sessionRemoved(const LLUUID& sessionId) { delIMRow(sessionId); reshapeWindow(); - LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); } void LLSysWellWindow::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 24824a095c..903df21e78 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -49,13 +49,15 @@ LLToast::Params::Params() enable_hide_btn("enable_hide_btn", true), force_show("force_show", false), force_store("force_store", false), + fading_time_secs("fading_time_secs", gSavedSettings.getS32("ToastFadingTime")), lifetime_secs("lifetime_secs", gSavedSettings.getS32("NotificationToastLifeTime")) {}; LLToast::LLToast(const LLToast::Params& p) : LLModalDialog(LLSD(), p.is_modal), mPanel(p.panel), - mToastLifetime(p.lifetime_secs), + mToastLifetime(p.lifetime_secs), + mToastFadingTime(p.fading_time_secs), mNotificationID(p.notif_id), mSessionID(p.session_id), mCanFade(p.can_fade), @@ -127,7 +129,7 @@ bool LLToast::lifetimeHasExpired() if (mTimer.getStarted()) { F32 elapsed_time = mTimer.getElapsedTimeF32(); - if ((mToastLifetime - elapsed_time) <= gSavedSettings.getS32("ToastOpaqueTime")) + if ((mToastLifetime - elapsed_time) <= mToastFadingTime) { setBackgroundOpaque(FALSE); } diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 0698c94880..b670f47045 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -63,7 +63,8 @@ public: Optional<LLUUID> notif_id, //notification ID session_id; //im session ID Optional<LLNotificationPtr> notification; - Optional<F32> lifetime_secs; + Optional<F32> lifetime_secs, + fading_time_secs; // Number of seconds while a toast is fading Optional<toast_callback_t> on_delete_toast, on_mouse_enter; Optional<bool> can_fade, @@ -157,6 +158,7 @@ private: // timer counts a lifetime of a toast LLTimer mTimer; F32 mToastLifetime; // in seconds + F32 mToastFadingTime; // in seconds LLPanel* mPanel; LLButton* mHideBtn; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index dace3f875f..9ca2d3f61d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -80,6 +80,7 @@ #include "llfloatermap.h" #include "llfloatermemleak.h" #include "llfloaternamedesc.h" +#include "llfloaternearbymedia.h" #include "llfloaternotificationsconsole.h" #include "llfloateropenobject.h" #include "llfloaterpay.h" @@ -187,6 +188,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("mute_object_by_name", "floater_mute_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGetBlockedObjectName>); LLFloaterReg::add("mini_map", "floater_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMap>); LLFloaterReg::add("syswell_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLSysWellWindow>); + + LLFloaterReg::add("nearby_media", "floater_nearby_media.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNearbyMedia>); LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index e2d9f5a2c9..92022441b7 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -168,8 +168,7 @@ public: viewer_media_t mMediaImpl; bool mInitialized; }; -typedef std::vector<LLViewerMediaImpl*> impl_list; -static impl_list sViewerMediaImplList; +static LLViewerMedia::impl_list sViewerMediaImplList; static LLTimer sMediaCreateTimer; static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f; static F32 sGlobalVolume = 1.0f; @@ -183,8 +182,8 @@ static void add_media_impl(LLViewerMediaImpl* media) ////////////////////////////////////////////////////////////////////////////////////////// static void remove_media_impl(LLViewerMediaImpl* media) { - impl_list::iterator iter = sViewerMediaImplList.begin(); - impl_list::iterator end = sViewerMediaImplList.end(); + LLViewerMedia::impl_list::iterator iter = sViewerMediaImplList.begin(); + LLViewerMedia::impl_list::iterator end = sViewerMediaImplList.end(); for(; iter != end; iter++) { @@ -203,6 +202,7 @@ class LLViewerMediaMuteListObserver : public LLMuteListObserver static LLViewerMediaMuteListObserver sViewerMediaMuteListObserver; static bool sViewerMediaMuteListObserverInitialized = false; +static bool sInWorldMediaDisabled = false; ////////////////////////////////////////////////////////////////////////////////////////// @@ -428,15 +428,34 @@ void LLViewerMedia::muteListChanged() } } +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setInWorldMediaDisabled(bool disabled) +{ + sInWorldMediaDisabled = disabled; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::getInWorldMediaDisabled() +{ + return sInWorldMediaDisabled; +} + +const LLViewerMedia::impl_list &getPriorityList() +{ + return sViewerMediaImplList; +} + // This is the predicate function used to sort sViewerMediaImplList by priority. -static inline bool compare_impl_interest(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) +bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) { - if(i1->mIsMuted || i1->mMediaSourceFailed) + if(i1->isForcedUnloaded()) { // Muted or failed items always go to the end of the list, period. return false; } - else if(i2->mIsMuted || i2->mMediaSourceFailed) + else if(i2->isForcedUnloaded()) { // Muted or failed items always go to the end of the list, period. return true; @@ -483,7 +502,7 @@ void LLViewerMedia::updateMedia() } // Sort the static instance list using our interest criteria - std::stable_sort(sViewerMediaImplList.begin(), sViewerMediaImplList.end(), compare_impl_interest); + std::stable_sort(sViewerMediaImplList.begin(), sViewerMediaImplList.end(), priorityComparitor); // Go through the list again and adjust according to priority. iter = sViewerMediaImplList.begin(); @@ -515,7 +534,7 @@ void LLViewerMedia::updateMedia() LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; - if(pimpl->mIsMuted || pimpl->mMediaSourceFailed || (impl_count_total > (int)max_instances)) + if(pimpl->isForcedUnloaded() || (impl_count_total > (int)max_instances)) { // Never load muted or failed impls. // Hard limit on the number of instances that will be loaded at one time @@ -641,6 +660,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mNeedsMuteCheck(false), mPreviousMediaState(MEDIA_NONE), mPreviousMediaTime(0.0f), + mIsDisabled(false), mIsUpdated(false) { @@ -1650,6 +1670,27 @@ void LLViewerMediaImpl::resetPreviousMediaState() } ////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isForcedUnloaded() const +{ + if(mIsMuted || mMediaSourceFailed || mIsDisabled) + { + return true; + } + + if(sInWorldMediaDisabled) + { + // When inworld media is disabled, all instances that aren't marked as "used in UI" will not be loaded. + if(!mUsedInUI) + { + return true; + } + } + + return false; +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent event) { switch(event) diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 5444abf854..f997dc8c0e 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -66,10 +66,15 @@ private: observerListType mObservers; }; +class LLViewerMediaImpl; + class LLViewerMedia { LOG_CLASS(LLViewerMedia); public: + + typedef std::vector<LLViewerMediaImpl*> impl_list; + // Special case early init for just web browser component // so we can show login screen. See .cpp file for details. JC @@ -97,6 +102,14 @@ class LLViewerMedia static void mediaStop(void*); static F32 getVolume(); static void muteListChanged(); + static void setInWorldMediaDisabled(bool disabled); + static bool getInWorldMediaDisabled(); + + // Returns the priority-sorted list of all media impls. + static const impl_list &getPriorityList(); + + // This is the comparitor used to sort the list. + static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); }; // Implementation functions not exported into header file @@ -179,6 +192,12 @@ public: bool hasMedia(); bool isMediaFailed() { return mMediaSourceFailed; }; void resetPreviousMediaState(); + + void setDisabled(bool disabled) { mIsDisabled = disabled; }; + bool isMediaDisabled() { return mIsDisabled; }; + + // returns true if this instance should not be loaded (disabled, muted object, crashed, etc.) + bool isForcedUnloaded() const; ECursorType getLastSetCursor() { return mLastSetCursor; }; @@ -301,6 +320,7 @@ public: bool mNeedsMuteCheck; int mPreviousMediaState; F64 mPreviousMediaTime; + bool mIsDisabled; private: BOOL mIsUpdated ; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ec6ef92a54..8b7df63884 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1595,8 +1595,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Claim to be from a local agent so it doesn't go into // console. chat.mText = name + separator_string + message.substr(message_offset); - BOOL local_agent = TRUE; - LLFloaterChat::addChat(chat, FALSE, local_agent); + + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + { + nearby_chat->addMessage(chat); + } } else { diff --git a/indra/newview/skins/default/textures/icons/Generic_Object_Small.png b/indra/newview/skins/default/textures/icons/Generic_Object_Small.png Binary files differnew file mode 100644 index 0000000000..223874e631 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Generic_Object_Small.png diff --git a/indra/newview/skins/default/textures/icons/Inv_LookFolderClosed.png b/indra/newview/skins/default/textures/icons/Inv_LookFolderClosed.png Binary files differnew file mode 100644 index 0000000000..f2ae828efc --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_LookFolderClosed.png diff --git a/indra/newview/skins/default/textures/icons/Inv_LookFolderOpen.png b/indra/newview/skins/default/textures/icons/Inv_LookFolderOpen.png Binary files differnew file mode 100644 index 0000000000..d454d4cd48 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_LookFolderOpen.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index f0d27ac11d..d2c0ab9ae2 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -98,6 +98,9 @@ <texture name="Generic_Group" file_name="icons/Generic_Group.png" preload="false" /> <texture name="Generic_Group_Large" file_name="icons/Generic_Group_Large.png" preload="false" /> + <texture name="Generic_Object_Medium" file_name="icons/Generic_Object_Medium.png" preload="false" /> + <texture name="Generic_Object_Small" file_name="icons/ Generic_Object_Small.png" preload="false" /> + <texture name="Generic_Object_Large" file_name="icons/Generic_Object_Large.png" preload="false" /> <texture name="Generic_Person" file_name="icons/Generic_Person.png" preload="false" /> <texture name="Generic_Person_Large" file_name="icons/Generic_Person_Large.png" preload="false" /> @@ -161,6 +164,8 @@ <texture name="Inv_Gloves" file_name="icons/Inv_Gloves.png" preload="false" /> <texture name="Inv_Hair" file_name="icons/Inv_Hair.png" preload="false" /> <texture name="Inv_Jacket" file_name="icons/Inv_Jacket.png" preload="false" /> + <texture name="Inv_LookFolderOpen" file_name="icons/Inv_LookFolderOpen.png" preload="false" /> + <texture name="Inv_LookFolderClosed" file_name="icons/Inv_LookFolderClosed.png" preload="false" /> <texture name="Inv_Landmark" file_name="icons/Inv_Landmark.png" preload="false" /> <texture name="Inv_Notecard" file_name="icons/Inv_Notecard.png" preload="false" /> <texture name="Inv_Object" file_name="icons/Inv_Object.png" preload="false" /> @@ -433,9 +438,9 @@ <texture name="Widget_DownArrow" file_name="icons/Widget_DownArrow.png" preload="true" /> <texture name="Widget_UpArrow" file_name="icons/Widget_UpArrow.png" preload="true" /> - <texture name="Window_Background" file_name="windows/Window_Background.png" preload="true" + <texture name="Window_Background" file_name="windows/Window_Background.png" preload="true" scale.left="4" scale.top="24" scale.right="26" scale.bottom="4" /> - <texture name="Window_Foreground" file_name="windows/Window_Foreground.png" preload="true" + <texture name="Window_Foreground" file_name="windows/Window_Foreground.png" preload="true" scale.left="4" scale.top="24" scale.right="26" scale.bottom="4" /> <texture name="Window_NoTitle_Background" file_name="windows/Window_NoTitle_Background.png" preload="true" scale.left="4" scale.top="24" scale.right="26" scale.bottom="4" /> diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index d20566b08a..3f4f8b197f 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -86,6 +86,52 @@ top="52" width="132" /> </panel> + <panel + border="none" + height="150" + label="Friends" + layout="topleft" + left="6" + help_topic="avatarpicker_friends_tab" + name="FriendsPanel" + top="150" + width="132"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="InstructSelectFriend" + top="15" + width="200"> + Select a friend(s): + </text> + <button + follows="top|right" + layout="topleft" + right="-5" + top ="5" + height="20" + width="20" + name="RefreshFriends" + picture_style="true" + image_overlay="Refresh_Off"> + <button.commit_callback + function="Refresh.FriendList"/> + </button> + <scroll_list + follows="all" + height="100" + border="false" + layout="topleft" + left="0" + name="Friends" + sort_column="0" + top_pad="5" + width="132" /> + </panel> <panel border="none" diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml index 01a1b95a9a..02cbef5987 100644 --- a/indra/newview/skins/default/xui/en/floater_moveview.xml +++ b/indra/newview/skins/default/xui/en/floater_moveview.xml @@ -3,7 +3,7 @@ legacy_header_height="18" can_dock="true" can_close="true" - can_minimize="true" + can_minimize="false" center_horiz="true" follows="bottom" height="110" @@ -38,7 +38,7 @@ Fly Backwards (press Down Arrow or S) </string> <panel - border="true" + border="false" height="83" follows="left|top" layout="topleft" @@ -136,7 +136,7 @@ </panel> <!-- Width and height of this panel should be synchronized with panel_stand_stop_flying.xml --> <panel - border="true" + border="false" height="27" layout="topleft" left="0" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index a59a8b065f..3f63f493b1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -167,6 +167,18 @@ function="Floater.Toggle" parameter="active_speakers" /> </menu_item_check> + <menu_item_check + label="Nearby Media" + layout="topleft" + name="Nearby Media" + shortcut="control|alt|N"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="nearby_media" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="nearby_media" /> + </menu_item_check> <!--menu_item_check label="Block List" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml index 78f53562cd..05b04bbf8e 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_item.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml @@ -5,10 +5,10 @@ name="instant_message" width="300" height="180" - background_opaque="false" - background_visible="true" + background_opaque="true" + background_visible="false" follows="left|top|right|bottom" - bg_alpha_color="0.3 0.3 0.3 1.0"> + bg_alpha_color="0.3 0.3 0.3 0"> <panel width="250" height="30" background_visible="true" background_opaque="false" bg_alpha_color="0.0 0.0 0.0 1.0" name="msg_caption"> <avatar_icon top="25" left="10" width="20" height="20" follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index b002034a08..fedc49ae87 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -136,6 +136,7 @@ layout="topleft" left="120" top="18" + max_length="512" name="sl_description_edit" width="173" word_wrap="true"> @@ -188,6 +189,7 @@ height="100" layout="topleft" left="120" + max_length="512" top="142" name="fl_description_edit" width="173" diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index af00b96d27..2182163da5 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -23,6 +23,7 @@ layout="topleft" left_delta="7" left="0" + max_length="254" name="chat_box" tool_tip="Press Enter to say, Ctrl+Enter to shout" top="0" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 73a759a8ba..5af7d7d674 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -81,6 +81,7 @@ height="95" layout="topleft" left="107" + max_length="512" name="sl_description_edit" top_pad="-3" width="173" @@ -123,6 +124,7 @@ height="95" layout="topleft" left="107" + max_length="512" name="fl_description_edit" top_pad="-3" width="173" diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index 127f0f40e8..1bd5a5bda2 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- Optional parameters: + border - show border around panel bg_opaque_image - image name for "in-front" panel look bg_alpha_image - image name for "in-back" or transparent panel look --> diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt index 88c4ba8ad9..53b981cccd 100644 --- a/indra/test_apps/llplugintest/CMakeLists.txt +++ b/indra/test_apps/llplugintest/CMakeLists.txt @@ -293,6 +293,7 @@ add_dependencies(llmediaplugintest SLPlugin media_plugin_quicktime media_plugin_webkit + media_plugin_example ${LLPLUGIN_LIBRARIES} ${LLMESSAGE_LIBRARIES} ${LLCOMMON_LIBRARIES} @@ -369,6 +370,12 @@ if (DARWIN OR WINDOWS) DEPENDS ${BUILT_QUICKTIME_PLUGIN} ) + get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION) + add_custom_command(TARGET llmediaplugintest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_EXAMPLE_PLUGIN} ${PLUGINS_DESTINATION_DIR} + DEPENDS ${BUILT_EXAMPLE_PLUGIN} + ) + # copy over bookmarks file if llmediaplugintest gets built get_target_property(BUILT_LLMEDIAPLUGINTEST llmediaplugintest LOCATION) add_custom_command(TARGET llmediaplugintest POST_BUILD diff --git a/indra/test_apps/llplugintest/bookmarks.txt b/indra/test_apps/llplugintest/bookmarks.txt index ef34167b29..b8b83df386 100644 --- a/indra/test_apps/llplugintest/bookmarks.txt +++ b/indra/test_apps/llplugintest/bookmarks.txt @@ -34,3 +34,4 @@ (QT) Movie - The Informers,http://movies.apple.com/movies/independent/theinformers/theinformers_h.320.mov (QT) Animated GIF,http://upload.wikimedia.org/wikipedia/commons/4/44/Optical.greysquares.arp-animated.gif (QT) Apple Text Descriptors,http://ubrowser.com/tmp/apple_text.txt +(EX) Example Plugin,example://blah diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp index 553d1ab131..d987915bb8 100644 --- a/indra/test_apps/llplugintest/llmediaplugintest.cpp +++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp @@ -138,8 +138,6 @@ LLMediaPluginTest::LLMediaPluginTest( int app_window, int window_width, int wind mMediaBrowserControlBackButtonFlag( true ), mMediaBrowserControlForwardButtonFlag( true ), mHomeWebUrl( "http://www.google.com/" ) - //mHomeWebUrl( "file:///C|/Program Files/QuickTime/Sample.mov" ) - //mHomeWebUrl( "http://movies.apple.com/movies/wb/watchmen/watchmen-tlr2_480p.mov" ) { // debugging spam std::cout << std::endl << " GLUT version: " << "3.7.6" << std::endl; // no way to get real version from GLUT @@ -277,8 +275,6 @@ void LLMediaPluginTest::bindTexture(GLuint texture, GLint row_length, GLint alig { glEnable( GL_TEXTURE_2D ); -// std::cerr << "binding texture " << texture << std::endl; - glBindTexture( GL_TEXTURE_2D, texture ); glPixelStorei( GL_UNPACK_ROW_LENGTH, row_length ); glPixelStorei( GL_UNPACK_ALIGNMENT, alignment ); @@ -410,7 +406,7 @@ void LLMediaPluginTest::draw( int draw_type ) // only bother with pick if we have something to render // Actually, we need to pick even if we're not ready to render. // Otherwise you can't select and remove a panel which has gone bad. -// if ( mMediaPanels[ panel ]->mReadyToRender ) + //if ( mMediaPanels[ panel ]->mReadyToRender ) { glMatrixMode( GL_TEXTURE ); glPushMatrix(); @@ -621,10 +617,10 @@ void LLMediaPluginTest::idle() if ( mSelectedPanel ) { // set volume based on slider if we have time media -// if ( mGluiMediaTimeControlWindowFlag ) -// { -// mSelectedPanel->mMediaSource->setVolume( (float)mMediaTimeControlVolume / 100.0f ); -// }; + //if ( mGluiMediaTimeControlWindowFlag ) + //{ + // mSelectedPanel->mMediaSource->setVolume( (float)mMediaTimeControlVolume / 100.0f ); + //}; // NOTE: it is absurd that we need cache the state of GLUI controls // but enabling/disabling controls drags framerate from 500+ @@ -1463,6 +1459,9 @@ std::string LLMediaPluginTest::mimeTypeFromUrl( std::string& url ) else if ( url.find( ".txt" ) != std::string::npos ) // Apple Text descriptors mime_type = "video/quicktime"; + else + if ( url.find( "example://" ) != std::string::npos ) // Example plugin + mime_type = "example/example"; return mime_type; } @@ -1487,6 +1486,9 @@ std::string LLMediaPluginTest::pluginNameFromMimeType( std::string& mime_type ) else if ( mime_type == "text/html" ) plugin_name = "media_plugin_webkit.dll"; + else + if ( mime_type == "example/example" ) + plugin_name = "media_plugin_example.dll"; #elif LL_LINUX std::string plugin_name( "libmedia_plugin_null.so" ); @@ -1799,7 +1801,7 @@ void LLMediaPluginTest::getRandomMediaSize( int& width, int& height, std::string // adjust this random size if it's a browser so we get // a more useful size for testing.. - if ( mime_type == "text/html" ) + if ( mime_type == "text/html" || mime_type == "example/example" ) { width = ( ( rand() % 100 ) + 100 ) * 4; height = ( width * ( ( rand() % 400 ) + 1000 ) ) / 1000; |