summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2009-09-18 15:22:25 -0400
committerbrad kittenbrink <brad@lindenlab.com>2009-09-18 15:22:25 -0400
commitbb1d4592bdc83f23a60c864ef291c58912d93935 (patch)
treedfb29728340b1fef59227775ecc47aaab117fdd2
parent91645140d495da4faf1e4905bb8b96c6af579277 (diff)
parent8e7ba92eb9e0371385e3de9a76cc11355be8a974 (diff)
Merged latest viewer/viewer-20 into login-api.
-rw-r--r--.hgignore73
-rw-r--r--indra/CMakeLists.txt1
-rw-r--r--indra/cmake/00-Common.cmake12
-rw-r--r--indra/cmake/APR.cmake32
-rw-r--r--indra/cmake/CMakeLists.txt2
-rw-r--r--indra/cmake/Externals.cmake34
-rw-r--r--indra/cmake/FindMono.cmake2
-rw-r--r--indra/cmake/FindSVN.cmake34
-rw-r--r--indra/cmake/LLAddBuildTest.cmake33
-rw-r--r--indra/cmake/LLCommon.cmake4
-rw-r--r--indra/cmake/LLLogin.cmake7
-rw-r--r--indra/cmake/LLTestCommand.cmake13
-rw-r--r--indra/cmake/Linking.cmake3
-rw-r--r--indra/cmake/Pth.cmake21
-rw-r--r--indra/cmake/run_build_test.py111
-rwxr-xr-xindra/develop.py1
-rw-r--r--indra/lib/python/indra/util/test_win32_manifest.py126
-rw-r--r--indra/llcommon/CMakeLists.txt57
-rw-r--r--indra/llcommon/linden_common.h8
-rw-r--r--indra/llcommon/llallocator.h126
-rw-r--r--indra/llcommon/llapp.h2
-rw-r--r--indra/llcommon/llapr.h518
-rw-r--r--indra/llcommon/llassettype.h410
-rw-r--r--indra/llcommon/llbase32.h4
-rw-r--r--indra/llcommon/llbase64.h4
-rw-r--r--indra/llcommon/llcommon.h2
-rw-r--r--indra/llcommon/llcoros.cpp118
-rw-r--r--indra/llcommon/llcoros.h149
-rw-r--r--indra/llcommon/llcrc.h2
-rw-r--r--indra/llcommon/llcriticaldamp.h2
-rw-r--r--indra/llcommon/llcursortypes.h2
-rw-r--r--indra/llcommon/lldate.h6
-rw-r--r--indra/llcommon/lldependencies.h2
-rw-r--r--indra/llcommon/llerror.h6
-rw-r--r--indra/llcommon/llerrorcontrol.h48
-rw-r--r--indra/llcommon/llerrorthread.h2
-rw-r--r--indra/llcommon/llevent.h10
-rw-r--r--indra/llcommon/lleventcoro.cpp129
-rw-r--r--indra/llcommon/lleventcoro.h549
-rw-r--r--indra/llcommon/lleventdispatcher.cpp123
-rw-r--r--indra/llcommon/lleventdispatcher.h126
-rw-r--r--indra/llcommon/lleventfilter.cpp149
-rw-r--r--indra/llcommon/lleventfilter.h186
-rw-r--r--indra/llcommon/llevents.cpp44
-rw-r--r--indra/llcommon/llevents.h1765
-rw-r--r--indra/llcommon/llfasttimer.h488
-rw-r--r--indra/llcommon/llfile.h14
-rw-r--r--indra/llcommon/llfindlocale.h4
-rw-r--r--indra/llcommon/llfixedbuffer.h2
-rw-r--r--indra/llcommon/llformat.h2
-rw-r--r--indra/llcommon/llframetimer.h2
-rw-r--r--indra/llcommon/llheartbeat.h2
-rw-r--r--indra/llcommon/llliveappconfig.h2
-rw-r--r--indra/llcommon/lllivefile.h2
-rw-r--r--indra/llcommon/lllog.h2
-rw-r--r--indra/llcommon/llmd5.h2
-rw-r--r--indra/llcommon/llmemory.h130
-rw-r--r--indra/llcommon/llmemorystream.h4
-rw-r--r--indra/llcommon/llmemtype.h496
-rw-r--r--indra/llcommon/llmetrics.h2
-rw-r--r--indra/llcommon/llmortician.h2
-rw-r--r--indra/llcommon/llpreprocessor.h306
-rw-r--r--indra/llcommon/llprocesslauncher.h2
-rw-r--r--indra/llcommon/llqueuedthread.h5
-rw-r--r--indra/llcommon/llrand.h12
-rw-r--r--indra/llcommon/llrefcount.h4
-rw-r--r--indra/llcommon/llrun.h4
-rw-r--r--indra/llcommon/llsd.h4
-rw-r--r--indra/llcommon/llsdserialize.h28
-rw-r--r--indra/llcommon/llsdutil.cpp355
-rw-r--r--indra/llcommon/llsdutil.h114
-rw-r--r--indra/llcommon/llsecondlifeurls.h30
-rw-r--r--indra/llcommon/llsimplehash.h2
-rw-r--r--indra/llcommon/llsingleton.cpp38
-rw-r--r--indra/llcommon/llsingleton.h47
-rw-r--r--indra/llcommon/llstacktrace.cpp283
-rw-r--r--indra/llcommon/llstacktrace.h88
-rw-r--r--indra/llcommon/llstat.h14
-rw-r--r--indra/llcommon/llstreamtools.h36
-rw-r--r--indra/llcommon/llstring.h2583
-rw-r--r--indra/llcommon/llstringtable.h8
-rw-r--r--indra/llcommon/llsys.cpp8
-rw-r--r--indra/llcommon/llsys.h18
-rw-r--r--indra/llcommon/llthread.h10
-rw-r--r--indra/llcommon/lltimer.h28
-rw-r--r--indra/llcommon/lluri.h4
-rw-r--r--indra/llcommon/lluuid.h9
-rw-r--r--indra/llcommon/llworkerthread.h4
-rw-r--r--indra/llcommon/metaclass.h2
-rw-r--r--indra/llcommon/metaproperty.h2
-rw-r--r--indra/llcommon/reflective.h2
-rw-r--r--indra/llcommon/stringize.h73
-rw-r--r--indra/llcommon/tests/listener.h139
-rw-r--r--indra/llcommon/tests/lleventcoro_test.cpp782
-rw-r--r--indra/llcommon/tests/lleventfilter_test.cpp276
-rw-r--r--indra/llcommon/tests/wrapllerrs.h56
-rw-r--r--indra/llcommon/timing.h3
-rw-r--r--indra/llcommon/u64.h10
-rw-r--r--indra/llinventory/llparcel.cpp2
-rw-r--r--indra/llmath/CMakeLists.txt1
-rw-r--r--indra/llmath/llbbox.cpp2
-rw-r--r--indra/llmath/llsdutil_math.cpp2
-rw-r--r--indra/llmath/llsdutil_math.h70
-rw-r--r--indra/llmessage/CMakeLists.txt3
-rw-r--r--indra/llmessage/llares.cpp8
-rw-r--r--indra/llmessage/llares.h12
-rw-r--r--indra/llmessage/llareslistener.cpp75
-rw-r--r--indra/llmessage/llareslistener.h37
-rw-r--r--indra/llmessage/llcachename.h6
-rw-r--r--indra/llmessage/llinstantmessage.cpp2
-rw-r--r--indra/llmessage/llpartdata.cpp2
-rw-r--r--indra/llmessage/llregionpresenceverifier.cpp2
-rw-r--r--indra/llmessage/llsdmessage.cpp7
-rw-r--r--indra/llmessage/llsdmessage.h3
-rwxr-xr-xindra/llmessage/llsdmessagebuilder.cpp1
-rwxr-xr-xindra/llmessage/llsdmessagereader.cpp1
-rw-r--r--indra/llmessage/tests/llareslistener_test.cpp200
-rw-r--r--indra/llmessage/tests/llregionpresenceverifier_test.cpp2
-rw-r--r--indra/llmessage/tests/test_llsdmessage_peer.py30
-rw-r--r--indra/llmessage/tests/testrunner.py53
-rw-r--r--indra/llprimitive/llprimitive.cpp2
-rw-r--r--indra/llprimitive/lltextureentry.cpp2
-rw-r--r--indra/llrender/llgl.cpp2
-rw-r--r--indra/llui/CMakeLists.txt448
-rw-r--r--indra/llui/llfloater.cpp36
-rw-r--r--indra/llui/llfloater.h4
-rw-r--r--indra/llui/llfloaterreg.cpp3
-rw-r--r--indra/llui/llfloaterreg.h1
-rw-r--r--indra/llui/llfloaterreglistener.cpp66
-rw-r--r--indra/llui/llfloaterreglistener.h35
-rw-r--r--indra/llui/llfunctorregistry.cpp1
-rw-r--r--indra/llui/llnotifications.cpp3029
-rw-r--r--indra/llui/llnotifications.h17
-rw-r--r--indra/llui/llnotificationslistener.cpp55
-rw-r--r--indra/llui/llnotificationslistener.h34
-rw-r--r--indra/llui/llslider.cpp2
-rw-r--r--indra/llui/llsliderctrl.cpp1
-rw-r--r--indra/llvfs/lldir_linux.cpp2
-rw-r--r--indra/llvfs/lldir_mac.cpp2
-rw-r--r--indra/llvfs/lldir_win32.cpp2
-rw-r--r--indra/llwindow/llwindowmesaheadless.cpp2
-rw-r--r--indra/llwindow/llwindowmesaheadless.h2
-rw-r--r--indra/llxuixml/lluicolor.cpp2
-rw-r--r--indra/lscript/lscript_execute/llscriptresource.cpp2
-rw-r--r--indra/newview/CMakeLists.txt112
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/build_win32_appConfig.py28
-rw-r--r--indra/newview/llagent.cpp4
-rw-r--r--indra/newview/llagent.h4
-rw-r--r--indra/newview/llagentlistener.cpp78
-rw-r--r--indra/newview/llagentlistener.h36
-rw-r--r--indra/newview/llappviewer.cpp243
-rw-r--r--indra/newview/llappviewer.h14
-rw-r--r--indra/newview/llappviewerlistener.cpp37
-rw-r--r--indra/newview/llappviewerlistener.h34
-rw-r--r--indra/newview/llcapabilitylistener.cpp1
-rw-r--r--indra/newview/llclassifiedinfo.cpp36
-rw-r--r--indra/newview/llclassifiedinfo.h3
-rw-r--r--indra/newview/lleventinfo.cpp36
-rw-r--r--indra/newview/lleventinfo.h3
-rw-r--r--indra/newview/lleventnotifier.cpp79
-rw-r--r--indra/newview/lleventnotifier.h5
-rw-r--r--indra/newview/llfasttimerview.cpp8
-rw-r--r--indra/newview/llfeaturemanager.cpp6
-rw-r--r--indra/newview/llfloaterabout.cpp513
-rw-r--r--indra/newview/llfloaterfriends.h3
-rw-r--r--indra/newview/llfloatertos.cpp37
-rw-r--r--indra/newview/llfloatertos.h4
-rw-r--r--indra/newview/llimview.cpp2
-rw-r--r--indra/newview/llinventoryactions.h47
-rw-r--r--indra/newview/llinventorymodel.cpp216
-rw-r--r--indra/newview/llinventorymodel.h6
-rw-r--r--indra/newview/lllogininstance.cpp471
-rw-r--r--indra/newview/lllogininstance.h111
-rw-r--r--indra/newview/llmenucommands.cpp1
-rw-r--r--indra/newview/llpanelplace.cpp1
-rw-r--r--indra/newview/llpanelplaceinfo.cpp1
-rw-r--r--indra/newview/llstartup.cpp1419
-rw-r--r--indra/newview/llstartup.h6
-rw-r--r--indra/newview/lluilistener.cpp50
-rw-r--r--indra/newview/lluilistener.h29
-rw-r--r--indra/newview/llviewercontrollistener.cpp102
-rw-r--r--indra/newview/llviewercontrollistener.h33
-rw-r--r--indra/newview/llviewermedia.cpp5
-rw-r--r--indra/newview/llviewermenu.cpp5
-rw-r--r--indra/newview/llviewernetwork.cpp6
-rw-r--r--indra/newview/llviewernetwork.h4
-rw-r--r--indra/newview/llviewerparcelmgr.cpp1
-rw-r--r--indra/newview/llviewerwindow.cpp8
-rw-r--r--indra/newview/llviewerwindow.h5
-rw-r--r--indra/newview/llviewerwindowlistener.cpp87
-rw-r--r--indra/newview/llviewerwindowlistener.h35
-rw-r--r--indra/newview/llxmlrpclistener.cpp496
-rw-r--r--indra/newview/llxmlrpclistener.h35
-rw-r--r--indra/newview/llxmlrpctransaction.cpp13
-rw-r--r--indra/newview/skins/default/xui/da/floater_avatar_picker.xml47
-rw-r--r--indra/newview/skins/default/xui/da/floater_build_options.xml4
-rw-r--r--indra/newview/skins/default/xui/da/floater_buy_currency.xml2
-rw-r--r--indra/newview/skins/default/xui/da/floater_inspect.xml18
-rw-r--r--indra/newview/skins/default/xui/da/floater_joystick.xml38
-rw-r--r--indra/newview/skins/default/xui/da/floater_lagmeter.xml16
-rw-r--r--indra/newview/skins/default/xui/da/floater_land_holdings.xml19
-rw-r--r--indra/newview/skins/default/xui/da/floater_lsl_guide.xml2
-rw-r--r--indra/newview/skins/default/xui/da/floater_preview_notecard.xml11
-rw-r--r--indra/newview/skins/default/xui/da/floater_sound_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/da/floater_telehub.xml8
-rw-r--r--indra/newview/skins/default/xui/da/menu_inventory.xml1
-rw-r--r--indra/newview/skins/default/xui/da/panel_group_general.xml55
-rw-r--r--indra/newview/skins/default/xui/da/panel_group_invite.xml9
-rw-r--r--indra/newview/skins/default/xui/da/panel_group_land_money.xml46
-rw-r--r--indra/newview/skins/default/xui/da/panel_group_roles.xml12
-rw-r--r--indra/newview/skins/default/xui/da/panel_groups.xml4
-rw-r--r--indra/newview/skins/default/xui/da/panel_region_covenant.xml71
-rw-r--r--indra/newview/skins/default/xui/da/panel_region_estate.xml2
-rw-r--r--indra/newview/skins/default/xui/da/panel_region_general.xml73
-rw-r--r--indra/newview/skins/default/xui/da/panel_region_terrain.xml4
-rw-r--r--indra/newview/skins/default/xui/da/teleport_strings.xml25
-rw-r--r--indra/newview/skins/default/xui/de/floater_mute_object.xml4
-rw-r--r--indra/newview/skins/default/xui/de/floater_snapshot.xml108
-rw-r--r--indra/newview/skins/default/xui/de/panel_preferences_general.xml72
-rw-r--r--indra/newview/skins/default/xui/es/floater_about_land.xml94
-rw-r--r--indra/newview/skins/default/xui/es/floater_avatar_picker.xml8
-rw-r--r--indra/newview/skins/default/xui/es/floater_build_options.xml6
-rw-r--r--indra/newview/skins/default/xui/es/floater_buy_contents.xml2
-rw-r--r--indra/newview/skins/default/xui/es/floater_buy_currency.xml12
-rw-r--r--indra/newview/skins/default/xui/es/floater_color_picker.xml3
-rw-r--r--indra/newview/skins/default/xui/es/floater_day_cycle_options.xml12
-rw-r--r--indra/newview/skins/default/xui/es/floater_env_settings.xml15
-rw-r--r--indra/newview/skins/default/xui/es/floater_gesture.xml5
-rw-r--r--indra/newview/skins/default/xui/es/floater_inspect.xml10
-rw-r--r--indra/newview/skins/default/xui/es/floater_inventory_view_finder.xml10
-rw-r--r--indra/newview/skins/default/xui/es/floater_lagmeter.xml13
-rw-r--r--indra/newview/skins/default/xui/es/floater_land_holdings.xml2
-rw-r--r--indra/newview/skins/default/xui/es/floater_live_lsleditor.xml4
-rw-r--r--indra/newview/skins/default/xui/es/floater_lsl_guide.xml4
-rw-r--r--indra/newview/skins/default/xui/es/floater_media_browser.xml9
-rw-r--r--indra/newview/skins/default/xui/es/floater_mute_object.xml7
-rw-r--r--indra/newview/skins/default/xui/es/floater_pay.xml9
-rw-r--r--indra/newview/skins/default/xui/es/floater_pay_object.xml10
-rw-r--r--indra/newview/skins/default/xui/es/floater_preferences.xml5
-rw-r--r--indra/newview/skins/default/xui/es/floater_preview_animation.xml4
-rw-r--r--indra/newview/skins/default/xui/es/floater_script_search.xml16
-rw-r--r--indra/newview/skins/default/xui/es/floater_select_key.xml2
-rw-r--r--indra/newview/skins/default/xui/es/floater_telehub.xml18
-rw-r--r--indra/newview/skins/default/xui/es/floater_texture_ctrl.xml4
-rw-r--r--indra/newview/skins/default/xui/es/floater_tools.xml68
-rw-r--r--indra/newview/skins/default/xui/es/floater_top_objects.xml21
-rw-r--r--indra/newview/skins/default/xui/es/floater_url_entry.xml3
-rw-r--r--indra/newview/skins/default/xui/es/floater_water.xml22
-rw-r--r--indra/newview/skins/default/xui/es/floater_windlight_options.xml20
-rw-r--r--indra/newview/skins/default/xui/es/panel_group_general.xml12
-rw-r--r--indra/newview/skins/default/xui/es/panel_group_invite.xml17
-rw-r--r--indra/newview/skins/default/xui/es/panel_group_land_money.xml15
-rw-r--r--indra/newview/skins/default/xui/es/panel_group_notices.xml17
-rw-r--r--indra/newview/skins/default/xui/es/panel_group_roles.xml46
-rw-r--r--indra/newview/skins/default/xui/es/panel_groups.xml8
-rw-r--r--indra/newview/skins/default/xui/es/panel_preferences_general.xml72
-rw-r--r--indra/newview/skins/default/xui/es/panel_region_covenant.xml10
-rw-r--r--indra/newview/skins/default/xui/es/panel_region_debug.xml16
-rw-r--r--indra/newview/skins/default/xui/es/panel_region_estate.xml16
-rw-r--r--indra/newview/skins/default/xui/es/panel_region_general.xml10
-rw-r--r--indra/newview/skins/default/xui/es/panel_region_terrain.xml16
-rw-r--r--indra/newview/skins/default/xui/es/panel_region_texture.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/floater_customize.xml22
-rw-r--r--indra/newview/skins/default/xui/fr/floater_inventory.xml4
-rw-r--r--indra/newview/skins/default/xui/fr/floater_inventory_view_finder.xml8
-rw-r--r--indra/newview/skins/default/xui/fr/floater_mem_leaking.xml6
-rw-r--r--indra/newview/skins/default/xui/fr/panel_preferences_general.xml80
-rw-r--r--indra/newview/skins/default/xui/it/floater_about_land.xml74
-rw-r--r--indra/newview/skins/default/xui/it/floater_avatar_picker.xml8
-rw-r--r--indra/newview/skins/default/xui/it/floater_build_options.xml6
-rw-r--r--indra/newview/skins/default/xui/it/floater_buy_contents.xml6
-rw-r--r--indra/newview/skins/default/xui/it/floater_buy_currency.xml6
-rw-r--r--indra/newview/skins/default/xui/it/floater_day_cycle_options.xml30
-rw-r--r--indra/newview/skins/default/xui/it/floater_env_settings.xml14
-rw-r--r--indra/newview/skins/default/xui/it/floater_gesture.xml11
-rw-r--r--indra/newview/skins/default/xui/it/floater_inspect.xml10
-rw-r--r--indra/newview/skins/default/xui/it/floater_inventory_view_finder.xml2
-rw-r--r--indra/newview/skins/default/xui/it/floater_joystick.xml49
-rw-r--r--indra/newview/skins/default/xui/it/floater_lagmeter.xml17
-rw-r--r--indra/newview/skins/default/xui/it/floater_land_holdings.xml10
-rw-r--r--indra/newview/skins/default/xui/it/floater_live_lsleditor.xml4
-rw-r--r--indra/newview/skins/default/xui/it/floater_lsl_guide.xml4
-rw-r--r--indra/newview/skins/default/xui/it/floater_media_browser.xml9
-rw-r--r--indra/newview/skins/default/xui/it/floater_mute_object.xml6
-rw-r--r--indra/newview/skins/default/xui/it/floater_pay.xml21
-rw-r--r--indra/newview/skins/default/xui/it/floater_pay_object.xml23
-rw-r--r--indra/newview/skins/default/xui/it/floater_preferences.xml3
-rw-r--r--indra/newview/skins/default/xui/it/floater_preview_animation.xml4
-rw-r--r--indra/newview/skins/default/xui/it/floater_script_search.xml16
-rw-r--r--indra/newview/skins/default/xui/it/floater_telehub.xml18
-rw-r--r--indra/newview/skins/default/xui/it/floater_top_objects.xml31
-rw-r--r--indra/newview/skins/default/xui/it/floater_url_entry.xml4
-rw-r--r--indra/newview/skins/default/xui/it/floater_water.xml44
-rw-r--r--indra/newview/skins/default/xui/it/floater_windlight_options.xml32
-rw-r--r--indra/newview/skins/default/xui/it/panel_friends.xml2
-rw-r--r--indra/newview/skins/default/xui/it/panel_group_general.xml2
-rw-r--r--indra/newview/skins/default/xui/it/panel_group_invite.xml4
-rw-r--r--indra/newview/skins/default/xui/it/panel_group_land_money.xml23
-rw-r--r--indra/newview/skins/default/xui/it/panel_group_notices.xml31
-rw-r--r--indra/newview/skins/default/xui/it/panel_group_roles.xml44
-rw-r--r--indra/newview/skins/default/xui/it/panel_groups.xml10
-rw-r--r--indra/newview/skins/default/xui/it/panel_preferences_general.xml72
-rw-r--r--indra/newview/skins/default/xui/it/panel_region_covenant.xml30
-rw-r--r--indra/newview/skins/default/xui/it/panel_region_debug.xml12
-rw-r--r--indra/newview/skins/default/xui/it/panel_region_estate.xml16
-rw-r--r--indra/newview/skins/default/xui/it/panel_region_general.xml22
-rw-r--r--indra/newview/skins/default/xui/it/panel_region_terrain.xml8
-rw-r--r--indra/newview/skins/default/xui/it/panel_region_texture.xml6
-rw-r--r--indra/newview/skins/default/xui/it/teleport_strings.xml18
-rw-r--r--indra/newview/skins/default/xui/ja/floater_about_land.xml68
-rw-r--r--indra/newview/skins/default/xui/ja/floater_buy_contents.xml13
-rw-r--r--indra/newview/skins/default/xui/ja/floater_wearable_save_as.xml2
-rw-r--r--indra/newview/skins/default/xui/ja/panel_group_land_money.xml3
-rw-r--r--indra/newview/skins/default/xui/ja/panel_preferences_general.xml80
-rw-r--r--indra/newview/skins/default/xui/nl/floater_about_land.xml80
-rw-r--r--indra/newview/skins/default/xui/nl/floater_buy_contents.xml2
-rw-r--r--indra/newview/skins/default/xui/nl/floater_color_picker.xml5
-rw-r--r--indra/newview/skins/default/xui/nl/floater_env_settings.xml7
-rw-r--r--indra/newview/skins/default/xui/nl/floater_inspect.xml8
-rw-r--r--indra/newview/skins/default/xui/nl/floater_joystick.xml11
-rw-r--r--indra/newview/skins/default/xui/nl/floater_mute_object.xml8
-rw-r--r--indra/newview/skins/default/xui/nl/floater_openobject.xml4
-rw-r--r--indra/newview/skins/default/xui/nl/floater_pay.xml4
-rw-r--r--indra/newview/skins/default/xui/nl/floater_pay_object.xml12
-rw-r--r--indra/newview/skins/default/xui/nl/floater_perm_prefs.xml2
-rw-r--r--indra/newview/skins/default/xui/nl/floater_select_key.xml4
-rw-r--r--indra/newview/skins/default/xui/nl/floater_telehub.xml16
-rw-r--r--indra/newview/skins/default/xui/nl/floater_texture_ctrl.xml6
-rw-r--r--indra/newview/skins/default/xui/nl/floater_tools.xml86
-rw-r--r--indra/newview/skins/default/xui/nl/floater_top_objects.xml26
-rw-r--r--indra/newview/skins/default/xui/nl/floater_url_entry.xml4
-rw-r--r--indra/newview/skins/default/xui/nl/floater_water.xml5
-rw-r--r--indra/newview/skins/default/xui/nl/panel_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/nl/panel_group_general.xml19
-rw-r--r--indra/newview/skins/default/xui/nl/panel_group_invite.xml9
-rw-r--r--indra/newview/skins/default/xui/nl/panel_group_notices.xml24
-rw-r--r--indra/newview/skins/default/xui/nl/panel_group_roles.xml34
-rw-r--r--indra/newview/skins/default/xui/nl/panel_groups.xml14
-rw-r--r--indra/newview/skins/default/xui/nl/panel_region_estate.xml16
-rw-r--r--indra/newview/skins/default/xui/nl/panel_region_general.xml4
-rwxr-xr-xindra/newview/skins/default/xui/pl/floater_about_land.xml68
-rwxr-xr-xindra/newview/skins/default/xui/pl/floater_joystick.xml89
-rwxr-xr-xindra/newview/skins/default/xui/pl/floater_preview_sound.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pl/floater_telehub.xml4
-rwxr-xr-xindra/newview/skins/default/xui/pl/floater_tools.xml30
-rw-r--r--indra/newview/skins/default/xui/pt/floater_about_land.xml74
-rw-r--r--indra/newview/skins/default/xui/pt/floater_avatar_picker.xml12
-rw-r--r--indra/newview/skins/default/xui/pt/floater_build_options.xml6
-rw-r--r--indra/newview/skins/default/xui/pt/floater_buy_contents.xml6
-rw-r--r--indra/newview/skins/default/xui/pt/floater_color_picker.xml6
-rw-r--r--indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml28
-rw-r--r--indra/newview/skins/default/xui/pt/floater_env_settings.xml12
-rw-r--r--indra/newview/skins/default/xui/pt/floater_inspect.xml10
-rw-r--r--indra/newview/skins/default/xui/pt/floater_inventory_view_finder.xml6
-rw-r--r--indra/newview/skins/default/xui/pt/floater_joystick.xml41
-rw-r--r--indra/newview/skins/default/xui/pt/floater_lagmeter.xml13
-rw-r--r--indra/newview/skins/default/xui/pt/floater_land_holdings.xml10
-rw-r--r--indra/newview/skins/default/xui/pt/floater_live_lsleditor.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/floater_lsl_guide.xml4
-rw-r--r--indra/newview/skins/default/xui/pt/floater_mute_object.xml5
-rw-r--r--indra/newview/skins/default/xui/pt/floater_pay.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/floater_preferences.xml3
-rw-r--r--indra/newview/skins/default/xui/pt/floater_preview_sound.xml4
-rw-r--r--indra/newview/skins/default/xui/pt/floater_script_search.xml16
-rw-r--r--indra/newview/skins/default/xui/pt/floater_telehub.xml18
-rw-r--r--indra/newview/skins/default/xui/pt/floater_tools.xml61
-rw-r--r--indra/newview/skins/default/xui/pt/floater_top_objects.xml13
-rw-r--r--indra/newview/skins/default/xui/pt/floater_url_entry.xml1
-rw-r--r--indra/newview/skins/default/xui/pt/floater_water.xml23
-rw-r--r--indra/newview/skins/default/xui/pt/floater_windlight_options.xml23
-rw-r--r--indra/newview/skins/default/xui/pt/panel_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/pt/panel_group_general.xml6
-rw-r--r--indra/newview/skins/default/xui/pt/panel_group_invite.xml10
-rw-r--r--indra/newview/skins/default/xui/pt/panel_group_land_money.xml11
-rw-r--r--indra/newview/skins/default/xui/pt/panel_group_notices.xml21
-rw-r--r--indra/newview/skins/default/xui/pt/panel_group_roles.xml45
-rw-r--r--indra/newview/skins/default/xui/pt/panel_groups.xml17
-rw-r--r--indra/newview/skins/default/xui/pt/panel_preferences_general.xml72
-rw-r--r--indra/newview/skins/default/xui/pt/panel_region_covenant.xml20
-rw-r--r--indra/newview/skins/default/xui/pt/panel_region_debug.xml10
-rw-r--r--indra/newview/skins/default/xui/pt/panel_region_estate.xml4
-rw-r--r--indra/newview/skins/default/xui/pt/panel_region_terrain.xml10
-rw-r--r--indra/newview/skins/default/xui/pt/panel_region_texture.xml2
-rw-r--r--indra/newview/tests/llagentaccess_test.cpp2
-rw-r--r--indra/newview/tests/llcapabilitylistener_test.cpp36
-rw-r--r--indra/newview/tests/lllogininstance_test.cpp416
-rw-r--r--indra/newview/tests/llxmlrpclistener_test.cpp230
-rw-r--r--indra/newview/tests/test_llxmlrpc_peer.py59
-rwxr-xr-xindra/newview/viewer_manifest.py1531
-rw-r--r--indra/test/CMakeLists.txt25
-rw-r--r--indra/test/debug.h68
-rw-r--r--indra/test/llevents_tut.cpp133
-rwxr-xr-xindra/test/llsdmessagebuilder_tut.cpp2
-rwxr-xr-xindra/test/llsdmessagereader_tut.cpp1
-rw-r--r--indra/test/llsdutil_tut.cpp235
-rw-r--r--indra/test/lltut.cpp12
-rw-r--r--indra/test/lltut.h3
-rw-r--r--indra/test/test.cpp19
-rw-r--r--indra/test_apps/llplugintest/CMakeLists.txt6
-rw-r--r--indra/viewer_components/CMakeLists.txt5
-rw-r--r--indra/viewer_components/login/CMakeLists.txt56
-rw-r--r--indra/viewer_components/login/lllogin.cpp367
-rw-r--r--indra/viewer_components/login/lllogin.h133
-rw-r--r--indra/viewer_components/login/tests/lllogin_test.cpp417
-rw-r--r--install.xml79
406 files changed, 17625 insertions, 10246 deletions
diff --git a/.hgignore b/.hgignore
index 15fb913653..d92350ee4f 100644
--- a/.hgignore
+++ b/.hgignore
@@ -1,36 +1,37 @@
-syntax: glob
-
-*.pyc
-*~
-.*.swp
-LICENSES
-indra/.distcc
-indra/build-darwin-*
-indra/build-vc[0-9]*
-indra/lib/mono/1.0/*.dll
-indra/lib/mono/indra/*.dll
-indra/lib/mono/indra/*.exe
-indra/lib/mono/indra/*.pdb
-indra/llwindow/glh/glh_linear.h
-indra/newview/app_settings/mozilla
-indra/newview/app_settings/mozilla-runtime-*
-indra/newview/app_settings/mozilla_debug
-indra/newview/app_settings/static_*.db2
-indra/newview/character
-indra/newview/fmod.dll
-indra/newview/mozilla-theme
-indra/newview/mozilla-universal-darwin.tgz
-indra/newview/res-sdl
-indra/newview/skins
-indra/newview/vivox-runtime
-indra/server-linux-*
-indra/test/linden_file.dat
-indra/test_apps/llmediatest/dependencies/i686-win32
-indra/test_apps/terrain_mule/*.dll
-indra/viewer-linux-*
-indra/web/doc/asset-upload/plugins/lsl_compiler/lslc
-indra/web/doc/asset-upload/plugins/verify-notecard
-indra/web/doc/asset-upload/plugins/verify-texture
-installed.xml
-libraries
-tarfile_tmp
+syntax: glob
+
+*.pyc
+*~
+.*.swp
+LICENSES
+indra/.distcc
+indra/build-darwin-*
+indra/build-vc[0-9]*
+indra/lib/mono/1.0/*.dll
+indra/lib/mono/indra/*.dll
+indra/lib/mono/indra/*.exe
+indra/lib/mono/indra/*.pdb
+indra/lib/python/eventlet/
+indra/llwindow/glh/glh_linear.h
+indra/newview/app_settings/mozilla
+indra/newview/app_settings/mozilla-runtime-*
+indra/newview/app_settings/mozilla_debug
+indra/newview/app_settings/static_*.db2
+indra/newview/character
+indra/newview/fmod.dll
+indra/newview/mozilla-theme
+indra/newview/mozilla-universal-darwin.tgz
+indra/newview/res-sdl
+indra/newview/skins
+indra/newview/vivox-runtime
+indra/server-linux-*
+indra/test/linden_file.dat
+indra/test_apps/llmediatest/dependencies/i686-win32
+indra/test_apps/terrain_mule/*.dll
+indra/viewer-linux-*
+indra/web/doc/asset-upload/plugins/lsl_compiler/lslc
+indra/web/doc/asset-upload/plugins/verify-notecard
+indra/web/doc/asset-upload/plugins/verify-texture
+installed.xml
+libraries
+tarfile_tmp
diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 9418dbf271..261c0b17e2 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -66,6 +66,7 @@ if (VIEWER)
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
add_subdirectory(${LIBS_OPEN_PREFIX}llxuixml)
+ add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
# viewer media plugins
add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 2a70263446..0dc0e9e80c 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -179,11 +179,17 @@ endif (LINUX)
if (DARWIN)
- add_definitions(-DLL_DARWIN=1)
+ # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html):
+ # > Why the bus error? What am I doing wrong?
+ # This is a known issue where getcontext(3) is writing past the end of the
+ # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ).
+ # As a workaround, define _XOPEN_SOURCE before including ucontext.h.
+ add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
+ set(DARWIN_extra_cstar_flags "-mlong-branch")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake
index 0755aeee03..f4706dd4f2 100644
--- a/indra/cmake/APR.cmake
+++ b/indra/cmake/APR.cmake
@@ -13,26 +13,38 @@ if (STANDALONE)
else (STANDALONE)
use_prebuilt_binary(apr_suite)
if (WINDOWS)
+ if (LLCOMMON_LINK_SHARED)
+ set(APR_selector "lib")
+ else (LLCOMMON_LINK_SHARED)
+ set(APR_selector "")
+ endif (LLCOMMON_LINK_SHARED)
set(APR_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1.lib
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
)
set(APRICONV_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/apriconv-1.lib
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apriconv-1.lib
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib
)
set(APRUTIL_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib ${APRICONV_LIBRARIES}
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ${APRICONV_LIBRARIES}
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
)
elseif (DARWIN)
+ if (LLCOMMON_LINK_SHARED)
+ set(APR_selector "0.3.7.dylib")
+ set(APRUTIL_selector "0.3.8.dylib")
+ else (LLCOMMON_LINK_SHARED)
+ set(APR_selector "a")
+ set(APRUTIL_selector "a")
+ endif (LLCOMMON_LINK_SHARED)
set(APR_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.${APR_selector}
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector}
)
set(APRUTIL_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.${APRUTIL_selector}
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APRUTIL_selector}
)
set(APRICONV_LIBRARIES iconv)
else (WINDOWS)
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 3ce393b659..4563b59ad2 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -53,6 +53,7 @@ set(cmake_SOURCE_FILES
LLPrimitive.cmake
LLRender.cmake
LLScene.cmake
+ LLTestCommand.cmake
LLUI.cmake
LLVFS.cmake
LLWindow.cmake
@@ -69,7 +70,6 @@ set(cmake_SOURCE_FILES
PNG.cmake
Python.cmake
Prebuilt.cmake
- RunBuildTest.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake
diff --git a/indra/cmake/Externals.cmake b/indra/cmake/Externals.cmake
new file mode 100644
index 0000000000..26f3b56049
--- /dev/null
+++ b/indra/cmake/Externals.cmake
@@ -0,0 +1,34 @@
+# -*- cmake -*-
+
+include(Python)
+include(FindSVN)
+
+macro (use_svn_external _binary _path _url _rev)
+ if (NOT STANDALONE)
+ if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+ if(SVN_FOUND)
+ if(DEBUG_EXTERNALS)
+ message("cd ${_path} && ${SVN_EXECUTABLE} checkout -r ${_rev} ${_url} ${_binary}")
+ endif(DEBUG_EXTERNALS)
+ execute_process(COMMAND ${SVN_EXECUTABLE}
+ checkout
+ -r ${_rev}
+ ${_url}
+ ${_binary}
+ WORKING_DIRECTORY ${_path}
+ RESULT_VARIABLE ${_binary}_installed
+ )
+ else(SVN_FOUND)
+ message(FATAL_ERROR "Failed to find SVN_EXECUTABLE")
+ endif(SVN_FOUND)
+ file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
+ else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+ set(${_binary}_installed 0)
+ endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+ if(NOT ${_binary}_installed EQUAL 0)
+ message(FATAL_ERROR
+ "Failed to download or unpack prebuilt '${_binary}'."
+ " Process returned ${${_binary}_installed}.")
+ endif (NOT ${_binary}_installed EQUAL 0)
+ endif (NOT STANDALONE)
+endmacro (use_svn_external _binary _path _url _rev)
diff --git a/indra/cmake/FindMono.cmake b/indra/cmake/FindMono.cmake
index c36d7259e8..d956c48656 100644
--- a/indra/cmake/FindMono.cmake
+++ b/indra/cmake/FindMono.cmake
@@ -42,7 +42,7 @@ FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil
/usr/local/bin
)
FIND_PROGRAM (ILASM_EXECUTABLE
- ilasm
+ NAMES ilasm.bat ilasm
NO_DEFAULT_PATH
PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin
)
diff --git a/indra/cmake/FindSVN.cmake b/indra/cmake/FindSVN.cmake
new file mode 100644
index 0000000000..3322be4ca9
--- /dev/null
+++ b/indra/cmake/FindSVN.cmake
@@ -0,0 +1,34 @@
+# -*- cmake -*-
+#
+# Find the svn executable for exporting old svn:externals.
+#
+# Input variables:
+# SVN_FIND_REQUIRED - set this if configuration should fail without scp
+#
+# Output variables:
+#
+# SVN_FOUND - set if svn was found
+# SVN_EXECUTABLE - path to svn executable
+# SVN_BATCH_FLAG - how to put svn into batch mode
+
+
+SET(SVN_EXECUTABLE)
+FIND_PROGRAM(SVN_EXECUTABLE NAMES svn svn.exe)
+
+IF (SVN_EXECUTABLE)
+ SET(SVN_FOUND ON)
+ELSE (SVN_EXECUTABLE)
+ SET(SVN_FOUND OFF)
+ENDIF (SVN_EXECUTABLE)
+
+IF (SVN_FOUND)
+ GET_FILENAME_COMPONENT(_svn_name ${SVN_EXECUTABLE} NAME_WE)
+ SET(SVN_BATCH_FLAG --non-interactive)
+ELSE (SVN_FOUND)
+ IF (SVN_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find svn executable")
+ ENDIF (SVN_FIND_REQUIRED)
+ENDIF (SVN_FOUND)
+
+MARK_AS_ADVANCED(SVN_EXECUTABLE SVN_FOUND SVN_BATCH_FLAG)
+
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index 373ad4d4e9..ca8da05bbb 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -1,4 +1,5 @@
# -*- cmake -*-
+include(LLTestCommand)
MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
# Given a project name and a list of sourcefiles (with optional properties on each),
@@ -123,16 +124,20 @@ INCLUDE(GoogleMock)
GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
- # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
+
+ # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
IF(LL_TEST_VERBOSE)
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}")
ENDIF(LL_TEST_VERBOSE)
- SET(TEST_SCRIPT_CMD
- ${CMAKE_COMMAND}
- -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
- -DTEST_CMD:STRING="${TEST_CMD}"
- -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
- )
+
+ IF(WINDOWS)
+ set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+ ELSE(WINDOWS)
+ set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib)
+ ENDIF(WINDOWS)
+
+ LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD})
+ SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
IF(LL_TEST_VERBOSE)
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}")
ENDIF(LL_TEST_VERBOSE)
@@ -212,12 +217,14 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
ENDIF (test_exe_pos LESS 0)
- SET(TEST_SCRIPT_CMD
- ${CMAKE_COMMAND}
- -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
- -DTEST_CMD:STRING="${test_command}"
- -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
- )
+ IF(WINDOWS)
+ set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+ ELSE(WINDOWS)
+ set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib)
+ ENDIF(WINDOWS)
+
+ LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command})
+ SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
if(TEST_DEBUG)
message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")
diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake
index ef202dd879..d1ab264a41 100644
--- a/indra/cmake/LLCommon.cmake
+++ b/indra/cmake/LLCommon.cmake
@@ -17,3 +17,7 @@ set(LLCOMMON_LIBRARIES llcommon)
add_definitions(${TCMALLOC_FLAG})
+set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.")
+if(LLCOMMON_LINK_SHARED)
+ add_definitions(-DLL_COMMON_LINK_SHARED=1)
+endif(LLCOMMON_LINK_SHARED)
diff --git a/indra/cmake/LLLogin.cmake b/indra/cmake/LLLogin.cmake
new file mode 100644
index 0000000000..47d171876a
--- /dev/null
+++ b/indra/cmake/LLLogin.cmake
@@ -0,0 +1,7 @@
+# -*- cmake -*-
+
+set(LLLOGIN_INCLUDE_DIRS
+ ${LIBS_OPEN_DIR}/viewer_components/login
+ )
+
+set(LLLOGIN_LIBRARIES lllogin)
diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake
new file mode 100644
index 0000000000..fae5640493
--- /dev/null
+++ b/indra/cmake/LLTestCommand.cmake
@@ -0,0 +1,13 @@
+MACRO(LL_TEST_COMMAND LD_LIBRARY_PATH)
+ # nat wonders how Kitware can use the term 'function' for a construct that
+ # cannot return a value. And yet, variables you set inside a FUNCTION are
+ # local. Try a MACRO instead.
+ SET(LL_TEST_COMMAND_value
+ ${PYTHON_EXECUTABLE}
+ "${CMAKE_SOURCE_DIR}/cmake/run_build_test.py")
+ IF(LD_LIBRARY_PATH)
+ LIST(APPEND LL_TEST_COMMAND_value "-l${LD_LIBRARY_PATH}")
+ ENDIF(LD_LIBRARY_PATH)
+ LIST(APPEND LL_TEST_COMMAND_value ${ARGN})
+##MESSAGE(STATUS "Will run: ${LL_TEST_COMMAND_value}")
+ENDMACRO(LL_TEST_COMMAND)
diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index eaa8a6dc29..1f3553539f 100644
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -5,6 +5,7 @@ if (NOT STANDALONE)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
+ set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs")
elseif (LINUX)
if (VIEWER)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client)
@@ -13,10 +14,12 @@ if (NOT STANDALONE)
endif (VIEWER)
set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
+ set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged .sos")
elseif (DARWIN)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE})
+ set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs")
endif (WINDOWS)
endif (NOT STANDALONE)
diff --git a/indra/cmake/Pth.cmake b/indra/cmake/Pth.cmake
new file mode 100644
index 0000000000..a28f6ec696
--- /dev/null
+++ b/indra/cmake/Pth.cmake
@@ -0,0 +1,21 @@
+# -*- cmake -*-
+include(Prebuilt)
+
+set(PTH_FIND_QUIETLY ON)
+set(PTH_FIND_REQUIRED ON)
+
+if (STANDALONE)
+# ?? How would I construct FindPTH.cmake? This file was cloned from
+# CURL.cmake, which uses include(FindCURL), but there's no FindCURL.cmake?
+# include(FindPTH)
+else (STANDALONE)
+ # This library is only needed to support Boost.Coroutine, and only on Mac.
+ if (DARWIN)
+ use_prebuilt_binary(pth)
+ set(PTH_LIBRARIES pth)
+ set(PTH_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
+ else (DARWIN)
+ set(PTH_LIBRARIES)
+ set(PTH_INCLUDE_DIRS)
+ endif (DARWIN)
+endif (STANDALONE)
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
new file mode 100644
index 0000000000..17bce6f434
--- /dev/null
+++ b/indra/cmake/run_build_test.py
@@ -0,0 +1,111 @@
+#!/usr/bin/python
+"""\
+@file run_build_test.py
+@author Nat Goodspeed
+@date 2009-09-03
+@brief Helper script to allow CMake to run some command after setting
+ environment variables.
+
+CMake has commands to run an external program. But remember that each CMake
+command must be backed by multiple build-system implementations. Unfortunately
+it seems CMake can't promise that every target build system can set specified
+environment variables before running the external program of interest.
+
+This helper script is a workaround. It simply sets the requested environment
+variables and then executes the program specified on the rest of its command
+line.
+
+Example:
+
+python run_build_test.py -DFOO=bar myprog somearg otherarg
+
+sets environment variable FOO=bar, then runs:
+myprog somearg otherarg
+
+$LicenseInfo:firstyear=2009&license=internal$
+Copyright (c) 2009, Linden Research, Inc.
+$/LicenseInfo$
+"""
+
+import os
+import sys
+import subprocess
+
+def main(command, libpath=[], vars={}):
+ """Pass:
+ command is a sequence (e.g. a list) of strings. The first item in the list
+ must be the command name, the rest are its arguments.
+
+ libpath is a sequence of directory pathnames. These will be appended to
+ the platform-specific dynamic library search path environment variable.
+
+ vars is a dict of arbitrary (var, value) pairs to be added to the
+ environment before running 'command'.
+
+ This function runs the specified command, waits for it to terminate and
+ returns its return code. This will be negative if the command terminated
+ with a signal, else it will be the process's specified exit code.
+ """
+ # Handle platform-dependent libpath first.
+ if sys.platform == "win32":
+ lpvars = ["PATH"]
+ elif sys.platform == "darwin":
+ lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"]
+ elif sys.platform.startswith("linux"):
+ lpvars = ["LD_LIBRARY_PATH"]
+ else:
+ # No idea what the right pathname might be! But only crump if this
+ # feature is requested.
+ if libpath:
+ raise NotImplemented("run_build_test: unknown platform %s" % sys.platform)
+ lpvars = []
+ for var in lpvars:
+ # Split the existing path. Bear in mind that the variable in question
+ # might not exist; instead of KeyError, just use an empty string.
+ dirs = os.environ.get(var, "").split(os.pathsep)
+ # Append the sequence in libpath
+## print "%s += %r" % (var, libpath)
+ dirs.extend(libpath)
+ # Now rebuild the path string. This way we use a minimum of separators
+ # -- and we avoid adding a pointless separator when libpath is empty.
+ os.environ[var] = os.pathsep.join(dirs)
+ # Now handle arbitrary environment variables. The tricky part is ensuring
+ # that all the keys and values we try to pass are actually strings.
+## if vars:
+## print "Setting:"
+## for key, value in vars.iteritems():
+## print "%s=%s" % (key, value)
+ os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()]))
+ # Run the child process.
+## print "Running: %s" % " ".join(command)
+ return subprocess.call(command)
+
+if __name__ == "__main__":
+ from optparse import OptionParser
+ parser = OptionParser(usage="usage: %prog [options] command args...")
+ # We want optparse support for the options we ourselves handle -- but we
+ # DO NOT want it looking at options for the executable we intend to run,
+ # rejecting them as invalid because we don't define them. So configure the
+ # parser to stop looking for options as soon as it sees the first
+ # positional argument (traditional Unix syntax).
+ parser.disable_interspersed_args()
+ parser.add_option("-D", "--define", dest="vars", default=[], action="append",
+ metavar="VAR=value",
+ help="Add VAR=value to the env variables defined")
+ parser.add_option("-l", "--libpath", dest="libpath", default=[], action="append",
+ metavar="DIR",
+ help="Add DIR to the platform-dependent DLL search path")
+ opts, args = parser.parse_args()
+ # What we have in opts.vars is a list of strings of the form "VAR=value"
+ # or possibly just "VAR". What we want is a dict. We can build that dict by
+ # constructing a list of ["VAR", "value"] pairs -- so split each
+ # "VAR=value" string on the '=' sign (but only once, in case we have
+ # "VAR=some=user=string"). To handle the case of just "VAR", append "" to
+ # the list returned by split(), then slice off anything after the pair we
+ # want.
+ rc = main(command=args, libpath=opts.libpath,
+ vars=dict([(pair.split('=', 1) + [""])[:2] for pair in opts.vars]))
+ if rc not in (None, 0):
+ print >>sys.stderr, "Failure running: %s" % " ".join(args)
+ print >>sys.stderr, "Error: %s" % rc
+ sys.exit((rc < 0) and 255 or rc)
diff --git a/indra/develop.py b/indra/develop.py
index b2b494d1b3..7836c97473 100755
--- a/indra/develop.py
+++ b/indra/develop.py
@@ -439,7 +439,6 @@ class DarwinSetup(UnixSetup):
)
if self.universal == 'ON':
args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\''
- pass
#if simple:
# return 'cmake %(opts)s %(dir)r' % args
return ('cmake -G %(generator)r '
diff --git a/indra/lib/python/indra/util/test_win32_manifest.py b/indra/lib/python/indra/util/test_win32_manifest.py
new file mode 100644
index 0000000000..7aa7a10928
--- /dev/null
+++ b/indra/lib/python/indra/util/test_win32_manifest.py
@@ -0,0 +1,126 @@
+# @file test_win32_manifest.py
+# @brief Test an assembly binding version and uniqueness in a windows dll or exe.
+#
+# $LicenseInfo:firstyear=2009&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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+
+import sys, os
+import tempfile
+from xml.dom.minidom import parse
+
+def get_HKLM_registry_value(key_str, value_str):
+ import _winreg
+ reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
+ key = _winreg.OpenKey(reg, key_str)
+ value = _winreg.QueryValueEx(key, value_str)[0]
+ print 'Found: %s' % value
+ return value
+
+def find_vc_dir():
+ supported_versions = (r'8.0', r'9.0')
+ value_str = (r'ProductDir')
+
+ for version in supported_versions:
+ key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VC' %
+ version)
+ try:
+ return get_HKLM_registry_value(key_str, value_str)
+ except WindowsError, err:
+ x64_key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
+ version)
+ try:
+ return get_HKLM_registry_value(x64_key_str, value_str)
+ except:
+ print >> sys.stderr, "Didn't find MS VC version %s " % version
+
+ raise
+
+def find_mt_path():
+ vc_dir = find_vc_dir()
+ mt_path = '\"%sbin\\mt.exe\"' % vc_dir
+ return mt_path
+
+def test_assembly_binding(src_filename, assembly_name, assembly_ver):
+ (tmp_file_fd, tmp_file_name) = tempfile.mkstemp(suffix='.xml')
+ tmp_file = os.fdopen(tmp_file_fd)
+ tmp_file.close()
+
+ mt_path = find_mt_path()
+ resource_id = ""
+ if os.path.splitext(src_filename)[1].lower() == ".dll":
+ resource_id = ";#2"
+ system_call = '%s -nologo -inputresource:%s%s -out:%s' % (mt_path, src_filename, resource_id, tmp_file_name)
+ print "Executing: %s" % system_call
+ os.system(system_call)
+
+ manifest_dom = parse(tmp_file_name)
+ nodes = manifest_dom.getElementsByTagName('assemblyIdentity')
+
+ versions = list()
+ for node in nodes:
+ if node.getAttribute('name') == assembly_name:
+ versions.append(node.getAttribute('version'))
+
+ if len(versions) == 0:
+ print "No manifest found for %s" % src_filename
+
+ elif len(versions) > 1:
+ print "Multiple bindings to %s found:" % assembly_name
+ print versions
+ print
+ raise Exception("Multiple bindings")
+
+ elif versions[0] != assembly_ver:
+ print "Unexpected version found for %s:" % assembly_name
+ print "Wanted %s, found %s" % (assembly_ver, versions[0])
+ print
+ raise Exception("Unexpected version")
+
+ os.remove(tmp_file_name)
+
+
+if __name__ == '__main__':
+
+ print "Running test_win32_manifest.py..."
+ print
+
+ usage = 'test_win32_manfest <srcFileName> <assemblyName> <assemblyVersion>'
+
+ try:
+ src_filename = sys.argv[1]
+ assembly_name = sys.argv[2]
+ assembly_ver = sys.argv[3]
+ except:
+ print "Usage:"
+ print usage
+ print
+ raise
+
+ test_assembly_binding(src_filename, assembly_name, assembly_ver)
+
+
+
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 138dc85459..1c84c9e21e 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -5,12 +5,19 @@ project(llcommon)
include(00-Common)
include(LLAddBuildTest)
include(LLCommon)
+include(Linking)
include(Boost)
+include (Pth)
+
+if (WINDOWS)
+ include(CopyWinLibs)
+endif (WINDOWS)
include_directories(
${EXPAT_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
+ ${PTH_INCLUDE_DIRS}
)
# add_executable(lltreeiterators lltreeiterators.cpp)
@@ -27,6 +34,7 @@ set(llcommon_SOURCE_FILES
llbase32.cpp
llbase64.cpp
llcommon.cpp
+ llcoros.cpp
llcrc.cpp
llcriticaldamp.cpp
llcursortypes.cpp
@@ -35,6 +43,9 @@ set(llcommon_SOURCE_FILES
llerror.cpp
llerrorthread.cpp
llevent.cpp
+ lleventcoro.cpp
+ lleventdispatcher.cpp
+ lleventfilter.cpp
llevents.cpp
llfasttimer.cpp
llfile.cpp
@@ -65,6 +76,7 @@ set(llcommon_SOURCE_FILES
llsdserialize_xml.cpp
llsdutil.cpp
llsecondlifeurls.cpp
+ llsingleton.cpp
llstat.cpp
llstacktrace.cpp
llstreamtools.cpp
@@ -107,6 +119,7 @@ set(llcommon_HEADER_FILES
llchat.h
llclickaction.h
llcommon.h
+ llcoros.h
llcrc.h
llcriticaldamp.h
llcursortypes.h
@@ -128,6 +141,9 @@ set(llcommon_HEADER_FILES
llerrorlegacy.h
llerrorthread.h
llevent.h
+ lleventcoro.h
+ lleventdispatcher.h
+ lleventfilter.h
llevents.h
lleventemitter.h
llextendedstatus.h
@@ -142,6 +158,7 @@ set(llcommon_HEADER_FILES
llhttpstatuscodes.h
llindexedqueue.h
llinstancetracker.h
+ llinstancetracker.h
llkeythrottle.h
lllazy.h
lllinkedqueue.h
@@ -223,17 +240,55 @@ set_source_files_properties(${llcommon_HEADER_FILES}
list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
-add_library (llcommon ${llcommon_SOURCE_FILES})
+if(LLCOMMON_LINK_SHARED)
+ add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
+
+ if(SHARED_LIB_STAGING_DIR)
+ # *FIX:Mani ---
+ # llcommon.dll get written to the DLL staging directory.
+ # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
+ set_target_properties(llcommon PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
+ if(NOT WINDOWS)
+ get_target_property(LLCOMMON_PATH llcommon LOCATION)
+ get_filename_component(LLCOMMON_FILE ${LLCOMMON_PATH} NAME)
+ add_custom_command(
+ TARGET llcommon POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS
+ -E
+ copy_if_different
+ ${LLCOMMON_PATH}
+ ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/${LLCOMMON_FILE}
+ COMMENT "Copying llcommon to the staging folder."
+ )
+ endif(NOT WINDOWS)
+ endif(SHARED_LIB_STAGING_DIR)
+
+ if (DARWIN)
+ set_target_properties(llcommon PROPERTIES
+ BUILD_WITH_INSTALL_RPATH 1
+ INSTALL_NAME_DIR "@executable_path/../Resources"
+ )
+ endif(DARWIN)
+
+else(LLCOMMON_LINK_SHARED)
+ add_library (llcommon ${llcommon_SOURCE_FILES})
+endif(LLCOMMON_LINK_SHARED)
+
target_link_libraries(
llcommon
${APRUTIL_LIBRARIES}
${APR_LIBRARIES}
${EXPAT_LIBRARIES}
${ZLIB_LIBRARIES}
+ ${WINDOWS_LIBRARIES}
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${BOOST_REGEX_LIBRARY}
+ ${PTH_LIBRARIES}
)
+add_dependencies(llcommon stage_third_party_libs)
+
include(LLAddBuildTest)
SET(llcommon_TEST_SOURCE_FILES
)
diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h
index 8687a24655..c2eb867795 100644
--- a/indra/llcommon/linden_common.h
+++ b/indra/llcommon/linden_common.h
@@ -72,13 +72,7 @@
#ifdef LL_WINDOWS
// Reenable warnings we disabled above
#pragma warning (3 : 4702) // unreachable code, we like level 3, not 4
-// level 4 warnings that we need to disable:
-#pragma warning (disable : 4100) // unreferenced formal parameter
-#pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) )
-#pragma warning (disable : 4244) // possible loss of data on conversions
-#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
-#pragma warning (disable : 4512) // assignment operator could not be generated
-#pragma warning (disable : 4706) // assignment within conditional (even if((x = y)) )
+// moved msvc warnings to llpreprocessor.h *TODO - delete this comment after merge conflicts are unlikely -brad
#endif // LL_WINDOWS
// Linden only libs in alpha-order other than stdtypes.h
diff --git a/indra/llcommon/llallocator.h b/indra/llcommon/llallocator.h
index 2b70fee0b8..0d6f18c5d4 100644
--- a/indra/llcommon/llallocator.h
+++ b/indra/llcommon/llallocator.h
@@ -1,63 +1,63 @@
-/**
- * @file llallocator.h
- * @brief Declaration of the LLAllocator class.
- *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- *
- * Copyright (c) 2009-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-#ifndef LL_LLALLOCATOR_H
-#define LL_LLALLOCATOR_H
-
-#include <string>
-
-#include "llmemtype.h"
-#include "llallocator_heap_profile.h"
-
-class LLAllocator {
- friend class LLMemoryView;
- friend class LLMemType;
-
-private:
- static void pushMemType(S32 type);
- static S32 popMemType();
-
-public:
- void setProfilingEnabled(bool should_enable);
-
- static bool isProfiling();
-
- LLAllocatorHeapProfile const & getProfile();
-
-private:
- std::string getRawProfile();
-
-private:
- LLAllocatorHeapProfile mProf;
-};
-
-#endif // LL_LLALLOCATOR_H
+/**
+ * @file llallocator.h
+ * @brief Declaration of the LLAllocator class.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
+ * Copyright (c) 2009-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLALLOCATOR_H
+#define LL_LLALLOCATOR_H
+
+#include <string>
+
+#include "llmemtype.h"
+#include "llallocator_heap_profile.h"
+
+class LL_COMMON_API LLAllocator {
+ friend class LLMemoryView;
+ friend class LLMemType;
+
+private:
+ static void pushMemType(S32 type);
+ static S32 popMemType();
+
+public:
+ void setProfilingEnabled(bool should_enable);
+
+ static bool isProfiling();
+
+ LLAllocatorHeapProfile const & getProfile();
+
+private:
+ std::string getRawProfile();
+
+private:
+ LLAllocatorHeapProfile mProf;
+};
+
+#endif // LL_LLALLOCATOR_H
diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h
index e32a293f1c..1a052ce62d 100644
--- a/indra/llcommon/llapp.h
+++ b/indra/llcommon/llapp.h
@@ -62,7 +62,7 @@ public:
};
#endif
-class LLApp : public LLOptionInterface
+class LL_COMMON_API LLApp : public LLOptionInterface
{
friend class LLErrorThread;
public:
diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h
index 63130a89fc..0898aeec47 100644
--- a/indra/llcommon/llapr.h
+++ b/indra/llcommon/llapr.h
@@ -1,259 +1,259 @@
-/**
- * @file llapr.h
- * @author Phoenix
- * @date 2004-11-28
- * @brief Helper functions for using the apache portable runtime library.
- *
- * $LicenseInfo:firstyear=2004&license=viewergpl$
- *
- * Copyright (c) 2004-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-#ifndef LL_LLAPR_H
-#define LL_LLAPR_H
-
-#if LL_LINUX || LL_SOLARIS
-#include <sys/param.h> // Need PATH_MAX in APR headers...
-#endif
-
-#include <boost/noncopyable.hpp>
-
-#include "apr_thread_proc.h"
-#include "apr_thread_mutex.h"
-#include "apr_getopt.h"
-#include "apr_signal.h"
-#include "apr_atomic.h"
-#include "llstring.h"
-
-extern apr_thread_mutex_t* gLogMutexp;
-extern apr_thread_mutex_t* gCallStacksLogMutexp;
-
-/**
- * @brief initialize the common apr constructs -- apr itself, the
- * global pool, and a mutex.
- */
-void ll_init_apr();
-
-/**
- * @brief Cleanup those common apr constructs.
- */
-void ll_cleanup_apr();
-
-//
-//LL apr_pool
-//manage apr_pool_t, destroy allocated apr_pool in the destruction function.
-//
-class LLAPRPool
-{
-public:
- LLAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE) ;
- ~LLAPRPool() ;
-
- apr_pool_t* getAPRPool() ;
- apr_status_t getStatus() {return mStatus ; }
-
-protected:
- void releaseAPRPool() ;
- void createAPRPool() ;
-
-protected:
- apr_pool_t* mPool ; //pointing to an apr_pool
- apr_pool_t* mParent ; //parent pool
- apr_size_t mMaxSize ; //max size of mPool, mPool should return memory to system if allocated memory beyond this limit. However it seems not to work.
- apr_status_t mStatus ; //status when creating the pool
- BOOL mReleasePoolFlag ; //if set, mPool is destroyed when LLAPRPool is deleted. default value is true.
-};
-
-//
-//volatile LL apr_pool
-//which clears memory automatically.
-//so it can not hold static data or data after memory is cleared
-//
-class LLVolatileAPRPool : public LLAPRPool
-{
-public:
- LLVolatileAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE);
- ~LLVolatileAPRPool(){}
-
- apr_pool_t* getVolatileAPRPool() ;
-
- void clearVolatileAPRPool() ;
-
- BOOL isFull() ;
- BOOL isEmpty() {return !mNumActiveRef ;}
-private:
- S32 mNumActiveRef ; //number of active pointers pointing to the apr_pool.
- S32 mNumTotalRef ; //number of total pointers pointing to the apr_pool since last creating.
-} ;
-
-/**
- * @class LLScopedLock
- * @brief Small class to help lock and unlock mutexes.
- *
- * This class is used to have a stack level lock once you already have
- * an apr mutex handy. The constructor handles the lock, and the
- * destructor handles the unlock. Instances of this class are
- * <b>not</b> thread safe.
- */
-class LLScopedLock : private boost::noncopyable
-{
-public:
- /**
- * @brief Constructor which accepts a mutex, and locks it.
- *
- * @param mutex An allocated APR mutex. If you pass in NULL,
- * this wrapper will not lock.
- */
- LLScopedLock(apr_thread_mutex_t* mutex);
-
- /**
- * @brief Destructor which unlocks the mutex if still locked.
- */
- ~LLScopedLock();
-
- /**
- * @brief Check lock.
- */
- bool isLocked() const { return mLocked; }
-
- /**
- * @brief This method unlocks the mutex.
- */
- void unlock();
-
-protected:
- bool mLocked;
- apr_thread_mutex_t* mMutex;
-};
-
-template <typename Type> class LLAtomic32
-{
-public:
- LLAtomic32<Type>() {};
- LLAtomic32<Type>(Type x) {apr_atomic_set32(&mData, apr_uint32_t(x)); };
- ~LLAtomic32<Type>() {};
-
- operator const Type() { apr_uint32_t data = apr_atomic_read32(&mData); return Type(data); }
- Type operator =(const Type& x) { apr_atomic_set32(&mData, apr_uint32_t(x)); return Type(mData); }
- void operator -=(Type x) { apr_atomic_sub32(&mData, apr_uint32_t(x)); }
- void operator +=(Type x) { apr_atomic_add32(&mData, apr_uint32_t(x)); }
- Type operator ++(int) { return apr_atomic_inc32(&mData); } // Type++
- Type operator --(int) { return apr_atomic_dec32(&mData); } // Type--
-
-private:
- apr_uint32_t mData;
-};
-
-typedef LLAtomic32<U32> LLAtomicU32;
-typedef LLAtomic32<S32> LLAtomicS32;
-
-// File IO convenience functions.
-// Returns NULL if the file fails to openm sets *sizep to file size of not NULL
-// abbreviated flags
-#define LL_APR_R (APR_READ) // "r"
-#define LL_APR_W (APR_CREATE|APR_TRUNCATE|APR_WRITE) // "w"
-#define LL_APR_RB (APR_READ|APR_BINARY) // "rb"
-#define LL_APR_WB (APR_CREATE|APR_TRUNCATE|APR_WRITE|APR_BINARY) // "wb"
-#define LL_APR_RPB (APR_READ|APR_WRITE|APR_BINARY) // "r+b"
-#define LL_APR_WPB (APR_CREATE|APR_TRUNCATE|APR_READ|APR_WRITE|APR_BINARY) // "w+b"
-
-//
-//apr_file manager
-//which: 1)only keeps one file open;
-// 2)closes the open file in the destruction function
-// 3)informs the apr_pool to clean the memory when the file is closed.
-//Note: please close an open file at the earliest convenience.
-// especially do not put some time-costly operations between open() and close().
-// otherwise it might lock the APRFilePool.
-//there are two different apr_pools the APRFile can use:
-// 1, a temperary pool passed to an APRFile function, which is used within this function and only once.
-// 2, a global pool.
-//
-class LLAPRFile
-{
-private:
- apr_file_t* mFile ;
- LLVolatileAPRPool *mCurrentFilePoolp ; //currently in use apr_pool, could be one of them: sAPRFilePoolp, or a temp pool.
-
-public:
- LLAPRFile() ;
- ~LLAPRFile() ;
-
- apr_status_t open(LLVolatileAPRPool* pool, const std::string& filename, apr_int32_t flags, S32* sizep = NULL);
- apr_status_t open(const std::string& filename, apr_int32_t flags, apr_pool_t* pool = NULL, S32* sizep = NULL);
- apr_status_t close() ;
-
- // Returns actual offset, -1 if seek fails
- S32 seek(apr_seek_where_t where, S32 offset);
- apr_status_t eof() { return apr_file_eof(mFile);}
-
- // Returns bytes read/written, 0 if read/write fails:
- S32 read(void* buf, S32 nbytes);
- S32 write(const void* buf, S32 nbytes);
-
- apr_file_t* getFileHandle() {return mFile;}
-
-private:
- apr_pool_t* getAPRFilePool(apr_pool_t* pool) ;
-
-//
-//*******************************************************************************************************************************
-//static components
-//
-public:
- static LLVolatileAPRPool *sAPRFilePoolp ; //a global apr_pool for APRFile, which is used only when local pool does not exist.
-
-private:
- static apr_file_t* open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags);
- static apr_status_t close(apr_file_t* file, LLVolatileAPRPool* pool) ;
- static S32 seek(apr_file_t* file, apr_seek_where_t where, S32 offset);
-public:
- // returns false if failure:
- static bool remove(const std::string& filename, LLVolatileAPRPool* pool = NULL);
- static bool rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool = NULL);
- static bool isExist(const std::string& filename, LLVolatileAPRPool* pool = NULL, apr_int32_t flags = APR_READ);
- static S32 size(const std::string& filename, LLVolatileAPRPool* pool = NULL);
- static bool makeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL);
- static bool removeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL);
-
- // Returns bytes read/written, 0 if read/write fails:
- static S32 readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL);
- static S32 writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL);
-//*******************************************************************************************************************************
-};
-
-/**
- * @brief Function which approprately logs error or remains quiet on
- * APR_SUCCESS.
- * @return Returns <code>true</code> if status is an error condition.
- */
-bool ll_apr_warn_status(apr_status_t status);
-
-void ll_apr_assert_status(apr_status_t status);
-
-extern "C" apr_pool_t* gAPRPoolp; // Global APR memory pool
-
-#endif // LL_LLAPR_H
+/**
+ * @file llapr.h
+ * @author Phoenix
+ * @date 2004-11-28
+ * @brief Helper functions for using the apache portable runtime library.
+ *
+ * $LicenseInfo:firstyear=2004&license=viewergpl$
+ *
+ * Copyright (c) 2004-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLAPR_H
+#define LL_LLAPR_H
+
+#if LL_LINUX || LL_SOLARIS
+#include <sys/param.h> // Need PATH_MAX in APR headers...
+#endif
+
+#include <boost/noncopyable.hpp>
+
+#include "apr_thread_proc.h"
+#include "apr_thread_mutex.h"
+#include "apr_getopt.h"
+#include "apr_signal.h"
+#include "apr_atomic.h"
+#include "llstring.h"
+
+extern LL_COMMON_API apr_thread_mutex_t* gLogMutexp;
+extern apr_thread_mutex_t* gCallStacksLogMutexp;
+
+/**
+ * @brief initialize the common apr constructs -- apr itself, the
+ * global pool, and a mutex.
+ */
+void LL_COMMON_API ll_init_apr();
+
+/**
+ * @brief Cleanup those common apr constructs.
+ */
+void LL_COMMON_API ll_cleanup_apr();
+
+//
+//LL apr_pool
+//manage apr_pool_t, destroy allocated apr_pool in the destruction function.
+//
+class LL_COMMON_API LLAPRPool
+{
+public:
+ LLAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE) ;
+ ~LLAPRPool() ;
+
+ apr_pool_t* getAPRPool() ;
+ apr_status_t getStatus() {return mStatus ; }
+
+protected:
+ void releaseAPRPool() ;
+ void createAPRPool() ;
+
+protected:
+ apr_pool_t* mPool ; //pointing to an apr_pool
+ apr_pool_t* mParent ; //parent pool
+ apr_size_t mMaxSize ; //max size of mPool, mPool should return memory to system if allocated memory beyond this limit. However it seems not to work.
+ apr_status_t mStatus ; //status when creating the pool
+ BOOL mReleasePoolFlag ; //if set, mPool is destroyed when LLAPRPool is deleted. default value is true.
+};
+
+//
+//volatile LL apr_pool
+//which clears memory automatically.
+//so it can not hold static data or data after memory is cleared
+//
+class LL_COMMON_API LLVolatileAPRPool : public LLAPRPool
+{
+public:
+ LLVolatileAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE);
+ ~LLVolatileAPRPool(){}
+
+ apr_pool_t* getVolatileAPRPool() ;
+
+ void clearVolatileAPRPool() ;
+
+ BOOL isFull() ;
+ BOOL isEmpty() {return !mNumActiveRef ;}
+private:
+ S32 mNumActiveRef ; //number of active pointers pointing to the apr_pool.
+ S32 mNumTotalRef ; //number of total pointers pointing to the apr_pool since last creating.
+} ;
+
+/**
+ * @class LLScopedLock
+ * @brief Small class to help lock and unlock mutexes.
+ *
+ * This class is used to have a stack level lock once you already have
+ * an apr mutex handy. The constructor handles the lock, and the
+ * destructor handles the unlock. Instances of this class are
+ * <b>not</b> thread safe.
+ */
+class LL_COMMON_API LLScopedLock : private boost::noncopyable
+{
+public:
+ /**
+ * @brief Constructor which accepts a mutex, and locks it.
+ *
+ * @param mutex An allocated APR mutex. If you pass in NULL,
+ * this wrapper will not lock.
+ */
+ LLScopedLock(apr_thread_mutex_t* mutex);
+
+ /**
+ * @brief Destructor which unlocks the mutex if still locked.
+ */
+ ~LLScopedLock();
+
+ /**
+ * @brief Check lock.
+ */
+ bool isLocked() const { return mLocked; }
+
+ /**
+ * @brief This method unlocks the mutex.
+ */
+ void unlock();
+
+protected:
+ bool mLocked;
+ apr_thread_mutex_t* mMutex;
+};
+
+template <typename Type> class LLAtomic32
+{
+public:
+ LLAtomic32<Type>() {};
+ LLAtomic32<Type>(Type x) {apr_atomic_set32(&mData, apr_uint32_t(x)); };
+ ~LLAtomic32<Type>() {};
+
+ operator const Type() { apr_uint32_t data = apr_atomic_read32(&mData); return Type(data); }
+ Type operator =(const Type& x) { apr_atomic_set32(&mData, apr_uint32_t(x)); return Type(mData); }
+ void operator -=(Type x) { apr_atomic_sub32(&mData, apr_uint32_t(x)); }
+ void operator +=(Type x) { apr_atomic_add32(&mData, apr_uint32_t(x)); }
+ Type operator ++(int) { return apr_atomic_inc32(&mData); } // Type++
+ Type operator --(int) { return apr_atomic_dec32(&mData); } // Type--
+
+private:
+ apr_uint32_t mData;
+};
+
+typedef LLAtomic32<U32> LLAtomicU32;
+typedef LLAtomic32<S32> LLAtomicS32;
+
+// File IO convenience functions.
+// Returns NULL if the file fails to openm sets *sizep to file size of not NULL
+// abbreviated flags
+#define LL_APR_R (APR_READ) // "r"
+#define LL_APR_W (APR_CREATE|APR_TRUNCATE|APR_WRITE) // "w"
+#define LL_APR_RB (APR_READ|APR_BINARY) // "rb"
+#define LL_APR_WB (APR_CREATE|APR_TRUNCATE|APR_WRITE|APR_BINARY) // "wb"
+#define LL_APR_RPB (APR_READ|APR_WRITE|APR_BINARY) // "r+b"
+#define LL_APR_WPB (APR_CREATE|APR_TRUNCATE|APR_READ|APR_WRITE|APR_BINARY) // "w+b"
+
+//
+//apr_file manager
+//which: 1)only keeps one file open;
+// 2)closes the open file in the destruction function
+// 3)informs the apr_pool to clean the memory when the file is closed.
+//Note: please close an open file at the earliest convenience.
+// especially do not put some time-costly operations between open() and close().
+// otherwise it might lock the APRFilePool.
+//there are two different apr_pools the APRFile can use:
+// 1, a temperary pool passed to an APRFile function, which is used within this function and only once.
+// 2, a global pool.
+//
+class LL_COMMON_API LLAPRFile
+{
+private:
+ apr_file_t* mFile ;
+ LLVolatileAPRPool *mCurrentFilePoolp ; //currently in use apr_pool, could be one of them: sAPRFilePoolp, or a temp pool.
+
+public:
+ LLAPRFile() ;
+ ~LLAPRFile() ;
+
+ apr_status_t open(LLVolatileAPRPool* pool, const std::string& filename, apr_int32_t flags, S32* sizep = NULL);
+ apr_status_t open(const std::string& filename, apr_int32_t flags, apr_pool_t* pool = NULL, S32* sizep = NULL);
+ apr_status_t close() ;
+
+ // Returns actual offset, -1 if seek fails
+ S32 seek(apr_seek_where_t where, S32 offset);
+ apr_status_t eof() { return apr_file_eof(mFile);}
+
+ // Returns bytes read/written, 0 if read/write fails:
+ S32 read(void* buf, S32 nbytes);
+ S32 write(const void* buf, S32 nbytes);
+
+ apr_file_t* getFileHandle() {return mFile;}
+
+private:
+ apr_pool_t* getAPRFilePool(apr_pool_t* pool) ;
+
+//
+//*******************************************************************************************************************************
+//static components
+//
+public:
+ static LLVolatileAPRPool *sAPRFilePoolp ; //a global apr_pool for APRFile, which is used only when local pool does not exist.
+
+private:
+ static apr_file_t* open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags);
+ static apr_status_t close(apr_file_t* file, LLVolatileAPRPool* pool) ;
+ static S32 seek(apr_file_t* file, apr_seek_where_t where, S32 offset);
+public:
+ // returns false if failure:
+ static bool remove(const std::string& filename, LLVolatileAPRPool* pool = NULL);
+ static bool rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool = NULL);
+ static bool isExist(const std::string& filename, LLVolatileAPRPool* pool = NULL, apr_int32_t flags = APR_READ);
+ static S32 size(const std::string& filename, LLVolatileAPRPool* pool = NULL);
+ static bool makeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL);
+ static bool removeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL);
+
+ // Returns bytes read/written, 0 if read/write fails:
+ static S32 readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL);
+ static S32 writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL);
+//*******************************************************************************************************************************
+};
+
+/**
+ * @brief Function which approprately logs error or remains quiet on
+ * APR_SUCCESS.
+ * @return Returns <code>true</code> if status is an error condition.
+ */
+bool LL_COMMON_API ll_apr_warn_status(apr_status_t status);
+
+void LL_COMMON_API ll_apr_assert_status(apr_status_t status);
+
+extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool
+
+#endif // LL_LLAPR_H
diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h
index 880b7a19b5..33705cd2b1 100644
--- a/indra/llcommon/llassettype.h
+++ b/indra/llcommon/llassettype.h
@@ -1,205 +1,205 @@
-/**
- * @file llassettype.h
- * @brief Declaration of LLAssetType.
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-#ifndef LL_LLASSETTYPE_H
-#define LL_LLASSETTYPE_H
-
-#include <string>
-
-#include "stdenums.h" // for EDragAndDropType
-
-class LLAssetType
-{
-public:
- enum EType
- {
- AT_TEXTURE = 0,
- // Used for painting the faces of geometry.
- // Stored in typical j2c stream format.
-
- AT_SOUND = 1,
- // Used to fill the aural spectrum.
-
- AT_CALLINGCARD = 2,
- // Links instant message access to the user on the card.
- // : E.G. A card for yourself, for linden support, for
- // : the guy you were talking to in the coliseum.
-
- AT_LANDMARK = 3,
- // Links to places in the world with location and a screen shot or image saved.
- // : E.G. Home, linden headquarters, the coliseum, destinations where
- // : we want to increase traffic.
-
- AT_SCRIPT = 4,
- // Valid scripts that can be attached to an object.
- // : E.G. Open a door, jump into the air.
-
- AT_CLOTHING = 5,
- // A collection of textures and parameters that can be worn by an avatar.
-
- AT_OBJECT = 6,
- // Any combination of textures, sounds, and scripts that are
- // associated with a fixed piece of geometry.
- // : E.G. A hot tub, a house with working door.
-
- AT_NOTECARD = 7,
- // Just text.
-
- AT_CATEGORY = 8,
- // Holds a collection of inventory items.
- // It's treated as an item in the inventory and therefore needs a type.
-
- AT_ROOT_CATEGORY = 9,
- // A user's root inventory category.
- // We decided to expose it visually, so it seems logical to fold
- // it into the asset types.
-
- AT_LSL_TEXT = 10,
- AT_LSL_BYTECODE = 11,
- // The LSL is the scripting language.
- // We've split it into a text and bytecode representation.
-
- AT_TEXTURE_TGA = 12,
- // Uncompressed TGA texture.
-
- AT_BODYPART = 13,
- // A collection of textures and parameters that can be worn by an avatar.
-
- AT_TRASH = 14,
- // Only to be used as a marker for a category preferred type.
- // Using this, we can throw things in the trash before completely deleting.
-
- AT_SNAPSHOT_CATEGORY = 15,
- // A marker for a folder meant for snapshots.
- // No actual assets will be snapshots, though if there were, you
- // could interpret them as textures.
-
- AT_LOST_AND_FOUND = 16,
- // Used to stuff lost&found items into.
-
- AT_SOUND_WAV = 17,
- // Uncompressed sound.
-
- AT_IMAGE_TGA = 18,
- // Uncompressed image, non-square.
- // Not appropriate for use as a texture.
-
- AT_IMAGE_JPEG = 19,
- // Compressed image, non-square.
- // Not appropriate for use as a texture.
-
- AT_ANIMATION = 20,
- // Animation.
-
- AT_GESTURE = 21,
- // Gesture, sequence of animations, sounds, chat, wait steps.
-
- AT_SIMSTATE = 22,
- // Simstate file.
-
- AT_FAVORITE = 23,
- // favorite items
-
- AT_LINK = 24,
- // Inventory symbolic link
-
- AT_LINK_FOLDER = 25,
- // Inventory folder link
-
- AT_FOLDER_ENSEMBLE_START = 26,
- AT_FOLDER_ENSEMBLE_END = 45,
- // This range is reserved for special clothing folder types.
-
- AT_CURRENT_OUTFIT = 46,
- // Current outfit
-
- AT_OUTFIT = 47,
- // Predefined outfit ("look")
-
- AT_MY_OUTFITS = 48,
- // Folder that holds your outfits.
-
-
- AT_COUNT = 49,
-
- // +*********************************************************+
- // | TO ADD AN ELEMENT TO THIS ENUM: |
- // +*********************************************************+
- // | 1. INSERT BEFORE AT_COUNT |
- // | 2. INCREMENT AT_COUNT BY 1 |
- // | 3. ADD TO LLAssetDictionary in LLAssetType.cpp |
- // | 3. ADD TO DEFAULT_ASSET_FOR_INV in LLInventoryType.cpp |
- // +*********************************************************+
-
- AT_NONE = -1
- };
-
- // machine transation between type and strings
- static EType lookup(const char* name); // safe conversion to std::string, *TODO: deprecate
- static EType lookup(const std::string& type_name);
- static const char* lookup(EType asset_type);
-
- // translation from a type to a human readable form.
- static EType lookupHumanReadable(const char* desc_name); // safe conversion to std::string, *TODO: deprecate
- static EType lookupHumanReadable(const std::string& readable_name);
- static const char* lookupHumanReadable(EType asset_type);
-
- // Generate a good default description. You may want to add a verb
- // or agent name after this depending on your application.
- static void generateDescriptionFor(LLAssetType::EType asset_type,
- std::string& description);
-
- static EType getType(const std::string& desc_name);
- static const std::string& getDesc(EType asset_type);
- static EDragAndDropType lookupDragAndDropType(EType asset_type);
-
- static bool lookupCanLink(EType asset_type);
- static bool lookupIsLinkType(EType asset_type);
-
- static const char* lookupCategoryName(EType asset_type);
- static bool lookupIsProtectedCategoryType(EType asset_type);
- static bool lookupIsEnsembleCategoryType(EType asset_type);
-
- /* TODO: Change return types from "const char *" to "const std::string &".
- This is fairly straightforward, but requires changing some calls to use .c_str().
- e.g.:
- - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
- + fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType).c_str());
- */
-
-private:
- // don't instantiate or derive one of these objects
- LLAssetType( void ) {}
- ~LLAssetType( void ) {}
-};
-
-#endif // LL_LLASSETTYPE_H
+/**
+ * @file llassettype.h
+ * @brief Declaration of LLAssetType.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLASSETTYPE_H
+#define LL_LLASSETTYPE_H
+
+#include <string>
+
+#include "stdenums.h" // for EDragAndDropType
+
+class LL_COMMON_API LLAssetType
+{
+public:
+ enum EType
+ {
+ AT_TEXTURE = 0,
+ // Used for painting the faces of geometry.
+ // Stored in typical j2c stream format.
+
+ AT_SOUND = 1,
+ // Used to fill the aural spectrum.
+
+ AT_CALLINGCARD = 2,
+ // Links instant message access to the user on the card.
+ // : E.G. A card for yourself, for linden support, for
+ // : the guy you were talking to in the coliseum.
+
+ AT_LANDMARK = 3,
+ // Links to places in the world with location and a screen shot or image saved.
+ // : E.G. Home, linden headquarters, the coliseum, destinations where
+ // : we want to increase traffic.
+
+ AT_SCRIPT = 4,
+ // Valid scripts that can be attached to an object.
+ // : E.G. Open a door, jump into the air.
+
+ AT_CLOTHING = 5,
+ // A collection of textures and parameters that can be worn by an avatar.
+
+ AT_OBJECT = 6,
+ // Any combination of textures, sounds, and scripts that are
+ // associated with a fixed piece of geometry.
+ // : E.G. A hot tub, a house with working door.
+
+ AT_NOTECARD = 7,
+ // Just text.
+
+ AT_CATEGORY = 8,
+ // Holds a collection of inventory items.
+ // It's treated as an item in the inventory and therefore needs a type.
+
+ AT_ROOT_CATEGORY = 9,
+ // A user's root inventory category.
+ // We decided to expose it visually, so it seems logical to fold
+ // it into the asset types.
+
+ AT_LSL_TEXT = 10,
+ AT_LSL_BYTECODE = 11,
+ // The LSL is the scripting language.
+ // We've split it into a text and bytecode representation.
+
+ AT_TEXTURE_TGA = 12,
+ // Uncompressed TGA texture.
+
+ AT_BODYPART = 13,
+ // A collection of textures and parameters that can be worn by an avatar.
+
+ AT_TRASH = 14,
+ // Only to be used as a marker for a category preferred type.
+ // Using this, we can throw things in the trash before completely deleting.
+
+ AT_SNAPSHOT_CATEGORY = 15,
+ // A marker for a folder meant for snapshots.
+ // No actual assets will be snapshots, though if there were, you
+ // could interpret them as textures.
+
+ AT_LOST_AND_FOUND = 16,
+ // Used to stuff lost&found items into.
+
+ AT_SOUND_WAV = 17,
+ // Uncompressed sound.
+
+ AT_IMAGE_TGA = 18,
+ // Uncompressed image, non-square.
+ // Not appropriate for use as a texture.
+
+ AT_IMAGE_JPEG = 19,
+ // Compressed image, non-square.
+ // Not appropriate for use as a texture.
+
+ AT_ANIMATION = 20,
+ // Animation.
+
+ AT_GESTURE = 21,
+ // Gesture, sequence of animations, sounds, chat, wait steps.
+
+ AT_SIMSTATE = 22,
+ // Simstate file.
+
+ AT_FAVORITE = 23,
+ // favorite items
+
+ AT_LINK = 24,
+ // Inventory symbolic link
+
+ AT_LINK_FOLDER = 25,
+ // Inventory folder link
+
+ AT_FOLDER_ENSEMBLE_START = 26,
+ AT_FOLDER_ENSEMBLE_END = 45,
+ // This range is reserved for special clothing folder types.
+
+ AT_CURRENT_OUTFIT = 46,
+ // Current outfit
+
+ AT_OUTFIT = 47,
+ // Predefined outfit ("look")
+
+ AT_MY_OUTFITS = 48,
+ // Folder that holds your outfits.
+
+
+ AT_COUNT = 49,
+
+ // +*********************************************************+
+ // | TO ADD AN ELEMENT TO THIS ENUM: |
+ // +*********************************************************+
+ // | 1. INSERT BEFORE AT_COUNT |
+ // | 2. INCREMENT AT_COUNT BY 1 |
+ // | 3. ADD TO LLAssetDictionary in LLAssetType.cpp |
+ // | 3. ADD TO DEFAULT_ASSET_FOR_INV in LLInventoryType.cpp |
+ // +*********************************************************+
+
+ AT_NONE = -1
+ };
+
+ // machine transation between type and strings
+ static EType lookup(const char* name); // safe conversion to std::string, *TODO: deprecate
+ static EType lookup(const std::string& type_name);
+ static const char* lookup(EType asset_type);
+
+ // translation from a type to a human readable form.
+ static EType lookupHumanReadable(const char* desc_name); // safe conversion to std::string, *TODO: deprecate
+ static EType lookupHumanReadable(const std::string& readable_name);
+ static const char* lookupHumanReadable(EType asset_type);
+
+ // Generate a good default description. You may want to add a verb
+ // or agent name after this depending on your application.
+ static void generateDescriptionFor(LLAssetType::EType asset_type,
+ std::string& description);
+
+ static EType getType(const std::string& desc_name);
+ static const std::string& getDesc(EType asset_type);
+ static EDragAndDropType lookupDragAndDropType(EType asset_type);
+
+ static bool lookupCanLink(EType asset_type);
+ static bool lookupIsLinkType(EType asset_type);
+
+ static const char* lookupCategoryName(EType asset_type);
+ static bool lookupIsProtectedCategoryType(EType asset_type);
+ static bool lookupIsEnsembleCategoryType(EType asset_type);
+
+ /* TODO: Change return types from "const char *" to "const std::string &".
+ This is fairly straightforward, but requires changing some calls to use .c_str().
+ e.g.:
+ - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
+ + fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType).c_str());
+ */
+
+private:
+ // don't instantiate or derive one of these objects
+ LLAssetType( void ) {}
+ ~LLAssetType( void ) {}
+};
+
+#endif // LL_LLASSETTYPE_H
diff --git a/indra/llcommon/llbase32.h b/indra/llcommon/llbase32.h
index 63a93e11ab..0697f7b8e2 100644
--- a/indra/llcommon/llbase32.h
+++ b/indra/llcommon/llbase32.h
@@ -32,9 +32,9 @@
*/
#ifndef LLBASE32_H
-#define LLBASE32_h
+#define LLBASE32_H
-class LLBase32
+class LL_COMMON_API LLBase32
{
public:
static std::string encode(const U8* input, size_t input_size);
diff --git a/indra/llcommon/llbase64.h b/indra/llcommon/llbase64.h
index 58414bba8b..c48fea2478 100644
--- a/indra/llcommon/llbase64.h
+++ b/indra/llcommon/llbase64.h
@@ -32,9 +32,9 @@
*/
#ifndef LLBASE64_H
-#define LLBASE64_h
+#define LLBASE64_H
-class LLBase64
+class LL_COMMON_API LLBase64
{
public:
static std::string encode(const U8* input, size_t input_size);
diff --git a/indra/llcommon/llcommon.h b/indra/llcommon/llcommon.h
index a1808e8a6c..b36471f9f8 100644
--- a/indra/llcommon/llcommon.h
+++ b/indra/llcommon/llcommon.h
@@ -37,7 +37,7 @@
#include "lltimer.h"
#include "llfile.h"
-class LLCommon
+class LL_COMMON_API LLCommon
{
public:
static void initClass();
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
new file mode 100644
index 0000000000..5d23e1d284
--- /dev/null
+++ b/indra/llcommon/llcoros.cpp
@@ -0,0 +1,118 @@
+/**
+ * @file llcoros.cpp
+ * @author Nat Goodspeed
+ * @date 2009-06-03
+ * @brief Implementation for llcoros.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "llcoros.h"
+// STL headers
+// std headers
+// external library headers
+#include <boost/bind.hpp>
+// other Linden headers
+#include "llevents.h"
+#include "llerror.h"
+#include "stringize.h"
+
+LLCoros::LLCoros()
+{
+ // Register our cleanup() method for "mainloop" ticks
+ LLEventPumps::instance().obtain("mainloop").listen(
+ "LLCoros", boost::bind(&LLCoros::cleanup, this, _1));
+}
+
+bool LLCoros::cleanup(const LLSD&)
+{
+ // Walk the mCoros map, checking and removing completed coroutines.
+ for (CoroMap::iterator mi(mCoros.begin()), mend(mCoros.end()); mi != mend; )
+ {
+ // Has this coroutine exited (normal return, exception, exit() call)
+ // since last tick?
+ if (mi->second->exited())
+ {
+ LL_INFOS("LLCoros") << "LLCoros: cleaning up coroutine " << mi->first << LL_ENDL;
+ // The erase() call will invalidate its passed iterator value --
+ // so increment mi FIRST -- but pass its original value to
+ // erase(). This is what postincrement is all about.
+ mCoros.erase(mi++);
+ }
+ else
+ {
+ // Still live, just skip this entry as if incrementing at the top
+ // of the loop as usual.
+ ++mi;
+ }
+ }
+ return false;
+}
+
+std::string LLCoros::launchImpl(const std::string& prefix, coro* newCoro)
+{
+ std::string name(generateDistinctName(prefix));
+ mCoros.insert(name, newCoro);
+ /* Run the coroutine until its first wait, then return here */
+ (*newCoro)(std::nothrow);
+ return name;
+}
+
+std::string LLCoros::generateDistinctName(const std::string& prefix) const
+{
+ // Allowing empty name would make getName()'s not-found return ambiguous.
+ if (prefix.empty())
+ {
+ LL_ERRS("LLCoros") << "LLCoros::launch(): pass non-empty name string" << LL_ENDL;
+ }
+
+ // If the specified name isn't already in the map, just use that.
+ std::string name(prefix);
+
+ // Find the lowest numeric suffix that doesn't collide with an existing
+ // entry. Start with 2 just to make it more intuitive for any interested
+ // parties: e.g. "joe", "joe2", "joe3"...
+ for (int i = 2; ; name = STRINGIZE(prefix << i++))
+ {
+ if (mCoros.find(name) == mCoros.end())
+ {
+ LL_INFOS("LLCoros") << "LLCoros: launching coroutine " << name << LL_ENDL;
+ return name;
+ }
+ }
+}
+
+bool LLCoros::kill(const std::string& name)
+{
+ CoroMap::iterator found = mCoros.find(name);
+ if (found == mCoros.end())
+ {
+ return false;
+ }
+ // Because this is a boost::ptr_map, erasing the map entry also destroys
+ // the referenced heap object, in this case the boost::coroutine object,
+ // which will terminate the coroutine.
+ mCoros.erase(found);
+ return true;
+}
+
+std::string LLCoros::getNameByID(const void* self_id) const
+{
+ // Walk the existing coroutines, looking for one from which the 'self_id'
+ // passed to us comes.
+ for (CoroMap::const_iterator mi(mCoros.begin()), mend(mCoros.end()); mi != mend; ++mi)
+ {
+ namespace coro_private = boost::coroutines::detail;
+ if (static_cast<void*>(coro_private::coroutine_accessor::get_impl(const_cast<coro&>(*mi->second)).get())
+ == self_id)
+ {
+ return mi->first;
+ }
+ }
+ return "";
+}
diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h
new file mode 100644
index 0000000000..6c5fa5af6d
--- /dev/null
+++ b/indra/llcommon/llcoros.h
@@ -0,0 +1,149 @@
+/**
+ * @file llcoros.h
+ * @author Nat Goodspeed
+ * @date 2009-06-02
+ * @brief Manage running boost::coroutine instances
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLCOROS_H)
+#define LL_LLCOROS_H
+
+#include <boost/coroutine/coroutine.hpp>
+#include "llsingleton.h"
+#include <boost/ptr_container/ptr_map.hpp>
+#include <string>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
+#include <stdexcept>
+
+/**
+ * Registry of named Boost.Coroutine instances
+ *
+ * The Boost.Coroutine library supports the general case of a coroutine
+ * accepting arbitrary parameters and yielding multiple (sets of) results. For
+ * such use cases, it's natural for the invoking code to retain the coroutine
+ * instance: the consumer repeatedly calls into the coroutine, perhaps passing
+ * new parameter values, prompting it to yield its next result.
+ *
+ * Our typical coroutine usage is different, though. For us, coroutines
+ * provide an alternative to the @c Responder pattern. Our typical coroutine
+ * has @c void return, invoked in fire-and-forget mode: the handler for some
+ * user gesture launches the coroutine and promptly returns to the main loop.
+ * The coroutine initiates some action that will take multiple frames (e.g. a
+ * capability request), waits for its result, processes it and silently steals
+ * away.
+ *
+ * This usage poses two (related) problems:
+ *
+ * # Who should own the coroutine instance? If it's simply local to the
+ * handler code that launches it, return from the handler will destroy the
+ * coroutine object, terminating the coroutine.
+ * # Once the coroutine terminates, in whatever way, who's responsible for
+ * cleaning up the coroutine object?
+ *
+ * LLCoros is a Singleton collection of currently-active coroutine instances.
+ * Each has a name. You ask LLCoros to launch a new coroutine with a suggested
+ * name prefix; from your prefix it generates a distinct name, registers the
+ * new coroutine and returns the actual name.
+ *
+ * The name can be used to kill off the coroutine prematurely, if needed. It
+ * can also provide diagnostic info: we can look up the name of the
+ * currently-running coroutine.
+ *
+ * Finally, the next frame ("mainloop" event) after the coroutine terminates,
+ * LLCoros will notice its demise and destroy it.
+ */
+class LL_COMMON_API LLCoros: public LLSingleton<LLCoros>
+{
+public:
+ /// Canonical boost::coroutines::coroutine signature we use
+ typedef boost::coroutines::coroutine<void()> coro;
+ /// Canonical 'self' type
+ typedef coro::self self;
+
+ /**
+ * Create and start running a new coroutine with specified name. The name
+ * string you pass is a suggestion; it will be tweaked for uniqueness. The
+ * actual name is returned to you.
+ *
+ * Usage looks like this, for (e.g.) two coroutine parameters:
+ * @code
+ * class MyClass
+ * {
+ * public:
+ * ...
+ * // Do NOT NOT NOT accept reference params other than 'self'!
+ * // Pass by value only!
+ * void myCoroutineMethod(LLCoros::self& self, std::string, LLSD);
+ * ...
+ * };
+ * ...
+ * std::string name = LLCoros::instance().launch(
+ * "mycoro", boost::bind(&MyClass::myCoroutineMethod, this, _1,
+ * "somestring", LLSD(17));
+ * @endcode
+ *
+ * Your function/method must accept LLCoros::self& as its first parameter.
+ * It can accept any other parameters you want -- but ONLY BY VALUE!
+ * Other reference parameters are a BAD IDEA! You Have Been Warned. See
+ * DEV-32777 comments for an explanation.
+ *
+ * Pass a callable that accepts the single LLCoros::self& parameter. It
+ * may work to pass a free function whose only parameter is 'self'; for
+ * all other cases use boost::bind(). Of course, for a non-static class
+ * method, the first parameter must be the class instance. Use the
+ * placeholder _1 for the 'self' parameter. Any other parameters should be
+ * passed via the bind() expression.
+ *
+ * launch() tweaks the suggested name so it won't collide with any
+ * existing coroutine instance, creates the coroutine instance, registers
+ * it with the tweaked name and runs it until its first wait. At that
+ * point it returns the tweaked name.
+ */
+ template <typename CALLABLE>
+ std::string launch(const std::string& prefix, const CALLABLE& callable)
+ {
+ return launchImpl(prefix, new coro(callable));
+ }
+
+ /**
+ * Abort a running coroutine by name. Normally, when a coroutine either
+ * runs to completion or terminates with an exception, LLCoros quietly
+ * cleans it up. This is for use only when you must explicitly interrupt
+ * one prematurely. Returns @c true if the specified name was found and
+ * still running at the time.
+ */
+ bool kill(const std::string& name);
+
+ /**
+ * From within a coroutine, pass its @c self object to look up the
+ * (tweaked) name string by which this coroutine is registered. Returns
+ * the empty string if not found (e.g. if the coroutine was launched by
+ * hand rather than using LLCoros::launch()).
+ */
+ template <typename COROUTINE_SELF>
+ std::string getName(const COROUTINE_SELF& self) const
+ {
+ return getNameByID(self.get_id());
+ }
+
+ /// getName() by self.get_id()
+ std::string getNameByID(const void* self_id) const;
+
+private:
+ friend class LLSingleton<LLCoros>;
+ LLCoros();
+ std::string launchImpl(const std::string& prefix, coro* newCoro);
+ std::string generateDistinctName(const std::string& prefix) const;
+ bool cleanup(const LLSD&);
+
+ typedef boost::ptr_map<std::string, coro> CoroMap;
+ CoroMap mCoros;
+};
+
+#endif /* ! defined(LL_LLCOROS_H) */
diff --git a/indra/llcommon/llcrc.h b/indra/llcommon/llcrc.h
index 27fae7d269..74369062cc 100644
--- a/indra/llcommon/llcrc.h
+++ b/indra/llcommon/llcrc.h
@@ -50,7 +50,7 @@
// llinfos << "File crc: " << crc.getCRC() << llendl;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLCRC
+class LL_COMMON_API LLCRC
{
protected:
U32 mCurrent;
diff --git a/indra/llcommon/llcriticaldamp.h b/indra/llcommon/llcriticaldamp.h
index ad98284a6c..1ea5914b5b 100644
--- a/indra/llcommon/llcriticaldamp.h
+++ b/indra/llcommon/llcriticaldamp.h
@@ -38,7 +38,7 @@
#include "llframetimer.h"
-class LLCriticalDamp
+class LL_COMMON_API LLCriticalDamp
{
public:
LLCriticalDamp();
diff --git a/indra/llcommon/llcursortypes.h b/indra/llcommon/llcursortypes.h
index bea70351b7..836ecc3c04 100644
--- a/indra/llcommon/llcursortypes.h
+++ b/indra/llcommon/llcursortypes.h
@@ -77,6 +77,6 @@ enum ECursorType {
UI_CURSOR_COUNT // Number of elements in this enum (NOT a cursor)
};
-ECursorType getCursorFromString(const std::string& cursor_string);
+LL_COMMON_API ECursorType getCursorFromString(const std::string& cursor_string);
#endif // LL_LLCURSORTYPES_H
diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h
index 38c4c8cb60..1f14093390 100644
--- a/indra/llcommon/lldate.h
+++ b/indra/llcommon/lldate.h
@@ -46,7 +46,7 @@
*
* The date class represents a point in time after epoch - 1970-01-01.
*/
-class LLDate
+class LL_COMMON_API LLDate
{
public:
/**
@@ -155,10 +155,10 @@ private:
};
// Helper function to stream out a date
-std::ostream& operator<<(std::ostream& s, const LLDate& date);
+LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLDate& date);
// Helper function to stream in a date
-std::istream& operator>>(std::istream& s, LLDate& date);
+LL_COMMON_API std::istream& operator>>(std::istream& s, LLDate& date);
const static std::string weekdays[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h
index 82f53c6e17..e6229db834 100644
--- a/indra/llcommon/lldependencies.h
+++ b/indra/llcommon/lldependencies.h
@@ -81,7 +81,7 @@ struct instance_from_range: public TYPE
* LLDependencies components that should not be reinstantiated for each KEY,
* NODE specialization
*/
-class LLDependenciesBase
+class LL_COMMON_API LLDependenciesBase
{
public:
virtual ~LLDependenciesBase() {}
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index 6794be4904..4f68fb9f76 100644
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -131,7 +131,7 @@ namespace LLError
class CallSite;
- class Log
+ class LL_COMMON_API Log
{
public:
static bool shouldLog(CallSite&);
@@ -140,7 +140,7 @@ namespace LLError
static void flush(std::ostringstream*, const CallSite&);
};
- class CallSite
+ class LL_COMMON_API CallSite
{
// Represents a specific place in the code where a message is logged
// This is public because it is used by the macros below. It is not
@@ -189,7 +189,7 @@ namespace LLError
//LLCallStacks is designed not to be thread-safe.
//so try not to use it in multiple parallel threads at same time.
//Used in a single thread at a time is fine.
- class LLCallStacks
+ class LL_COMMON_API LLCallStacks
{
private:
static char** sBuffer ;
diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h
index fab0a1ef9f..e069232798 100644
--- a/indra/llcommon/llerrorcontrol.h
+++ b/indra/llcommon/llerrorcontrol.h
@@ -63,12 +63,12 @@ public:
namespace LLError
{
- void initForServer(const std::string& identity);
+ LL_COMMON_API void initForServer(const std::string& identity);
// resets all logging settings to defaults needed by server processes
// logs to stderr, syslog, and windows debug log
// the identity string is used for in the syslog
- void initForApplication(const std::string& dir);
+ LL_COMMON_API void initForApplication(const std::string& dir);
// resets all logging settings to defaults needed by applicaitons
// logs to stderr and windows debug log
// sets up log configuration from the file logcontrol.xml in dir
@@ -79,14 +79,14 @@ namespace LLError
Setting a level means log messages at that level or above.
*/
- void setPrintLocation(bool);
- void setDefaultLevel(LLError::ELevel);
- void setFunctionLevel(const std::string& function_name, LLError::ELevel);
- void setClassLevel(const std::string& class_name, LLError::ELevel);
- void setFileLevel(const std::string& file_name, LLError::ELevel);
+ LL_COMMON_API void setPrintLocation(bool);
+ LL_COMMON_API void setDefaultLevel(LLError::ELevel);
+ LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel);
+ LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel);
+ LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel);
void setTagLevel(const std::string& file_name, LLError::ELevel);
- void configure(const LLSD&);
+ LL_COMMON_API void configure(const LLSD&);
// the LLSD can configure all of the settings
// usually read automatically from the live errorlog.xml file
@@ -96,21 +96,21 @@ namespace LLError
*/
typedef boost::function<void(const std::string&)> FatalFunction;
- void crashAndLoop(const std::string& message);
+ LL_COMMON_API void crashAndLoop(const std::string& message);
// Default fatal function: access null pointer and loops forever
- void setFatalFunction(const FatalFunction&);
+ LL_COMMON_API void setFatalFunction(const FatalFunction&);
// The fatal function will be called when an message of LEVEL_ERROR
// is logged. Note: supressing a LEVEL_ERROR message from being logged
// (by, for example, setting a class level to LEVEL_NONE), will keep
// the that message from causing the fatal funciton to be invoked.
- FatalFunction getFatalFunction();
+ LL_COMMON_API FatalFunction getFatalFunction();
// Retrieve the previously-set FatalFunction
/// temporarily override the FatalFunction for the duration of a
/// particular scope, e.g. for unit tests
- class OverrideFatalFunction
+ class LL_COMMON_API OverrideFatalFunction
{
public:
OverrideFatalFunction(const FatalFunction& func):
@@ -128,15 +128,15 @@ namespace LLError
};
typedef std::string (*TimeFunction)();
- std::string utcTime();
+ LL_COMMON_API std::string utcTime();
- void setTimeFunction(TimeFunction);
+ LL_COMMON_API void setTimeFunction(TimeFunction);
// The function is use to return the current time, formatted for
// display by those error recorders that want the time included.
- class Recorder
+ class LL_COMMON_API Recorder
{
// An object that handles the actual output or error messages.
public:
@@ -150,17 +150,17 @@ namespace LLError
// included in the text of the message
};
- void addRecorder(Recorder*);
- void removeRecorder(Recorder*);
+ LL_COMMON_API void addRecorder(Recorder*);
+ LL_COMMON_API void removeRecorder(Recorder*);
// each error message is passed to each recorder via recordMessage()
- void logToFile(const std::string& filename);
- void logToFixedBuffer(LLLineBuffer*);
+ LL_COMMON_API void logToFile(const std::string& filename);
+ LL_COMMON_API void logToFixedBuffer(LLLineBuffer*);
// Utilities to add recorders for logging to a file or a fixed buffer
// A second call to the same function will remove the logger added
// with the first.
// Passing the empty string or NULL to just removes any prior.
- std::string logFileName();
+ LL_COMMON_API std::string logFileName();
// returns name of current logging file, empty string if none
@@ -169,11 +169,11 @@ namespace LLError
*/
class Settings;
- Settings* saveAndResetSettings();
- void restoreSettings(Settings *);
+ LL_COMMON_API Settings* saveAndResetSettings();
+ LL_COMMON_API void restoreSettings(Settings *);
- std::string abbreviateFile(const std::string& filePath);
- int shouldLogCallCount();
+ LL_COMMON_API std::string abbreviateFile(const std::string& filePath);
+ LL_COMMON_API int shouldLogCallCount();
};
diff --git a/indra/llcommon/llerrorthread.h b/indra/llcommon/llerrorthread.h
index f1d6ffc34f..3121d29675 100644
--- a/indra/llcommon/llerrorthread.h
+++ b/indra/llcommon/llerrorthread.h
@@ -35,7 +35,7 @@
#include "llthread.h"
-class LLErrorThread : public LLThread
+class LL_COMMON_API LLErrorThread : public LLThread
{
public:
LLErrorThread();
diff --git a/indra/llcommon/llevent.h b/indra/llcommon/llevent.h
index 2cc8577219..0ea7cf4ae8 100644
--- a/indra/llcommon/llevent.h
+++ b/indra/llcommon/llevent.h
@@ -47,7 +47,7 @@ class LLEventDispatcher;
class LLObservable;
// Abstract event. All events derive from LLEvent
-class LLEvent : public LLThreadSafeRefCount
+class LL_COMMON_API LLEvent : public LLThreadSafeRefCount
{
protected:
virtual ~LLEvent();
@@ -75,7 +75,7 @@ private:
};
// Abstract listener. All listeners derive from LLEventListener
-class LLEventListener : public LLThreadSafeRefCount
+class LL_COMMON_API LLEventListener : public LLThreadSafeRefCount
{
protected:
virtual ~LLEventListener();
@@ -92,7 +92,7 @@ public:
};
// A listener which tracks references to it and cleans up when it's deallocated
-class LLSimpleListener : public LLEventListener
+class LL_COMMON_API LLSimpleListener : public LLEventListener
{
public:
void clearDispatchers();
@@ -117,7 +117,7 @@ struct LLListenerEntry
// Base class for a dispatcher - an object which listens
// to events being fired and relays them to their
// appropriate destinations.
-class LLEventDispatcher : public LLThreadSafeRefCount
+class LL_COMMON_API LLEventDispatcher : public LLThreadSafeRefCount
{
protected:
virtual ~LLEventDispatcher();
@@ -160,7 +160,7 @@ private:
// In order for this class to work properly, it needs
// an instance of an LLEventDispatcher to route events to their
// listeners.
-class LLObservable
+class LL_COMMON_API LLObservable
{
public:
// Initialize with the default Dispatcher
diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp
new file mode 100644
index 0000000000..d598f1cc4a
--- /dev/null
+++ b/indra/llcommon/lleventcoro.cpp
@@ -0,0 +1,129 @@
+/**
+ * @file lleventcoro.cpp
+ * @author Nat Goodspeed
+ * @date 2009-04-29
+ * @brief Implementation for lleventcoro.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "lleventcoro.h"
+// STL headers
+#include <map>
+// std headers
+// external library headers
+// other Linden headers
+#include "llsdserialize.h"
+#include "llerror.h"
+#include "llcoros.h"
+
+std::string LLEventDetail::listenerNameForCoroImpl(const void* self_id)
+{
+ // First, if this coroutine was launched by LLCoros::launch(), find that name.
+ std::string name(LLCoros::instance().getNameByID(self_id));
+ if (! name.empty())
+ {
+ return name;
+ }
+ // Apparently this coroutine wasn't launched by LLCoros::launch(). Check
+ // whether we have a memo for this self_id.
+ typedef std::map<const void*, std::string> MapType;
+ static MapType memo;
+ MapType::const_iterator found = memo.find(self_id);
+ if (found != memo.end())
+ {
+ // this coroutine instance has called us before, reuse same name
+ return found->second;
+ }
+ // this is the first time we've been called for this coroutine instance
+ name = LLEventPump::inventName("coro");
+ memo[self_id] = name;
+ LL_INFOS("LLEventCoro") << "listenerNameForCoroImpl(" << self_id << "): inventing coro name '"
+ << name << "'" << LL_ENDL;
+ return name;
+}
+
+void LLEventDetail::storeToLLSDPath(LLSD& dest, const LLSD& rawPath, const LLSD& value)
+{
+ if (rawPath.isUndefined())
+ {
+ // no-op case
+ return;
+ }
+
+ // Arrange to treat rawPath uniformly as an array. If it's not already an
+ // array, store it as the only entry in one.
+ LLSD path;
+ if (rawPath.isArray())
+ {
+ path = rawPath;
+ }
+ else
+ {
+ path.append(rawPath);
+ }
+
+ // Need to indicate a current destination -- but that current destination
+ // needs to change as we step through the path array. Where normally we'd
+ // use an LLSD& to capture a subscripted LLSD lvalue, this time we must
+ // instead use a pointer -- since it must be reassigned.
+ LLSD* pdest = &dest;
+
+ // Now loop through that array
+ for (LLSD::Integer i = 0; i < path.size(); ++i)
+ {
+ if (path[i].isString())
+ {
+ // *pdest is an LLSD map
+ pdest = &((*pdest)[path[i].asString()]);
+ }
+ else if (path[i].isInteger())
+ {
+ // *pdest is an LLSD array
+ pdest = &((*pdest)[path[i].asInteger()]);
+ }
+ else
+ {
+ // What do we do with Real or Array or Map or ...?
+ // As it's a coder error -- not a user error -- rub the coder's
+ // face in it so it gets fixed.
+ LL_ERRS("lleventcoro") << "storeToLLSDPath(" << dest << ", " << rawPath << ", " << value
+ << "): path[" << i << "] bad type " << path[i].type() << LL_ENDL;
+ }
+ }
+
+ // Here *pdest is where we should store value.
+ *pdest = value;
+}
+
+LLSD errorException(const LLEventWithID& result, const std::string& desc)
+{
+ // If the result arrived on the error pump (pump 1), instead of
+ // returning it, deliver it via exception.
+ if (result.second)
+ {
+ throw LLErrorEvent(desc, result.first);
+ }
+ // That way, our caller knows a simple return must be from the reply
+ // pump (pump 0).
+ return result.first;
+}
+
+LLSD errorLog(const LLEventWithID& result, const std::string& desc)
+{
+ // If the result arrived on the error pump (pump 1), log it as a fatal
+ // error.
+ if (result.second)
+ {
+ LL_ERRS("errorLog") << desc << ":" << std::endl;
+ LLSDSerialize::toPrettyXML(result.first, LL_CONT);
+ LL_CONT << LL_ENDL;
+ }
+ // A simple return must therefore be from the reply pump (pump 0).
+ return result.first;
+}
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h
new file mode 100644
index 0000000000..c6d9de171d
--- /dev/null
+++ b/indra/llcommon/lleventcoro.h
@@ -0,0 +1,549 @@
+/**
+ * @file lleventcoro.h
+ * @author Nat Goodspeed
+ * @date 2009-04-29
+ * @brief Utilities to interface between coroutines and events.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLEVENTCORO_H)
+#define LL_LLEVENTCORO_H
+
+#include <boost/coroutine/coroutine.hpp>
+#include <boost/coroutine/future.hpp>
+#include <boost/optional.hpp>
+#include <string>
+#include <stdexcept>
+#include "llevents.h"
+#include "llerror.h"
+
+/**
+ * Like LLListenerOrPumpName, this is a class intended for parameter lists:
+ * accept a <tt>const LLEventPumpOrPumpName&</tt> and you can accept either an
+ * <tt>LLEventPump&</tt> or its string name. For a single parameter that could
+ * be either, it's not hard to overload the function -- but as soon as you
+ * want to accept two such parameters, this is cheaper than four overloads.
+ */
+class LLEventPumpOrPumpName
+{
+public:
+ /// Pass an actual LLEventPump&
+ LLEventPumpOrPumpName(LLEventPump& pump):
+ mPump(pump)
+ {}
+ /// Pass the string name of an LLEventPump
+ LLEventPumpOrPumpName(const std::string& pumpname):
+ mPump(LLEventPumps::instance().obtain(pumpname))
+ {}
+ /// Pass string constant name of an LLEventPump. This override must be
+ /// explicit, since otherwise passing <tt>const char*</tt> to a function
+ /// accepting <tt>const LLEventPumpOrPumpName&</tt> would require two
+ /// different implicit conversions: <tt>const char*</tt> -> <tt>const
+ /// std::string&</tt> -> <tt>const LLEventPumpOrPumpName&</tt>.
+ LLEventPumpOrPumpName(const char* pumpname):
+ mPump(LLEventPumps::instance().obtain(pumpname))
+ {}
+ /// Unspecified: "I choose not to identify an LLEventPump."
+ LLEventPumpOrPumpName() {}
+ operator LLEventPump& () const { return *mPump; }
+ LLEventPump& getPump() const { return *mPump; }
+ operator bool() const { return mPump; }
+ bool operator!() const { return ! mPump; }
+
+private:
+ boost::optional<LLEventPump&> mPump;
+};
+
+/// This is an adapter for a signature like void LISTENER(const LLSD&), which
+/// isn't a valid LLEventPump listener: such listeners should return bool.
+template <typename LISTENER>
+class LLVoidListener
+{
+public:
+ LLVoidListener(const LISTENER& listener):
+ mListener(listener)
+ {}
+ bool operator()(const LLSD& event)
+ {
+ mListener(event);
+ // don't swallow the event, let other listeners see it
+ return false;
+ }
+private:
+ LISTENER mListener;
+};
+
+/// LLVoidListener helper function to infer the type of the LISTENER
+template <typename LISTENER>
+LLVoidListener<LISTENER> voidlistener(const LISTENER& listener)
+{
+ return LLVoidListener<LISTENER>(listener);
+}
+
+namespace LLEventDetail
+{
+ /**
+ * waitForEventOn() permits a coroutine to temporarily listen on an
+ * LLEventPump any number of times. We don't really want to have to ask
+ * the caller to label each such call with a distinct string; the whole
+ * point of waitForEventOn() is to present a nice sequential interface to
+ * the underlying LLEventPump-with-named-listeners machinery. So we'll use
+ * LLEventPump::inventName() to generate a distinct name for each
+ * temporary listener. On the other hand, because a given coroutine might
+ * call waitForEventOn() any number of times, we don't really want to
+ * consume an arbitrary number of generated inventName()s: that namespace,
+ * though large, is nonetheless finite. So we memoize an invented name for
+ * each distinct coroutine instance (each different 'self' object). We
+ * can't know the type of 'self', because it depends on the coroutine
+ * body's signature. So we cast its address to void*, looking for distinct
+ * pointer values. Yes, that means that an early coroutine could cache a
+ * value here, then be destroyed, only to be supplanted by a later
+ * coroutine (of the same or different type), and we'll end up
+ * "recognizing" the second one and reusing the listener name -- but
+ * that's okay, since it won't collide with any listener name used by the
+ * earlier coroutine since that earlier coroutine no longer exists.
+ */
+ template <typename COROUTINE_SELF>
+ std::string listenerNameForCoro(COROUTINE_SELF& self)
+ {
+ return listenerNameForCoroImpl(self.get_id());
+ }
+
+ /// Implementation for listenerNameForCoro()
+ LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id);
+
+ /**
+ * Implement behavior described for postAndWait()'s @a replyPumpNamePath
+ * parameter:
+ *
+ * * If <tt>path.isUndefined()</tt>, do nothing.
+ * * If <tt>path.isString()</tt>, @a dest is an LLSD map: store @a value
+ * into <tt>dest[path.asString()]</tt>.
+ * * If <tt>path.isInteger()</tt>, @a dest is an LLSD array: store @a
+ * value into <tt>dest[path.asInteger()]</tt>.
+ * * If <tt>path.isArray()</tt>, iteratively apply the rules above to step
+ * down through the structure of @a dest. The last array entry in @a
+ * path specifies the entry in the lowest-level structure in @a dest
+ * into which to store @a value.
+ *
+ * @note
+ * In the degenerate case in which @a path is an empty array, @a dest will
+ * @em become @a value rather than @em containing it.
+ */
+ LL_COMMON_API void storeToLLSDPath(LLSD& dest, const LLSD& path, const LLSD& value);
+} // namespace LLEventDetail
+
+/**
+ * Post specified LLSD event on the specified LLEventPump, then wait for a
+ * response on specified other LLEventPump. This is more than mere
+ * convenience: the difference between this function and the sequence
+ * @code
+ * requestPump.post(myEvent);
+ * LLSD reply = waitForEventOn(self, replyPump);
+ * @endcode
+ * is that the sequence above fails if the reply is posted immediately on
+ * @a replyPump, that is, before <tt>requestPump.post()</tt> returns. In the
+ * sequence above, the running coroutine isn't even listening on @a replyPump
+ * until <tt>requestPump.post()</tt> returns and @c waitForEventOn() is
+ * entered. Therefore, the coroutine completely misses an immediate reply
+ * event, making it wait indefinitely.
+ *
+ * By contrast, postAndWait() listens on the @a replyPump @em before posting
+ * the specified LLSD event on the specified @a requestPump.
+ *
+ * @param self The @c self object passed into a coroutine
+ * @param event LLSD data to be posted on @a requestPump
+ * @param requestPump an LLEventPump on which to post @a event. Pass either
+ * the LLEventPump& or its string name. However, if you pass a
+ * default-constructed @c LLEventPumpOrPumpName, we skip the post() call.
+ * @param replyPump an LLEventPump on which postAndWait() will listen for a
+ * reply. Pass either the LLEventPump& or its string name. The calling
+ * coroutine will wait until that reply arrives. (If you're concerned about a
+ * reply that might not arrive, please see also LLEventTimeout.)
+ * @param replyPumpNamePath specifies the location within @a event in which to
+ * store <tt>replyPump.getName()</tt>. This is a strictly optional convenience
+ * feature; obviously you can store the name in @a event "by hand" if desired.
+ * @a replyPumpNamePath can be specified in any of four forms:
+ * * @c isUndefined() (default-constructed LLSD object): do nothing. This is
+ * the default behavior if you omit @a replyPumpNamePath.
+ * * @c isInteger(): @a event is an array. Store <tt>replyPump.getName()</tt>
+ * in <tt>event[replyPumpNamePath.asInteger()]</tt>.
+ * * @c isString(): @a event is a map. Store <tt>replyPump.getName()</tt> in
+ * <tt>event[replyPumpNamePath.asString()]</tt>.
+ * * @c isArray(): @a event has several levels of structure, e.g. map of
+ * maps, array of arrays, array of maps, map of arrays, ... Store
+ * <tt>replyPump.getName()</tt> in
+ * <tt>event[replyPumpNamePath[0]][replyPumpNamePath[1]]...</tt> In other
+ * words, examine each array entry in @a replyPumpNamePath in turn. If it's an
+ * <tt>LLSD::String</tt>, the current level of @a event is a map; step down to
+ * that map entry. If it's an <tt>LLSD::Integer</tt>, the current level of @a
+ * event is an array; step down to that array entry. The last array entry in
+ * @a replyPumpNamePath specifies the entry in the lowest-level structure in
+ * @a event into which to store <tt>replyPump.getName()</tt>.
+ */
+template <typename SELF>
+LLSD postAndWait(SELF& self, const LLSD& event, const LLEventPumpOrPumpName& requestPump,
+ const LLEventPumpOrPumpName& replyPump, const LLSD& replyPumpNamePath=LLSD())
+{
+ // declare the future
+ boost::coroutines::future<LLSD> future(self);
+ // make a callback that will assign a value to the future, and listen on
+ // the specified LLEventPump with that callback
+ std::string listenerName(LLEventDetail::listenerNameForCoro(self));
+ LLTempBoundListener connection(
+ replyPump.getPump().listen(listenerName,
+ voidlistener(boost::coroutines::make_callback(future))));
+ // skip the "post" part if requestPump is default-constructed
+ if (requestPump)
+ {
+ // If replyPumpNamePath is non-empty, store the replyPump name in the
+ // request event.
+ LLSD modevent(event);
+ LLEventDetail::storeToLLSDPath(modevent, replyPumpNamePath, replyPump.getPump().getName());
+ LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << listenerName
+ << " posting to " << requestPump.getPump().getName()
+ << ": " << modevent << LL_ENDL;
+ requestPump.getPump().post(modevent);
+ }
+ LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << listenerName
+ << " about to wait on LLEventPump " << replyPump.getPump().getName()
+ << LL_ENDL;
+ // trying to dereference ("resolve") the future makes us wait for it
+ LLSD value(*future);
+ LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << listenerName
+ << " resuming with " << value << LL_ENDL;
+ // returning should disconnect the connection
+ return value;
+}
+
+/// Wait for the next event on the specified LLEventPump. Pass either the
+/// LLEventPump& or its string name.
+template <typename SELF>
+LLSD waitForEventOn(SELF& self, const LLEventPumpOrPumpName& pump)
+{
+ // This is now a convenience wrapper for postAndWait().
+ return postAndWait(self, LLSD(), LLEventPumpOrPumpName(), pump);
+}
+
+/// return type for two-pump variant of waitForEventOn()
+typedef std::pair<LLSD, int> LLEventWithID;
+
+namespace LLEventDetail
+{
+ /**
+ * This helper is specifically for the two-pump version of waitForEventOn().
+ * We use a single future object, but we want to listen on two pumps with it.
+ * Since we must still adapt from (the callable constructed by)
+ * boost::coroutines::make_callback() (void return) to provide an event
+ * listener (bool return), we've adapted LLVoidListener for the purpose. The
+ * basic idea is that we construct a distinct instance of WaitForEventOnHelper
+ * -- binding different instance data -- for each of the pumps. Then, when a
+ * pump delivers an LLSD value to either WaitForEventOnHelper, it can combine
+ * that LLSD with its discriminator to feed the future object.
+ */
+ template <typename LISTENER>
+ class WaitForEventOnHelper
+ {
+ public:
+ WaitForEventOnHelper(const LISTENER& listener, int discriminator):
+ mListener(listener),
+ mDiscrim(discriminator)
+ {}
+ // this signature is required for an LLEventPump listener
+ bool operator()(const LLSD& event)
+ {
+ // our future object is defined to accept LLEventWithID
+ mListener(LLEventWithID(event, mDiscrim));
+ // don't swallow the event, let other listeners see it
+ return false;
+ }
+ private:
+ LISTENER mListener;
+ const int mDiscrim;
+ };
+
+ /// WaitForEventOnHelper type-inference helper
+ template <typename LISTENER>
+ WaitForEventOnHelper<LISTENER> wfeoh(const LISTENER& listener, int discriminator)
+ {
+ return WaitForEventOnHelper<LISTENER>(listener, discriminator);
+ }
+} // namespace LLEventDetail
+
+/**
+ * This function waits for a reply on either of two specified LLEventPumps.
+ * Otherwise, it closely resembles postAndWait(); please see the documentation
+ * for that function for detailed parameter info.
+ *
+ * While we could have implemented the single-pump variant in terms of this
+ * one, there's enough added complexity here to make it worthwhile to give the
+ * single-pump variant its own straightforward implementation. Conversely,
+ * though we could use preprocessor logic to generate n-pump overloads up to
+ * BOOST_COROUTINE_WAIT_MAX, we don't foresee a use case. This two-pump
+ * overload exists because certain event APIs are defined in terms of a reply
+ * LLEventPump and an error LLEventPump.
+ *
+ * The LLEventWithID return value provides not only the received event, but
+ * the index of the pump on which it arrived (0 or 1).
+ *
+ * @note
+ * I'd have preferred to overload the name postAndWait() for both signatures.
+ * But consider the following ambiguous call:
+ * @code
+ * postAndWait(self, LLSD(), requestPump, replyPump, "someString");
+ * @endcode
+ * "someString" could be converted to either LLSD (@a replyPumpNamePath for
+ * the single-pump function) or LLEventOrPumpName (@a replyPump1 for two-pump
+ * function).
+ *
+ * It seems less burdensome to write postAndWait2() than to write either
+ * LLSD("someString") or LLEventOrPumpName("someString").
+ */
+template <typename SELF>
+LLEventWithID postAndWait2(SELF& self, const LLSD& event,
+ const LLEventPumpOrPumpName& requestPump,
+ const LLEventPumpOrPumpName& replyPump0,
+ const LLEventPumpOrPumpName& replyPump1,
+ const LLSD& replyPump0NamePath=LLSD(),
+ const LLSD& replyPump1NamePath=LLSD())
+{
+ // declare the future
+ boost::coroutines::future<LLEventWithID> future(self);
+ // either callback will assign a value to this future; listen on
+ // each specified LLEventPump with a callback
+ std::string name(LLEventDetail::listenerNameForCoro(self));
+ LLTempBoundListener connection0(
+ replyPump0.getPump().listen(name + "a",
+ LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 0)));
+ LLTempBoundListener connection1(
+ replyPump1.getPump().listen(name + "b",
+ LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 1)));
+ // skip the "post" part if requestPump is default-constructed
+ if (requestPump)
+ {
+ // If either replyPumpNamePath is non-empty, store the corresponding
+ // replyPump name in the request event.
+ LLSD modevent(event);
+ LLEventDetail::storeToLLSDPath(modevent, replyPump0NamePath,
+ replyPump0.getPump().getName());
+ LLEventDetail::storeToLLSDPath(modevent, replyPump1NamePath,
+ replyPump1.getPump().getName());
+ LL_DEBUGS("lleventcoro") << "postAndWait2(): coroutine " << name
+ << " posting to " << requestPump.getPump().getName()
+ << ": " << modevent << LL_ENDL;
+ requestPump.getPump().post(modevent);
+ }
+ LL_DEBUGS("lleventcoro") << "postAndWait2(): coroutine " << name
+ << " about to wait on LLEventPumps " << replyPump0.getPump().getName()
+ << ", " << replyPump1.getPump().getName() << LL_ENDL;
+ // trying to dereference ("resolve") the future makes us wait for it
+ LLEventWithID value(*future);
+ LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << name
+ << " resuming with (" << value.first << ", " << value.second << ")"
+ << LL_ENDL;
+ // returning should disconnect both connections
+ return value;
+}
+
+/**
+ * Wait for the next event on either of two specified LLEventPumps.
+ */
+template <typename SELF>
+LLEventWithID
+waitForEventOn(SELF& self,
+ const LLEventPumpOrPumpName& pump0, const LLEventPumpOrPumpName& pump1)
+{
+ // This is now a convenience wrapper for postAndWait2().
+ return postAndWait2(self, LLSD(), LLEventPumpOrPumpName(), pump0, pump1);
+}
+
+/**
+ * Helper for the two-pump variant of waitForEventOn(), e.g.:
+ *
+ * @code
+ * LLSD reply = errorException(waitForEventOn(self, replyPump, errorPump),
+ * "error response from login.cgi");
+ * @endcode
+ *
+ * Examines an LLEventWithID, assuming that the second pump (pump 1) is
+ * listening for an error indication. If the incoming data arrived on pump 1,
+ * throw an LLErrorEvent exception. If the incoming data arrived on pump 0,
+ * just return it. Since a normal return can only be from pump 0, we no longer
+ * need the LLEventWithID's discriminator int; we can just return the LLSD.
+ *
+ * @note I'm not worried about introducing the (fairly generic) name
+ * errorException() into global namespace, because how many other overloads of
+ * the same name are going to accept an LLEventWithID parameter?
+ */
+LLSD errorException(const LLEventWithID& result, const std::string& desc);
+
+/**
+ * Exception thrown by errorException(). We don't call this LLEventError
+ * because it's not an error in event processing: rather, this exception
+ * announces an event that bears error information (for some other API).
+ */
+class LL_COMMON_API LLErrorEvent: public std::runtime_error
+{
+public:
+ LLErrorEvent(const std::string& what, const LLSD& data):
+ std::runtime_error(what),
+ mData(data)
+ {}
+ virtual ~LLErrorEvent() throw() {}
+
+ LLSD getData() const { return mData; }
+
+private:
+ LLSD mData;
+};
+
+/**
+ * Like errorException(), save that this trips a fatal error using LL_ERRS
+ * rather than throwing an exception.
+ */
+LL_COMMON_API LLSD errorLog(const LLEventWithID& result, const std::string& desc);
+
+/**
+ * Certain event APIs require the name of an LLEventPump on which they should
+ * post results. While it works to invent a distinct name and let
+ * LLEventPumps::obtain() instantiate the LLEventPump as a "named singleton,"
+ * in a certain sense it's more robust to instantiate a local LLEventPump and
+ * provide its name instead. This class packages the following idiom:
+ *
+ * 1. Instantiate a local LLCoroEventPump, with an optional name prefix.
+ * 2. Provide its actual name to the event API in question as the name of the
+ * reply LLEventPump.
+ * 3. Initiate the request to the event API.
+ * 4. Call your LLEventTempStream's wait() method to wait for the reply.
+ * 5. Let the LLCoroEventPump go out of scope.
+ */
+class LL_COMMON_API LLCoroEventPump
+{
+public:
+ LLCoroEventPump(const std::string& name="coro"):
+ mPump(name, true) // allow tweaking the pump instance name
+ {}
+ /// It's typical to request the LLEventPump name to direct an event API to
+ /// send its response to this pump.
+ std::string getName() const { return mPump.getName(); }
+ /// Less typically, we'd request the pump itself for some reason.
+ LLEventPump& getPump() { return mPump; }
+
+ /**
+ * Wait for an event on this LLEventPump.
+ *
+ * @note
+ * The other major usage pattern we considered was to bind @c self at
+ * LLCoroEventPump construction time, which would avoid passing the
+ * parameter to each wait() call. But if we were going to bind @c self as
+ * a class member, we'd need to specify a class template parameter
+ * indicating its type. The big advantage of passing it to the wait() call
+ * is that the type can be implicit.
+ */
+ template <typename SELF>
+ LLSD wait(SELF& self)
+ {
+ return waitForEventOn(self, mPump);
+ }
+
+ template <typename SELF>
+ LLSD postAndWait(SELF& self, const LLSD& event, const LLEventPumpOrPumpName& requestPump,
+ const LLSD& replyPumpNamePath=LLSD())
+ {
+ return ::postAndWait(self, event, requestPump, mPump, replyPumpNamePath);
+ }
+
+private:
+ LLEventStream mPump;
+};
+
+/**
+ * Other event APIs require the names of two different LLEventPumps: one for
+ * success response, the other for error response. Extend LLCoroEventPump
+ * for the two-pump use case.
+ */
+class LL_COMMON_API LLCoroEventPumps
+{
+public:
+ LLCoroEventPumps(const std::string& name="coro",
+ const std::string& suff0="Reply",
+ const std::string& suff1="Error"):
+ mPump0(name + suff0, true), // allow tweaking the pump instance name
+ mPump1(name + suff1, true)
+ {}
+ /// request pump 0's name
+ std::string getName0() const { return mPump0.getName(); }
+ /// request pump 1's name
+ std::string getName1() const { return mPump1.getName(); }
+ /// request both names
+ std::pair<std::string, std::string> getNames() const
+ {
+ return std::pair<std::string, std::string>(mPump0.getName(), mPump1.getName());
+ }
+
+ /// request pump 0
+ LLEventPump& getPump0() { return mPump0; }
+ /// request pump 1
+ LLEventPump& getPump1() { return mPump1; }
+
+ /// waitForEventOn(self, either of our two LLEventPumps)
+ template <typename SELF>
+ LLEventWithID wait(SELF& self)
+ {
+ return waitForEventOn(self, mPump0, mPump1);
+ }
+
+ /// errorException(wait(self))
+ template <typename SELF>
+ LLSD waitWithException(SELF& self)
+ {
+ return errorException(wait(self), std::string("Error event on ") + getName1());
+ }
+
+ /// errorLog(wait(self))
+ template <typename SELF>
+ LLSD waitWithLog(SELF& self)
+ {
+ return errorLog(wait(self), std::string("Error event on ") + getName1());
+ }
+
+ template <typename SELF>
+ LLEventWithID postAndWait(SELF& self, const LLSD& event,
+ const LLEventPumpOrPumpName& requestPump,
+ const LLSD& replyPump0NamePath=LLSD(),
+ const LLSD& replyPump1NamePath=LLSD())
+ {
+ return postAndWait2(self, event, requestPump, mPump0, mPump1,
+ replyPump0NamePath, replyPump1NamePath);
+ }
+
+ template <typename SELF>
+ LLSD postAndWaitWithException(SELF& self, const LLSD& event,
+ const LLEventPumpOrPumpName& requestPump,
+ const LLSD& replyPump0NamePath=LLSD(),
+ const LLSD& replyPump1NamePath=LLSD())
+ {
+ return errorException(postAndWait(self, event, requestPump,
+ replyPump0NamePath, replyPump1NamePath),
+ std::string("Error event on ") + getName1());
+ }
+
+ template <typename SELF>
+ LLSD postAndWaitWithLog(SELF& self, const LLSD& event,
+ const LLEventPumpOrPumpName& requestPump,
+ const LLSD& replyPump0NamePath=LLSD(),
+ const LLSD& replyPump1NamePath=LLSD())
+ {
+ return errorLog(postAndWait(self, event, requestPump,
+ replyPump0NamePath, replyPump1NamePath),
+ std::string("Error event on ") + getName1());
+ }
+
+private:
+ LLEventStream mPump0, mPump1;
+};
+
+#endif /* ! defined(LL_LLEVENTCORO_H) */
diff --git a/indra/llcommon/lleventdispatcher.cpp b/indra/llcommon/lleventdispatcher.cpp
new file mode 100644
index 0000000000..2dbd59b156
--- /dev/null
+++ b/indra/llcommon/lleventdispatcher.cpp
@@ -0,0 +1,123 @@
+/**
+ * @file lleventdispatcher.cpp
+ * @author Nat Goodspeed
+ * @date 2009-06-18
+ * @brief Implementation for lleventdispatcher.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if LL_WINDOWS
+#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
+#endif
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "lleventdispatcher.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+#include "llevents.h"
+#include "llerror.h"
+#include "llsdutil.h"
+
+LLEventDispatcher::LLEventDispatcher(const std::string& desc, const std::string& key):
+ mDesc(desc),
+ mKey(key)
+{
+}
+
+LLEventDispatcher::~LLEventDispatcher()
+{
+}
+
+/// Register a callable by name
+void LLEventDispatcher::add(const std::string& name, const Callable& callable, const LLSD& required)
+{
+ mDispatch[name] = DispatchMap::mapped_type(callable, required);
+}
+
+void LLEventDispatcher::addFail(const std::string& name, const std::string& classname) const
+{
+ LL_ERRS("LLEventDispatcher") << "LLEventDispatcher(" << mDesc << ")::add(" << name
+ << "): " << classname << " is not a subclass "
+ << "of LLEventDispatcher" << LL_ENDL;
+}
+
+/// Unregister a callable
+bool LLEventDispatcher::remove(const std::string& name)
+{
+ DispatchMap::iterator found = mDispatch.find(name);
+ if (found == mDispatch.end())
+ {
+ return false;
+ }
+ mDispatch.erase(found);
+ return true;
+}
+
+/// Call a registered callable with an explicitly-specified name. If no
+/// such callable exists, die with LL_ERRS.
+void LLEventDispatcher::operator()(const std::string& name, const LLSD& event) const
+{
+ if (! attemptCall(name, event))
+ {
+ LL_ERRS("LLEventDispatcher") << "LLEventDispatcher(" << mDesc << "): '" << name
+ << "' not found" << LL_ENDL;
+ }
+}
+
+/// Extract the @a key value from the incoming @a event, and call the
+/// callable whose name is specified by that map @a key. If no such
+/// callable exists, die with LL_ERRS.
+void LLEventDispatcher::operator()(const LLSD& event) const
+{
+ // This could/should be implemented in terms of the two-arg overload.
+ // However -- we can produce a more informative error message.
+ std::string name(event[mKey]);
+ if (! attemptCall(name, event))
+ {
+ LL_ERRS("LLEventDispatcher") << "LLEventDispatcher(" << mDesc << "): bad " << mKey
+ << " value '" << name << "'" << LL_ENDL;
+ }
+}
+
+bool LLEventDispatcher::attemptCall(const std::string& name, const LLSD& event) const
+{
+ DispatchMap::const_iterator found = mDispatch.find(name);
+ if (found == mDispatch.end())
+ {
+ // The reason we only return false, leaving it up to our caller to die
+ // with LL_ERRS, is that different callers have different amounts of
+ // available information.
+ return false;
+ }
+ // Found the name, so it's plausible to even attempt the call. But first,
+ // validate the syntax of the event itself.
+ std::string mismatch(llsd_matches(found->second.second, event));
+ if (! mismatch.empty())
+ {
+ LL_ERRS("LLEventDispatcher") << "LLEventDispatcher(" << mDesc << ") calling '" << name
+ << "': bad request: " << mismatch << LL_ENDL;
+ }
+ // Event syntax looks good, go for it!
+ (found->second.first)(event);
+ return true; // tell caller we were able to call
+}
+
+LLDispatchListener::LLDispatchListener(const std::string& pumpname, const std::string& key):
+ LLEventDispatcher(pumpname, key),
+ mPump(pumpname, true), // allow tweaking for uniqueness
+ mBoundListener(mPump.listen("self", boost::bind(&LLDispatchListener::process, this, _1)))
+{
+}
+
+bool LLDispatchListener::process(const LLSD& event)
+{
+ (*this)(event);
+ return false;
+}
diff --git a/indra/llcommon/lleventdispatcher.h b/indra/llcommon/lleventdispatcher.h
new file mode 100644
index 0000000000..ef83ebabc1
--- /dev/null
+++ b/indra/llcommon/lleventdispatcher.h
@@ -0,0 +1,126 @@
+/**
+ * @file lleventdispatcher.h
+ * @author Nat Goodspeed
+ * @date 2009-06-18
+ * @brief Central mechanism for dispatching events by string name. This is
+ * useful when you have a single LLEventPump listener on which you can
+ * request different operations, vs. instantiating a different
+ * LLEventPump for each such operation.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLEVENTDISPATCHER_H)
+#define LL_LLEVENTDISPATCHER_H
+
+#include <string>
+#include <map>
+#include <boost/function.hpp>
+#include <boost/bind.hpp>
+#include <typeinfo>
+#include "llevents.h"
+
+class LLSD;
+
+/**
+ * Given an LLSD map, examine a string-valued key and call a corresponding
+ * callable. This class is designed to be contained by an LLEventPump
+ * listener class that will register some of its own methods, though any
+ * callable can be used.
+ */
+class LL_COMMON_API LLEventDispatcher
+{
+public:
+ LLEventDispatcher(const std::string& desc, const std::string& key);
+ virtual ~LLEventDispatcher();
+
+ /// Accept any C++ callable, typically a boost::bind() expression
+ typedef boost::function<void(const LLSD&)> Callable;
+
+ /**
+ * Register a @a callable by @a name. The optional @a required parameter
+ * is used to validate the structure of each incoming event (see
+ * llsd_matches()).
+ */
+ void add(const std::string& name, const Callable& callable, const LLSD& required=LLSD());
+
+ /**
+ * Special case: a subclass of this class can pass an unbound member
+ * function pointer without explicitly specifying the
+ * <tt>boost::bind()</tt> expression.
+ */
+ template <class CLASS>
+ void add(const std::string& name, void (CLASS::*method)(const LLSD&),
+ const LLSD& required=LLSD())
+ {
+ addMethod<CLASS>(name, method, required);
+ }
+
+ /// Overload for both const and non-const methods
+ template <class CLASS>
+ void add(const std::string& name, void (CLASS::*method)(const LLSD&) const,
+ const LLSD& required=LLSD())
+ {
+ addMethod<CLASS>(name, method, required);
+ }
+
+ /// Unregister a callable
+ bool remove(const std::string& name);
+
+ /// Call a registered callable with an explicitly-specified name. If no
+ /// such callable exists, die with LL_ERRS. If the @a event fails to match
+ /// the @a required prototype specified at add() time, die with LL_ERRS.
+ void operator()(const std::string& name, const LLSD& event) const;
+
+ /// Extract the @a key value from the incoming @a event, and call the
+ /// callable whose name is specified by that map @a key. If no such
+ /// callable exists, die with LL_ERRS. If the @a event fails to match the
+ /// @a required prototype specified at add() time, die with LL_ERRS.
+ void operator()(const LLSD& event) const;
+
+private:
+ template <class CLASS, typename METHOD>
+ void addMethod(const std::string& name, const METHOD& method, const LLSD& required)
+ {
+ CLASS* downcast = dynamic_cast<CLASS*>(this);
+ if (! downcast)
+ {
+ addFail(name, typeid(CLASS).name());
+ }
+ else
+ {
+ add(name, boost::bind(method, downcast, _1), required);
+ }
+ }
+ void addFail(const std::string& name, const std::string& classname) const;
+ /// try to dispatch, return @c true if success
+ bool attemptCall(const std::string& name, const LLSD& event) const;
+
+ std::string mDesc, mKey;
+ typedef std::map<std::string, std::pair<Callable, LLSD> > DispatchMap;
+ DispatchMap mDispatch;
+};
+
+/**
+ * Bundle an LLEventPump and a listener with an LLEventDispatcher. A class
+ * that contains (or derives from) LLDispatchListener need only specify the
+ * LLEventPump name and dispatch key, and add() its methods. Incoming events
+ * will automatically be dispatched.
+ */
+class LL_COMMON_API LLDispatchListener: public LLEventDispatcher
+{
+public:
+ LLDispatchListener(const std::string& pumpname, const std::string& key);
+
+ std::string getPumpName() const { return mPump.getName(); }
+
+private:
+ bool process(const LLSD& event);
+
+ LLEventStream mPump;
+ LLTempBoundListener mBoundListener;
+};
+
+#endif /* ! defined(LL_LLEVENTDISPATCHER_H) */
diff --git a/indra/llcommon/lleventfilter.cpp b/indra/llcommon/lleventfilter.cpp
new file mode 100644
index 0000000000..74133781be
--- /dev/null
+++ b/indra/llcommon/lleventfilter.cpp
@@ -0,0 +1,149 @@
+/**
+ * @file lleventfilter.cpp
+ * @author Nat Goodspeed
+ * @date 2009-03-05
+ * @brief Implementation for lleventfilter.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "lleventfilter.h"
+// STL headers
+// std headers
+// external library headers
+#include <boost/bind.hpp>
+// other Linden headers
+#include "llerror.h" // LL_ERRS
+#include "llsdutil.h" // llsd_matches()
+
+LLEventFilter::LLEventFilter(LLEventPump& source, const std::string& name, bool tweak):
+ LLEventStream(name, tweak)
+{
+ source.listen(getName(), boost::bind(&LLEventFilter::post, this, _1));
+}
+
+LLEventMatching::LLEventMatching(const LLSD& pattern):
+ LLEventFilter("matching"),
+ mPattern(pattern)
+{
+}
+
+LLEventMatching::LLEventMatching(LLEventPump& source, const LLSD& pattern):
+ LLEventFilter(source, "matching"),
+ mPattern(pattern)
+{
+}
+
+bool LLEventMatching::post(const LLSD& event)
+{
+ if (! llsd_matches(mPattern, event).empty())
+ return false;
+
+ return LLEventStream::post(event);
+}
+
+LLEventTimeoutBase::LLEventTimeoutBase():
+ LLEventFilter("timeout")
+{
+}
+
+LLEventTimeoutBase::LLEventTimeoutBase(LLEventPump& source):
+ LLEventFilter(source, "timeout")
+{
+}
+
+void LLEventTimeoutBase::actionAfter(F32 seconds, const Action& action)
+{
+ setCountdown(seconds);
+ mAction = action;
+ if (! mMainloop.connected())
+ {
+ LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop"));
+ mMainloop = mainloop.listen(getName(), boost::bind(&LLEventTimeoutBase::tick, this, _1));
+ }
+}
+
+class ErrorAfter
+{
+public:
+ ErrorAfter(const std::string& message): mMessage(message) {}
+
+ void operator()()
+ {
+ LL_ERRS("LLEventTimeout") << mMessage << LL_ENDL;
+ }
+
+private:
+ std::string mMessage;
+};
+
+void LLEventTimeoutBase::errorAfter(F32 seconds, const std::string& message)
+{
+ actionAfter(seconds, ErrorAfter(message));
+}
+
+class EventAfter
+{
+public:
+ EventAfter(LLEventPump& pump, const LLSD& event):
+ mPump(pump),
+ mEvent(event)
+ {}
+
+ void operator()()
+ {
+ mPump.post(mEvent);
+ }
+
+private:
+ LLEventPump& mPump;
+ LLSD mEvent;
+};
+
+void LLEventTimeoutBase::eventAfter(F32 seconds, const LLSD& event)
+{
+ actionAfter(seconds, EventAfter(*this, event));
+}
+
+bool LLEventTimeoutBase::post(const LLSD& event)
+{
+ cancel();
+ return LLEventStream::post(event);
+}
+
+void LLEventTimeoutBase::cancel()
+{
+ mMainloop.disconnect();
+}
+
+bool LLEventTimeoutBase::tick(const LLSD&)
+{
+ if (countdownElapsed())
+ {
+ cancel();
+ mAction();
+ }
+ return false; // show event to other listeners
+}
+
+LLEventTimeout::LLEventTimeout() {}
+
+LLEventTimeout::LLEventTimeout(LLEventPump& source):
+ LLEventTimeoutBase(source)
+{
+}
+
+void LLEventTimeout::setCountdown(F32 seconds)
+{
+ mTimer.setTimerExpirySec(seconds);
+}
+
+bool LLEventTimeout::countdownElapsed() const
+{
+ return mTimer.hasExpired();
+}
diff --git a/indra/llcommon/lleventfilter.h b/indra/llcommon/lleventfilter.h
new file mode 100644
index 0000000000..89f0c7ea43
--- /dev/null
+++ b/indra/llcommon/lleventfilter.h
@@ -0,0 +1,186 @@
+/**
+ * @file lleventfilter.h
+ * @author Nat Goodspeed
+ * @date 2009-03-05
+ * @brief Define LLEventFilter: LLEventStream subclass with conditions
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLEVENTFILTER_H)
+#define LL_LLEVENTFILTER_H
+
+#include "llevents.h"
+#include "stdtypes.h"
+#include "lltimer.h"
+#include <boost/function.hpp>
+
+/**
+ * Generic base class
+ */
+class LL_COMMON_API LLEventFilter: public LLEventStream
+{
+public:
+ /// construct a standalone LLEventFilter
+ LLEventFilter(const std::string& name="filter", bool tweak=true):
+ LLEventStream(name, tweak)
+ {}
+ /// construct LLEventFilter and connect it to the specified LLEventPump
+ LLEventFilter(LLEventPump& source, const std::string& name="filter", bool tweak=true);
+
+ /// Post an event to all listeners
+ virtual bool post(const LLSD& event) = 0;
+};
+
+/**
+ * Pass through only events matching a specified pattern
+ */
+class LLEventMatching: public LLEventFilter
+{
+public:
+ /// Pass an LLSD map with keys and values the incoming event must match
+ LLEventMatching(const LLSD& pattern);
+ /// instantiate and connect
+ LLEventMatching(LLEventPump& source, const LLSD& pattern);
+
+ /// Only pass through events matching the pattern
+ virtual bool post(const LLSD& event);
+
+private:
+ LLSD mPattern;
+};
+
+/**
+ * Wait for an event to be posted. If no such event arrives within a specified
+ * time, take a specified action. See LLEventTimeout for production
+ * implementation.
+ *
+ * @NOTE This is an abstract base class so that, for testing, we can use an
+ * alternate "timer" that doesn't actually consume real time.
+ */
+class LL_COMMON_API LLEventTimeoutBase: public LLEventFilter
+{
+public:
+ /// construct standalone
+ LLEventTimeoutBase();
+ /// construct and connect
+ LLEventTimeoutBase(LLEventPump& source);
+
+ /// Callable, can be constructed with boost::bind()
+ typedef boost::function<void()> Action;
+
+ /**
+ * Start countdown timer for the specified number of @a seconds. Forward
+ * all events. If any event arrives before timer expires, cancel timer. If
+ * no event arrives before timer expires, take specified @a action.
+ *
+ * This is a one-shot timer. Once it has either expired or been canceled,
+ * it is inert until another call to actionAfter().
+ *
+ * Calling actionAfter() while an existing timer is running cheaply
+ * replaces that original timer. Thus, a valid use case is to detect
+ * idleness of some event source by calling actionAfter() on each new
+ * event. A rapid sequence of events will keep the timer from expiring;
+ * the first gap in events longer than the specified timer will fire the
+ * specified Action.
+ *
+ * Any post() call cancels the timer. To be satisfied with only a
+ * particular event, chain on an LLEventMatching that only passes such
+ * events:
+ *
+ * @code
+ * event ultimate
+ * source ---> LLEventMatching ---> LLEventTimeout ---> listener
+ * @endcode
+ *
+ * @NOTE
+ * The implementation relies on frequent events on the LLEventPump named
+ * "mainloop".
+ */
+ void actionAfter(F32 seconds, const Action& action);
+
+ /**
+ * Like actionAfter(), but where the desired Action is LL_ERRS
+ * termination. Pass the timeout time and the desired LL_ERRS @a message.
+ *
+ * This method is useful when, for instance, some async API guarantees an
+ * event, whether success or failure, within a stated time window.
+ * Instantiate an LLEventTimeout listening to that API and call
+ * errorAfter() on each async request with a timeout comfortably longer
+ * than the API's time guarantee (much longer than the anticipated
+ * "mainloop" granularity).
+ *
+ * Then if the async API breaks its promise, the program terminates with
+ * the specified LL_ERRS @a message. The client of the async API can
+ * therefore assume the guarantee is upheld.
+ *
+ * @NOTE
+ * errorAfter() is implemented in terms of actionAfter(), so all remarks
+ * about calling actionAfter() also apply to errorAfter().
+ */
+ void errorAfter(F32 seconds, const std::string& message);
+
+ /**
+ * Like actionAfter(), but where the desired Action is a particular event
+ * for all listeners. Pass the timeout time and the desired @a event data.
+ *
+ * Suppose the timeout should only be satisfied by a particular event, but
+ * the ultimate listener must see all other incoming events as well, plus
+ * the timeout @a event if any:
+ *
+ * @code
+ * some LLEventMatching LLEventMatching
+ * event ---> for particular ---> LLEventTimeout ---> for timeout
+ * source event event \
+ * \ \ ultimate
+ * `-----------------------------------------------------> listener
+ * @endcode
+ *
+ * Since a given listener can listen on more than one LLEventPump, we can
+ * set things up so it sees the set union of events from LLEventTimeout
+ * and the original event source. However, as LLEventTimeout passes
+ * through all incoming events, the "particular event" that satisfies the
+ * left LLEventMatching would reach the ultimate listener twice. So we add
+ * an LLEventMatching that only passes timeout events.
+ *
+ * @NOTE
+ * eventAfter() is implemented in terms of actionAfter(), so all remarks
+ * about calling actionAfter() also apply to eventAfter().
+ */
+ void eventAfter(F32 seconds, const LLSD& event);
+
+ /// Pass event through, canceling the countdown timer
+ virtual bool post(const LLSD& event);
+
+ /// Cancel timer without event
+ void cancel();
+
+protected:
+ virtual void setCountdown(F32 seconds) = 0;
+ virtual bool countdownElapsed() const = 0;
+
+private:
+ bool tick(const LLSD&);
+
+ LLBoundListener mMainloop;
+ Action mAction;
+};
+
+/// Production implementation of LLEventTimoutBase
+class LL_COMMON_API LLEventTimeout: public LLEventTimeoutBase
+{
+public:
+ LLEventTimeout();
+ LLEventTimeout(LLEventPump& source);
+
+protected:
+ virtual void setCountdown(F32 seconds);
+ virtual bool countdownElapsed() const;
+
+private:
+ LLTimer mTimer;
+};
+
+#endif /* ! defined(LL_LLEVENTFILTER_H) */
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index eb380ba7c8..aec9acc7ef 100644
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -38,6 +38,9 @@
#pragma warning (pop)
#endif
// other Linden headers
+#include "stringize.h"
+#include "llerror.h"
+#include "llsdutil.h"
/*****************************************************************************
* queue_names: specify LLEventPump names that should be instantiated as
@@ -56,14 +59,12 @@ const char* queue_names[] =
/*****************************************************************************
* If there's a "mainloop" pump, listen on that to flush all LLEventQueues
*****************************************************************************/
-struct RegisterFlush
+struct RegisterFlush : public LLEventTrackable
{
RegisterFlush():
- pumps(LLEventPumps::instance()),
- mainloop(pumps.obtain("mainloop")),
- name("flushLLEventQueues")
+ pumps(LLEventPumps::instance())
{
- mainloop.listen(name, boost::bind(&RegisterFlush::flush, this, _1));
+ pumps.obtain("mainloop").listen("flushLLEventQueues", boost::bind(&RegisterFlush::flush, this, _1));
}
bool flush(const LLSD&)
{
@@ -72,11 +73,9 @@ struct RegisterFlush
}
~RegisterFlush()
{
- mainloop.stopListening(name);
+ // LLEventTrackable handles stopListening for us.
}
LLEventPumps& pumps;
- LLEventPump& mainloop;
- const std::string name;
};
static RegisterFlush registerFlush;
@@ -256,6 +255,12 @@ LLEventPump::~LLEventPump()
// static data member
const LLEventPump::NameList LLEventPump::empty;
+std::string LLEventPump::inventName(const std::string& pfx)
+{
+ static long suffix = 0;
+ return STRINGIZE(pfx << suffix++);
+}
+
LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventListener& listener,
const NameList& after,
const NameList& before)
@@ -499,3 +504,26 @@ bool LLListenerOrPumpName::operator()(const LLSD& event) const
}
return (*mListener)(event);
}
+
+void LLReqID::stamp(LLSD& response) const
+{
+ if (! (response.isUndefined() || response.isMap()))
+ {
+ // If 'response' was previously completely empty, it's okay to
+ // turn it into a map. If it was already a map, then it should be
+ // okay to add a key. But if it was anything else (e.g. a scalar),
+ // assigning a ["reqid"] key will DISCARD the previous value,
+ // replacing it with a map. That would be Bad.
+ LL_INFOS("LLReqID") << "stamp(" << mReqid << ") leaving non-map response unmodified: "
+ << response << LL_ENDL;
+ return;
+ }
+ LLSD oldReqid(response["reqid"]);
+ if (! (oldReqid.isUndefined() || llsd_equals(oldReqid, mReqid)))
+ {
+ LL_INFOS("LLReqID") << "stamp(" << mReqid << ") preserving existing [\"reqid\"] value "
+ << oldReqid << " in response: " << response << LL_ENDL;
+ return;
+ }
+ response["reqid"] = mReqid;
+}
diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h
index 240adcdd41..b999bfafa7 100644
--- a/indra/llcommon/llevents.h
+++ b/indra/llcommon/llevents.h
@@ -1,831 +1,934 @@
-/**
- * @file llevents.h
- * @author Kent Quirk, Nat Goodspeed
- * @date 2008-09-11
- * @brief This is an implementation of the event system described at
- * https://wiki.lindenlab.com/wiki/Viewer:Messaging/Event_System,
- * originally introduced in llnotifications.h. It has nothing
- * whatsoever to do with the older system in llevent.h.
- *
- * $LicenseInfo:firstyear=2008&license=viewergpl$
- * Copyright (c) 2008, Linden Research, Inc.
- * $/LicenseInfo$
- */
-
-#if ! defined(LL_LLEVENTS_H)
-#define LL_LLEVENTS_H
-
-#include <string>
-#include <map>
-#include <set>
-#include <vector>
-#include <list>
-#include <deque>
-#include <stdexcept>
-#if LL_WINDOWS
- #pragma warning (push)
- #pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch
- #pragma warning (disable : 4264)
-#endif
-#include <boost/signals2.hpp>
-#if LL_WINDOWS
- #pragma warning (pop)
-#endif
-
-#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/utility.hpp> // noncopyable
-#include <boost/optional/optional.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/visit_each.hpp>
-#include <boost/ref.hpp> // reference_wrapper
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/utility/addressof.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/iteration/local.hpp>
-#include <boost/function.hpp>
-#include <boost/static_assert.hpp>
-#include "llsd.h"
-#include "llsingleton.h"
-#include "lldependencies.h"
-
-// override this to allow binding free functions with more parameters
-#ifndef LLEVENTS_LISTENER_ARITY
-#define LLEVENTS_LISTENER_ARITY 10
-#endif
-
-// hack for testing
-#ifndef testable
-#define testable private
-#endif
-
-/*****************************************************************************
-* Signal and handler declarations
-* Using a single handler signature means that we can have a common handler
-* type, rather than needing a distinct one for each different handler.
-*****************************************************************************/
-
-/**
- * A boost::signals Combiner that stops the first time a handler returns true
- * We need this because we want to have our handlers return bool, so that
- * we have the option to cause a handler to stop further processing. The
- * default handler fails when the signal returns a value but has no slots.
- */
-struct LLStopWhenHandled
-{
- typedef bool result_type;
-
- template<typename InputIterator>
- result_type operator()(InputIterator first, InputIterator last) const
- {
- for (InputIterator si = first; si != last; ++si)
- {
- if (*si)
- {
- return true;
- }
- }
- return false;
- }
-};
-
-/**
- * We want to have a standard signature for all signals; this way,
- * we can easily document a protocol for communicating across
- * dlls and into scripting languages someday.
- *
- * We want to return a bool to indicate whether the signal has been
- * handled and should NOT be passed on to other listeners.
- * Return true to stop further handling of the signal, and false
- * to continue.
- *
- * We take an LLSD because this way the contents of the signal
- * are independent of the API used to communicate it.
- * It is const ref because then there's low cost to pass it;
- * if you only need to inspect it, it's very cheap.
- *
- * @internal
- * The @c float template parameter indicates that we will internally use @c
- * float to indicate relative listener order on a given LLStandardSignal.
- * Don't worry, the @c float values are strictly internal! They are not part
- * of the interface, for the excellent reason that requiring the caller to
- * specify a numeric key to establish order means that the caller must know
- * the universe of possible values. We use LLDependencies for that instead.
- */
-typedef boost::signals2::signal<bool(const LLSD&), LLStopWhenHandled, float> LLStandardSignal;
-/// Methods that forward listeners (e.g. constructed with
-/// <tt>boost::bind()</tt>) should accept (const LLEventListener&)
-typedef LLStandardSignal::slot_type LLEventListener;
-/// Result of registering a listener, supports <tt>connected()</tt>,
-/// <tt>disconnect()</tt> and <tt>blocked()</tt>
-typedef boost::signals2::connection LLBoundListener;
-
-/**
- * A common idiom for event-based code is to accept either a callable --
- * directly called on completion -- or the string name of an LLEventPump on
- * which to post the completion event. Specifying a parameter as <tt>const
- * LLListenerOrPumpName&</tt> allows either.
- *
- * Calling a validly-constructed LLListenerOrPumpName, passing the LLSD
- * 'event' object, either calls the callable or posts the event to the named
- * LLEventPump.
- *
- * A default-constructed LLListenerOrPumpName is 'empty'. (This is useful as
- * the default value of an optional method parameter.) Calling it throws
- * LLListenerOrPumpName::Empty. Test for this condition beforehand using
- * either <tt>if (param)</tt> or <tt>if (! param)</tt>.
- */
-class LLListenerOrPumpName
-{
-public:
- /// passing string name of LLEventPump
- LLListenerOrPumpName(const std::string& pumpname);
- /// passing string literal (overload so compiler isn't forced to infer
- /// double conversion)
- LLListenerOrPumpName(const char* pumpname);
- /// passing listener -- the "anything else" catch-all case. The type of an
- /// object constructed by boost::bind() isn't intended to be written out.
- /// Normally we'd just accept 'const LLEventListener&', but that would
- /// require double implicit conversion: boost::bind() object to
- /// LLEventListener, LLEventListener to LLListenerOrPumpName. So use a
- /// template to forward anything.
- template<typename T>
- LLListenerOrPumpName(const T& listener): mListener(listener) {}
-
- /// for omitted method parameter: uninitialized mListener
- LLListenerOrPumpName() {}
-
- /// test for validity
- operator bool() const { return bool(mListener); }
- bool operator! () const { return ! mListener; }
-
- /// explicit accessor
- const LLEventListener& getListener() const { return *mListener; }
-
- /// implicit conversion to LLEventListener
- operator LLEventListener() const { return *mListener; }
-
- /// allow calling directly
- bool operator()(const LLSD& event) const;
-
- /// exception if you try to call when empty
- struct Empty: public std::runtime_error
- {
- Empty(const std::string& what):
- std::runtime_error(std::string("LLListenerOrPumpName::Empty: ") + what) {}
- };
-
-private:
- boost::optional<LLEventListener> mListener;
-};
-
-/*****************************************************************************
-* LLEventPumps
-*****************************************************************************/
-class LLEventPump;
-
-/**
- * LLEventPumps is a Singleton manager through which one typically accesses
- * this subsystem.
- */
-class LLEventPumps: public LLSingleton<LLEventPumps>
-{
- friend class LLSingleton<LLEventPumps>;
-public:
- /**
- * Find or create an LLEventPump instance with a specific name. We return
- * a reference so there's no question about ownership. obtain() @em finds
- * an instance without conferring @em ownership.
- */
- LLEventPump& obtain(const std::string& name);
- /**
- * Flush all known LLEventPump instances
- */
- void flush();
-
-private:
- friend class LLEventPump;
- /**
- * Register a new LLEventPump instance (internal)
- */
- std::string registerNew(const LLEventPump&, const std::string& name, bool tweak);
- /**
- * Unregister a doomed LLEventPump instance (internal)
- */
- void unregister(const LLEventPump&);
-
-private:
- LLEventPumps();
- ~LLEventPumps();
-
-testable:
- // Map of all known LLEventPump instances, whether or not we instantiated
- // them. We store a plain old LLEventPump* because this map doesn't claim
- // ownership of the instances. Though the common usage pattern is to
- // request an instance using obtain(), it's fair to instantiate an
- // LLEventPump subclass statically, as a class member, on the stack or on
- // the heap. In such cases, the instantiating party is responsible for its
- // lifespan.
- typedef std::map<std::string, LLEventPump*> PumpMap;
- PumpMap mPumpMap;
- // Set of all LLEventPumps we instantiated. Membership in this set means
- // we claim ownership, and will delete them when this LLEventPumps is
- // destroyed.
- typedef std::set<LLEventPump*> PumpSet;
- PumpSet mOurPumps;
- // LLEventPump names that should be instantiated as LLEventQueue rather
- // than as LLEventStream
- typedef std::set<std::string> PumpNames;
- PumpNames mQueueNames;
-};
-
-/*****************************************************************************
-* details
-*****************************************************************************/
-namespace LLEventDetail
-{
- /// Any callable capable of connecting an LLEventListener to an
- /// LLStandardSignal to produce an LLBoundListener can be mapped to this
- /// signature.
- typedef boost::function<LLBoundListener(const LLEventListener&)> ConnectFunc;
-
- /**
- * Utility template function to use Visitor appropriately
- *
- * @param listener Callable to connect, typically a boost::bind()
- * expression. This will be visited by Visitor using boost::visit_each().
- * @param connect_func Callable that will connect() @a listener to an
- * LLStandardSignal, returning LLBoundListener.
- */
- template <typename LISTENER>
- LLBoundListener visit_and_connect(const LISTENER& listener,
- const ConnectFunc& connect_func);
-} // namespace LLEventDetail
-
-/*****************************************************************************
-* LLEventPump
-*****************************************************************************/
-/**
- * LLEventPump is the base class interface through which we access the
- * concrete subclasses LLEventStream and LLEventQueue.
- */
-class LLEventPump: boost::noncopyable
-{
-public:
- /**
- * Exception thrown by LLEventPump(). You are trying to instantiate an
- * LLEventPump (subclass) using the same name as some other instance, and
- * you didn't pass <tt>tweak=true</tt> to permit it to generate a unique
- * variant.
- */
- struct DupPumpName: public std::runtime_error
- {
- DupPumpName(const std::string& what):
- std::runtime_error(std::string("DupPumpName: ") + what) {}
- };
-
- /**
- * Instantiate an LLEventPump (subclass) with the string name by which it
- * can be found using LLEventPumps::obtain().
- *
- * If you pass (or default) @a tweak to @c false, then a duplicate name
- * will throw DupPumpName. This won't happen if LLEventPumps::obtain()
- * instantiates the LLEventPump, because obtain() uses find-or-create
- * logic. It can only happen if you instantiate an LLEventPump in your own
- * code -- and a collision with the name of some other LLEventPump is
- * likely to cause much more subtle problems!
- *
- * When you hand-instantiate an LLEventPump, consider passing @a tweak as
- * @c true. This directs LLEventPump() to append a suffix to the passed @a
- * name to make it unique. You can retrieve the adjusted name by calling
- * getName() on your new instance.
- */
- LLEventPump(const std::string& name, bool tweak=false);
- virtual ~LLEventPump();
-
- /// group exceptions thrown by listen(). We use exceptions because these
- /// particular errors are likely to be coding errors, found and fixed by
- /// the developer even before preliminary checkin.
- struct ListenError: public std::runtime_error
- {
- ListenError(const std::string& what): std::runtime_error(what) {}
- };
- /**
- * exception thrown by listen(). You are attempting to register a
- * listener on this LLEventPump using the same listener name as an
- * already-registered listener.
- */
- struct DupListenerName: public ListenError
- {
- DupListenerName(const std::string& what):
- ListenError(std::string("DupListenerName: ") + what)
- {}
- };
- /**
- * exception thrown by listen(). The order dependencies specified for your
- * listener are incompatible with existing listeners.
- *
- * Consider listener "a" which specifies before "b" and "b" which
- * specifies before "c". You are now attempting to register "c" before
- * "a". There is no order that can satisfy all constraints.
- */
- struct Cycle: public ListenError
- {
- Cycle(const std::string& what): ListenError(std::string("Cycle: ") + what) {}
- };
- /**
- * exception thrown by listen(). This one means that your new listener
- * would force a change to the order of previously-registered listeners,
- * and we don't have a good way to implement that.
- *
- * Consider listeners "some", "other" and "third". "some" and "other" are
- * registered earlier without specifying relative order, so "other"
- * happens to be first. Now you attempt to register "third" after "some"
- * and before "other". Whoops, that would require swapping "some" and
- * "other", which we can't do. Instead we throw this exception.
- *
- * It may not be possible to change the registration order so we already
- * know "third"s order requirement by the time we register the second of
- * "some" and "other". A solution would be to specify that "some" must
- * come before "other", or equivalently that "other" must come after
- * "some".
- */
- struct OrderChange: public ListenError
- {
- OrderChange(const std::string& what): ListenError(std::string("OrderChange: ") + what) {}
- };
-
- /// used by listen()
- typedef std::vector<std::string> NameList;
- /// convenience placeholder for when you explicitly want to pass an empty
- /// NameList
- const static NameList empty;
-
- /// Get this LLEventPump's name
- std::string getName() const { return mName; }
-
- /**
- * Register a new listener with a unique name. Specify an optional list
- * of other listener names after which this one must be called, likewise
- * an optional list of other listener names before which this one must be
- * called. The other listeners mentioned need not yet be registered
- * themselves. listen() can throw any ListenError; see ListenError
- * subclasses.
- *
- * If (as is typical) you pass a <tt>boost::bind()</tt> expression,
- * listen() will inspect the components of that expression. If a bound
- * object matches any of several cases, the connection will automatically
- * be disconnected when that object is destroyed.
- *
- * * You bind a <tt>boost::weak_ptr</tt>.
- * * Binding a <tt>boost::shared_ptr</tt> that way would ensure that the
- * referenced object would @em never be destroyed, since the @c
- * shared_ptr stored in the LLEventPump would remain an outstanding
- * reference. Use the weaken() function to convert your @c shared_ptr to
- * @c weak_ptr. Because this is easy to forget, binding a @c shared_ptr
- * will produce a compile error (@c BOOST_STATIC_ASSERT failure).
- * * You bind a simple pointer or reference to an object derived from
- * <tt>boost::enable_shared_from_this</tt>. (UNDER CONSTRUCTION)
- * * You bind a simple pointer or reference to an object derived from
- * LLEventTrackable. Unlike the cases described above, though, this is
- * vulnerable to a couple of cross-thread race conditions, as described
- * in the LLEventTrackable documentation.
- */
- template <typename LISTENER>
- LLBoundListener listen(const std::string& name, const LISTENER& listener,
- const NameList& after=NameList(),
- const NameList& before=NameList())
- {
- // Examine listener, using our listen_impl() method to make the
- // actual connection.
- // This is why listen() is a template. Conversion from boost::bind()
- // to LLEventListener performs type erasure, so it's important to look
- // at the boost::bind object itself before that happens.
- return LLEventDetail::visit_and_connect(listener,
- boost::bind(&LLEventPump::listen_impl,
- this,
- name,
- _1,
- after,
- before));
- }
-
- /// Get the LLBoundListener associated with the passed name (dummy
- /// LLBoundListener if not found)
- virtual LLBoundListener getListener(const std::string& name) const;
- /**
- * Instantiate one of these to block an existing connection:
- * @code
- * { // in some local scope
- * LLEventPump::Blocker block(someLLBoundListener);
- * // code that needs the connection blocked
- * } // unblock the connection again
- * @endcode
- */
- typedef boost::signals2::shared_connection_block Blocker;
- /// Unregister a listener by name. Prefer this to
- /// <tt>getListener(name).disconnect()</tt> because stopListening() also
- /// forgets this name.
- virtual void stopListening(const std::string& name);
- /// Post an event to all listeners. The @c bool return is only meaningful
- /// if the underlying leaf class is LLEventStream -- beware of relying on
- /// it too much! Truthfully, we return @c bool mostly to permit chaining
- /// one LLEventPump as a listener on another.
- virtual bool post(const LLSD&) = 0;
- /// Enable/disable: while disabled, silently ignore all post() calls
- virtual void enable(bool enabled=true) { mEnabled = enabled; }
- /// query
- virtual bool enabled() const { return mEnabled; }
-
-private:
- friend class LLEventPumps;
- /// flush queued events
- virtual void flush() {}
-
-private:
- virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&,
- const NameList& after,
- const NameList& before);
- std::string mName;
-
-protected:
- /// implement the dispatching
- LLStandardSignal mSignal;
- /// valve open?
- bool mEnabled;
- /// Map of named listeners. This tracks the listeners that actually exist
- /// at this moment. When we stopListening(), we discard the entry from
- /// this map.
- typedef std::map<std::string, boost::signals2::connection> ConnectionMap;
- ConnectionMap mConnections;
- typedef LLDependencies<std::string, float> DependencyMap;
- /// Dependencies between listeners. For each listener, track the float
- /// used to establish its place in mSignal's order. This caches all the
- /// listeners that have ever registered; stopListening() does not discard
- /// the entry from this map. This is to avoid a new dependency sort if the
- /// same listener with the same dependencies keeps hopping on and off this
- /// LLEventPump.
- DependencyMap mDeps;
-};
-
-/*****************************************************************************
-* LLEventStream
-*****************************************************************************/
-/**
- * LLEventStream is a thin wrapper around LLStandardSignal. Posting an
- * event immediately calls all registered listeners.
- */
-class LLEventStream: public LLEventPump
-{
-public:
- LLEventStream(const std::string& name, bool tweak=false): LLEventPump(name, tweak) {}
- virtual ~LLEventStream() {}
-
- /// Post an event to all listeners
- virtual bool post(const LLSD& event);
-};
-
-/*****************************************************************************
-* LLEventQueue
-*****************************************************************************/
-/**
- * LLEventQueue isa LLEventPump whose post() method defers calling registered
- * listeners until flush() is called.
- */
-class LLEventQueue: public LLEventPump
-{
-public:
- LLEventQueue(const std::string& name, bool tweak=false): LLEventPump(name, tweak) {}
- virtual ~LLEventQueue() {}
-
- /// Post an event to all listeners
- virtual bool post(const LLSD& event);
-
-private:
- /// flush queued events
- virtual void flush();
-
-private:
- typedef std::deque<LLSD> EventQueue;
- EventQueue mEventQueue;
-};
-
-/*****************************************************************************
-* LLEventTrackable and underpinnings
-*****************************************************************************/
-/**
- * LLEventTrackable wraps boost::signals2::trackable, which resembles
- * boost::trackable. Derive your listener class from LLEventTrackable instead,
- * and use something like
- * <tt>LLEventPump::listen(boost::bind(&YourTrackableSubclass::method,
- * instance, _1))</tt>. This will implicitly disconnect when the object
- * referenced by @c instance is destroyed.
- *
- * @note
- * LLEventTrackable doesn't address a couple of cases:
- * * Object destroyed during call
- * - You enter a slot call in thread A.
- * - Thread B destroys the object, which of course disconnects it from any
- * future slot calls.
- * - Thread A's call uses 'this', which now refers to a defunct object.
- * Undefined behavior results.
- * * Call during destruction
- * - @c MySubclass is derived from LLEventTrackable.
- * - @c MySubclass registers one of its own methods using
- * <tt>LLEventPump::listen()</tt>.
- * - The @c MySubclass object begins destruction. <tt>~MySubclass()</tt>
- * runs, destroying state specific to the subclass. (For instance, a
- * <tt>Foo*</tt> data member is <tt>delete</tt>d but not zeroed.)
- * - The listening method will not be disconnected until
- * <tt>~LLEventTrackable()</tt> runs.
- * - Before we get there, another thread posts data to the @c LLEventPump
- * instance, calling the @c MySubclass method.
- * - The method in question relies on valid @c MySubclass state. (For
- * instance, it attempts to dereference the <tt>Foo*</tt> pointer that was
- * <tt>delete</tt>d but not zeroed.)
- * - Undefined behavior results.
- * If you suspect you may encounter any such scenario, you're better off
- * managing the lifespan of your object with <tt>boost::shared_ptr</tt>.
- * Passing <tt>LLEventPump::listen()</tt> a <tt>boost::bind()</tt> expression
- * involving a <tt>boost::weak_ptr<Foo></tt> is recognized specially, engaging
- * thread-safe Boost.Signals2 machinery.
- */
-typedef boost::signals2::trackable LLEventTrackable;
-
-/**
- * We originally provided a suite of overloaded
- * LLEventTrackable::listenTo(LLEventPump&, ...) methods that would call
- * LLEventPump::listen(...) and then pass the returned LLBoundListener to
- * LLEventTrackable::track(). This was workable but error-prone: the coder
- * must remember to call listenTo() rather than the more straightforward
- * listen() method.
- *
- * Now we publish only the single canonical listen() method, so there's a
- * uniform mechanism. Having a single way to do this is good, in that there's
- * no question in the coder's mind which of several alternatives to choose.
- *
- * To support automatic connection management, we use boost::visit_each
- * (http://www.boost.org/doc/libs/1_37_0/doc/html/boost/visit_each.html) to
- * inspect each argument of a boost::bind expression. (Although the visit_each
- * mechanism was first introduced with the original Boost.Signals library, it
- * was only later documented.)
- *
- * Cases:
- * * At least one of the function's arguments is a boost::weak_ptr<T>. Pass
- * the corresponding shared_ptr to slot_type::track(). Ideally that would be
- * the object whose method we want to call, but in fact we do the same for
- * any weak_ptr we might find among the bound arguments. If we're passing
- * our bound method a weak_ptr to some object, wouldn't the destruction of
- * that object invalidate the call? So we disconnect automatically when any
- * such object is destroyed. This is the mechanism preferred by boost::
- * signals2.
- * * One of the functions's arguments is a boost::shared_ptr<T>. This produces
- * a compile error: the bound copy of the shared_ptr stored in the
- * boost_bind object stored in the signal object would make the referenced
- * T object immortal. We provide a weaken() function. Pass
- * weaken(your_shared_ptr) instead. (We can inspect, but not modify, the
- * boost::bind object. Otherwise we'd replace the shared_ptr with weak_ptr
- * implicitly and just proceed.)
- * * One of the function's arguments is a plain pointer/reference to an object
- * derived from boost::enable_shared_from_this. We assume that this object
- * is managed using boost::shared_ptr, so we implicitly extract a shared_ptr
- * and track that. (UNDER CONSTRUCTION)
- * * One of the function's arguments is derived from LLEventTrackable. Pass
- * the LLBoundListener to its LLEventTrackable::track(). This is vulnerable
- * to a couple different race conditions, as described in LLEventTrackable
- * documentation. (NOTE: Now that LLEventTrackable is a typedef for
- * boost::signals2::trackable, the Signals2 library handles this itself, so
- * our visitor needs no special logic for this case.)
- * * Any other argument type is irrelevant to automatic connection management.
- */
-
-namespace LLEventDetail
-{
- template <typename F>
- const F& unwrap(const F& f) { return f; }
-
- template <typename F>
- const F& unwrap(const boost::reference_wrapper<F>& f) { return f.get(); }
-
- // Most of the following is lifted from the Boost.Signals use of
- // visit_each.
- template<bool Cond> struct truth {};
-
- /**
- * boost::visit_each() Visitor, used on a template argument <tt>const F&
- * f</tt> as follows (see visit_and_connect()):
- * @code
- * LLEventListener listener(f);
- * Visitor visitor(listener); // bind listener so it can track() shared_ptrs
- * using boost::visit_each; // allow unqualified visit_each() call for ADL
- * visit_each(visitor, unwrap(f));
- * @endcode
- */
- class Visitor
- {
- public:
- /**
- * Visitor binds a reference to LLEventListener so we can track() any
- * shared_ptrs we find in the argument list.
- */
- Visitor(LLEventListener& listener):
- mListener(listener)
- {
- }
-
- /**
- * boost::visit_each() calls this method for each component of a
- * boost::bind() expression.
- */
- template <typename T>
- void operator()(const T& t) const
- {
- decode(t, 0);
- }
-
- private:
- // decode() decides between a reference wrapper and anything else
- // boost::ref() variant
- template<typename T>
- void decode(const boost::reference_wrapper<T>& t, int) const
- {
-// add_if_trackable(t.get_pointer());
- }
-
- // decode() anything else
- template<typename T>
- void decode(const T& t, long) const
- {
- typedef truth<(boost::is_pointer<T>::value)> is_a_pointer;
- maybe_get_pointer(t, is_a_pointer());
- }
-
- // maybe_get_pointer() decides between a pointer and a non-pointer
- // plain pointer variant
- template<typename T>
- void maybe_get_pointer(const T& t, truth<true>) const
- {
-// add_if_trackable(t);
- }
-
- // shared_ptr variant
- template<typename T>
- void maybe_get_pointer(const boost::shared_ptr<T>& t, truth<false>) const
- {
- // If we have a shared_ptr to this object, it doesn't matter
- // whether the object is derived from LLEventTrackable, so no
- // further analysis of T is needed.
-// mListener.track(t);
-
- // Make this case illegal. Passing a bound shared_ptr to
- // slot_type::track() is useless, since the bound shared_ptr will
- // keep the object alive anyway! Force the coder to cast to weak_ptr.
-
- // Trivial as it is, make the BOOST_STATIC_ASSERT() condition
- // dependent on template param so the macro is only evaluated if
- // this method is in fact instantiated, as described here:
- // http://www.boost.org/doc/libs/1_34_1/doc/html/boost_staticassert.html
-
- // ATTENTION: Don't bind a shared_ptr<anything> using
- // LLEventPump::listen(boost::bind()). Doing so captures a copy of
- // the shared_ptr, making the referenced object effectively
- // immortal. Use the weaken() function, e.g.:
- // somepump.listen(boost::bind(...weaken(my_shared_ptr)...));
- // This lets us automatically disconnect when the referenced
- // object is destroyed.
- BOOST_STATIC_ASSERT(sizeof(T) == 0);
- }
-
- // weak_ptr variant
- template<typename T>
- void maybe_get_pointer(const boost::weak_ptr<T>& t, truth<false>) const
- {
- // If we have a weak_ptr to this object, it doesn't matter
- // whether the object is derived from LLEventTrackable, so no
- // further analysis of T is needed.
- mListener.track(t);
-// std::cout << "Found weak_ptr<" << typeid(T).name() << ">!\n";
- }
-
-#if 0
- // reference to anything derived from boost::enable_shared_from_this
- template <typename T>
- inline void maybe_get_pointer(const boost::enable_shared_from_this<T>& ct,
- truth<false>) const
- {
- // Use the slot_type::track(shared_ptr) mechanism. Cast away
- // const-ness because (in our code base anyway) it's unusual
- // to find shared_ptr<const T>.
- boost::enable_shared_from_this<T>&
- t(const_cast<boost::enable_shared_from_this<T>&>(ct));
- std::cout << "Capturing shared_from_this()" << std::endl;
- boost::shared_ptr<T> sp(t.shared_from_this());
-/*==========================================================================*|
- std::cout << "Capturing weak_ptr" << std::endl;
- boost::weak_ptr<T> wp(sp);
-|*==========================================================================*/
- std::cout << "Tracking shared__ptr" << std::endl;
- mListener.track(sp);
- }
-#endif
-
- // non-pointer variant
- template<typename T>
- void maybe_get_pointer(const T& t, truth<false>) const
- {
- // Take the address of this object, because the object itself may be
- // trackable
-// add_if_trackable(boost::addressof(t));
- }
-
-/*==========================================================================*|
- // add_if_trackable() adds LLEventTrackable objects to mTrackables
- inline void add_if_trackable(const LLEventTrackable* t) const
- {
- if (t)
- {
- }
- }
-
- // pointer to anything not an LLEventTrackable subclass
- inline void add_if_trackable(const void*) const
- {
- }
-
- // pointer to free function
- // The following construct uses the preprocessor to generate
- // add_if_trackable() overloads accepting pointer-to-function taking
- // 0, 1, ..., LLEVENTS_LISTENER_ARITY parameters of arbitrary type.
-#define BOOST_PP_LOCAL_MACRO(n) \
- template <typename R \
- BOOST_PP_COMMA_IF(n) \
- BOOST_PP_ENUM_PARAMS(n, typename T)> \
- inline void \
- add_if_trackable(R (*)(BOOST_PP_ENUM_PARAMS(n, T))) const \
- { \
- }
-#define BOOST_PP_LOCAL_LIMITS (0, LLEVENTS_LISTENER_ARITY)
-#include BOOST_PP_LOCAL_ITERATE()
-#undef BOOST_PP_LOCAL_MACRO
-#undef BOOST_PP_LOCAL_LIMITS
-|*==========================================================================*/
-
- /// Bind a reference to the LLEventListener to call its track() method.
- LLEventListener& mListener;
- };
-
- /**
- * Utility template function to use Visitor appropriately
- *
- * @param raw_listener Callable to connect, typically a boost::bind()
- * expression. This will be visited by Visitor using boost::visit_each().
- * @param connect_funct Callable that will connect() @a raw_listener to an
- * LLStandardSignal, returning LLBoundListener.
- */
- template <typename LISTENER>
- LLBoundListener visit_and_connect(const LISTENER& raw_listener,
- const ConnectFunc& connect_func)
- {
- // Capture the listener
- LLEventListener listener(raw_listener);
- // Define our Visitor, binding the listener so we can call
- // listener.track() if we discover any shared_ptr<Foo>.
- LLEventDetail::Visitor visitor(listener);
- // Allow unqualified visit_each() call for ADL
- using boost::visit_each;
- // Visit each component of a boost::bind() expression. Pass
- // 'raw_listener', our template argument, rather than 'listener' from
- // which type details have been erased. unwrap() comes from
- // Boost.Signals, in case we were passed a boost::ref().
- visit_each(visitor, LLEventDetail::unwrap(raw_listener));
- // Make the connection using passed function. At present, wrapping
- // this functionality into this function is a bit silly: we don't
- // really need a visit_and_connect() function any more, just a visit()
- // function. The definition of this function dates from when, after
- // visit_each(), after establishing the connection, we had to
- // postprocess the new connection with the visitor object. That's no
- // longer necessary.
- return connect_func(listener);
- }
-} // namespace LLEventDetail
-
-// Somewhat to my surprise, passing boost::bind(...boost::weak_ptr<T>...) to
-// listen() fails in Boost code trying to instantiate LLEventListener (i.e.
-// LLStandardSignal::slot_type) because the boost::get_pointer() utility function isn't
-// specialized for boost::weak_ptr. This remedies that omission.
-namespace boost
-{
- template <typename T>
- T* get_pointer(const weak_ptr<T>& ptr) { return shared_ptr<T>(ptr).get(); }
-}
-
-/// Since we forbid use of listen(boost::bind(...shared_ptr<T>...)), provide an
-/// easy way to cast to the corresponding weak_ptr.
-template <typename T>
-boost::weak_ptr<T> weaken(const boost::shared_ptr<T>& ptr)
-{
- return boost::weak_ptr<T>(ptr);
-}
-
-#endif /* ! defined(LL_LLEVENTS_H) */
+/**
+ * @file llevents.h
+ * @author Kent Quirk, Nat Goodspeed
+ * @date 2008-09-11
+ * @brief This is an implementation of the event system described at
+ * https://wiki.lindenlab.com/wiki/Viewer:Messaging/Event_System,
+ * originally introduced in llnotifications.h. It has nothing
+ * whatsoever to do with the older system in llevent.h.
+ *
+ * $LicenseInfo:firstyear=2008&license=viewergpl$
+ * Copyright (c) 2008, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLEVENTS_H)
+#define LL_LLEVENTS_H
+
+#include <string>
+#include <map>
+#include <set>
+#include <vector>
+#include <deque>
+#include <stdexcept>
+#if LL_WINDOWS
+ #pragma warning (push)
+ #pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch
+ #pragma warning (disable : 4264)
+#endif
+#include <boost/signals2.hpp>
+#if LL_WINDOWS
+ #pragma warning (pop)
+#endif
+
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/utility.hpp> // noncopyable
+#include <boost/optional/optional.hpp>
+#include <boost/visit_each.hpp>
+#include <boost/ref.hpp> // reference_wrapper
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/function.hpp>
+#include <boost/static_assert.hpp>
+#include "llsd.h"
+#include "llsingleton.h"
+#include "lldependencies.h"
+
+// override this to allow binding free functions with more parameters
+#ifndef LLEVENTS_LISTENER_ARITY
+#define LLEVENTS_LISTENER_ARITY 10
+#endif
+
+// hack for testing
+#ifndef testable
+#define testable private
+#endif
+
+/*****************************************************************************
+* Signal and handler declarations
+* Using a single handler signature means that we can have a common handler
+* type, rather than needing a distinct one for each different handler.
+*****************************************************************************/
+
+/**
+ * A boost::signals Combiner that stops the first time a handler returns true
+ * We need this because we want to have our handlers return bool, so that
+ * we have the option to cause a handler to stop further processing. The
+ * default handler fails when the signal returns a value but has no slots.
+ */
+struct LLStopWhenHandled
+{
+ typedef bool result_type;
+
+ template<typename InputIterator>
+ result_type operator()(InputIterator first, InputIterator last) const
+ {
+ for (InputIterator si = first; si != last; ++si)
+ {
+ if (*si)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+};
+
+/**
+ * We want to have a standard signature for all signals; this way,
+ * we can easily document a protocol for communicating across
+ * dlls and into scripting languages someday.
+ *
+ * We want to return a bool to indicate whether the signal has been
+ * handled and should NOT be passed on to other listeners.
+ * Return true to stop further handling of the signal, and false
+ * to continue.
+ *
+ * We take an LLSD because this way the contents of the signal
+ * are independent of the API used to communicate it.
+ * It is const ref because then there's low cost to pass it;
+ * if you only need to inspect it, it's very cheap.
+ *
+ * @internal
+ * The @c float template parameter indicates that we will internally use @c
+ * float to indicate relative listener order on a given LLStandardSignal.
+ * Don't worry, the @c float values are strictly internal! They are not part
+ * of the interface, for the excellent reason that requiring the caller to
+ * specify a numeric key to establish order means that the caller must know
+ * the universe of possible values. We use LLDependencies for that instead.
+ */
+typedef boost::signals2::signal<bool(const LLSD&), LLStopWhenHandled, float> LLStandardSignal;
+/// Methods that forward listeners (e.g. constructed with
+/// <tt>boost::bind()</tt>) should accept (const LLEventListener&)
+typedef LLStandardSignal::slot_type LLEventListener;
+/// Result of registering a listener, supports <tt>connected()</tt>,
+/// <tt>disconnect()</tt> and <tt>blocked()</tt>
+typedef boost::signals2::connection LLBoundListener;
+/// Storing an LLBoundListener in LLTempBoundListener will disconnect the
+/// referenced listener when the LLTempBoundListener instance is destroyed.
+typedef boost::signals2::scoped_connection LLTempBoundListener;
+
+/**
+ * A common idiom for event-based code is to accept either a callable --
+ * directly called on completion -- or the string name of an LLEventPump on
+ * which to post the completion event. Specifying a parameter as <tt>const
+ * LLListenerOrPumpName&</tt> allows either.
+ *
+ * Calling a validly-constructed LLListenerOrPumpName, passing the LLSD
+ * 'event' object, either calls the callable or posts the event to the named
+ * LLEventPump.
+ *
+ * A default-constructed LLListenerOrPumpName is 'empty'. (This is useful as
+ * the default value of an optional method parameter.) Calling it throws
+ * LLListenerOrPumpName::Empty. Test for this condition beforehand using
+ * either <tt>if (param)</tt> or <tt>if (! param)</tt>.
+ */
+class LL_COMMON_API LLListenerOrPumpName
+{
+public:
+ /// passing string name of LLEventPump
+ LLListenerOrPumpName(const std::string& pumpname);
+ /// passing string literal (overload so compiler isn't forced to infer
+ /// double conversion)
+ LLListenerOrPumpName(const char* pumpname);
+ /// passing listener -- the "anything else" catch-all case. The type of an
+ /// object constructed by boost::bind() isn't intended to be written out.
+ /// Normally we'd just accept 'const LLEventListener&', but that would
+ /// require double implicit conversion: boost::bind() object to
+ /// LLEventListener, LLEventListener to LLListenerOrPumpName. So use a
+ /// template to forward anything.
+ template<typename T>
+ LLListenerOrPumpName(const T& listener): mListener(listener) {}
+
+ /// for omitted method parameter: uninitialized mListener
+ LLListenerOrPumpName() {}
+
+ /// test for validity
+ operator bool() const { return bool(mListener); }
+ bool operator! () const { return ! mListener; }
+
+ /// explicit accessor
+ const LLEventListener& getListener() const { return *mListener; }
+
+ /// implicit conversion to LLEventListener
+ operator LLEventListener() const { return *mListener; }
+
+ /// allow calling directly
+ bool operator()(const LLSD& event) const;
+
+ /// exception if you try to call when empty
+ struct Empty: public std::runtime_error
+ {
+ Empty(const std::string& what):
+ std::runtime_error(std::string("LLListenerOrPumpName::Empty: ") + what) {}
+ };
+
+private:
+ boost::optional<LLEventListener> mListener;
+};
+
+/*****************************************************************************
+* LLEventPumps
+*****************************************************************************/
+class LLEventPump;
+
+/**
+ * LLEventPumps is a Singleton manager through which one typically accesses
+ * this subsystem.
+ */
+class LL_COMMON_API LLEventPumps: public LLSingleton<LLEventPumps>
+{
+ friend class LLSingleton<LLEventPumps>;
+public:
+ /**
+ * Find or create an LLEventPump instance with a specific name. We return
+ * a reference so there's no question about ownership. obtain() @em finds
+ * an instance without conferring @em ownership.
+ */
+ LLEventPump& obtain(const std::string& name);
+ /**
+ * Flush all known LLEventPump instances
+ */
+ void flush();
+
+private:
+ friend class LLEventPump;
+ /**
+ * Register a new LLEventPump instance (internal)
+ */
+ std::string registerNew(const LLEventPump&, const std::string& name, bool tweak);
+ /**
+ * Unregister a doomed LLEventPump instance (internal)
+ */
+ void unregister(const LLEventPump&);
+
+private:
+ LLEventPumps();
+ ~LLEventPumps();
+
+testable:
+ // Map of all known LLEventPump instances, whether or not we instantiated
+ // them. We store a plain old LLEventPump* because this map doesn't claim
+ // ownership of the instances. Though the common usage pattern is to
+ // request an instance using obtain(), it's fair to instantiate an
+ // LLEventPump subclass statically, as a class member, on the stack or on
+ // the heap. In such cases, the instantiating party is responsible for its
+ // lifespan.
+ typedef std::map<std::string, LLEventPump*> PumpMap;
+ PumpMap mPumpMap;
+ // Set of all LLEventPumps we instantiated. Membership in this set means
+ // we claim ownership, and will delete them when this LLEventPumps is
+ // destroyed.
+ typedef std::set<LLEventPump*> PumpSet;
+ PumpSet mOurPumps;
+ // LLEventPump names that should be instantiated as LLEventQueue rather
+ // than as LLEventStream
+ typedef std::set<std::string> PumpNames;
+ PumpNames mQueueNames;
+};
+
+/*****************************************************************************
+* details
+*****************************************************************************/
+namespace LLEventDetail
+{
+ /// Any callable capable of connecting an LLEventListener to an
+ /// LLStandardSignal to produce an LLBoundListener can be mapped to this
+ /// signature.
+ typedef boost::function<LLBoundListener(const LLEventListener&)> ConnectFunc;
+
+ /**
+ * Utility template function to use Visitor appropriately
+ *
+ * @param listener Callable to connect, typically a boost::bind()
+ * expression. This will be visited by Visitor using boost::visit_each().
+ * @param connect_func Callable that will connect() @a listener to an
+ * LLStandardSignal, returning LLBoundListener.
+ */
+ template <typename LISTENER>
+ LLBoundListener visit_and_connect(const LISTENER& listener,
+ const ConnectFunc& connect_func);
+} // namespace LLEventDetail
+
+/*****************************************************************************
+* LLEventTrackable
+*****************************************************************************/
+/**
+ * LLEventTrackable wraps boost::signals2::trackable, which resembles
+ * boost::trackable. Derive your listener class from LLEventTrackable instead,
+ * and use something like
+ * <tt>LLEventPump::listen(boost::bind(&YourTrackableSubclass::method,
+ * instance, _1))</tt>. This will implicitly disconnect when the object
+ * referenced by @c instance is destroyed.
+ *
+ * @note
+ * LLEventTrackable doesn't address a couple of cases:
+ * * Object destroyed during call
+ * - You enter a slot call in thread A.
+ * - Thread B destroys the object, which of course disconnects it from any
+ * future slot calls.
+ * - Thread A's call uses 'this', which now refers to a defunct object.
+ * Undefined behavior results.
+ * * Call during destruction
+ * - @c MySubclass is derived from LLEventTrackable.
+ * - @c MySubclass registers one of its own methods using
+ * <tt>LLEventPump::listen()</tt>.
+ * - The @c MySubclass object begins destruction. <tt>~MySubclass()</tt>
+ * runs, destroying state specific to the subclass. (For instance, a
+ * <tt>Foo*</tt> data member is <tt>delete</tt>d but not zeroed.)
+ * - The listening method will not be disconnected until
+ * <tt>~LLEventTrackable()</tt> runs.
+ * - Before we get there, another thread posts data to the @c LLEventPump
+ * instance, calling the @c MySubclass method.
+ * - The method in question relies on valid @c MySubclass state. (For
+ * instance, it attempts to dereference the <tt>Foo*</tt> pointer that was
+ * <tt>delete</tt>d but not zeroed.)
+ * - Undefined behavior results.
+ * If you suspect you may encounter any such scenario, you're better off
+ * managing the lifespan of your object with <tt>boost::shared_ptr</tt>.
+ * Passing <tt>LLEventPump::listen()</tt> a <tt>boost::bind()</tt> expression
+ * involving a <tt>boost::weak_ptr<Foo></tt> is recognized specially, engaging
+ * thread-safe Boost.Signals2 machinery.
+ */
+typedef boost::signals2::trackable LLEventTrackable;
+
+/*****************************************************************************
+* LLEventPump
+*****************************************************************************/
+/**
+ * LLEventPump is the base class interface through which we access the
+ * concrete subclasses LLEventStream and LLEventQueue.
+ *
+ * @NOTE
+ * LLEventPump derives from LLEventTrackable so that when you "chain"
+ * LLEventPump instances together, they will automatically disconnect on
+ * destruction. Please see LLEventTrackable documentation for situations in
+ * which this may be perilous across threads.
+ */
+class LL_COMMON_API LLEventPump: public LLEventTrackable
+{
+public:
+ /**
+ * Exception thrown by LLEventPump(). You are trying to instantiate an
+ * LLEventPump (subclass) using the same name as some other instance, and
+ * you didn't pass <tt>tweak=true</tt> to permit it to generate a unique
+ * variant.
+ */
+ struct DupPumpName: public std::runtime_error
+ {
+ DupPumpName(const std::string& what):
+ std::runtime_error(std::string("DupPumpName: ") + what) {}
+ };
+
+ /**
+ * Instantiate an LLEventPump (subclass) with the string name by which it
+ * can be found using LLEventPumps::obtain().
+ *
+ * If you pass (or default) @a tweak to @c false, then a duplicate name
+ * will throw DupPumpName. This won't happen if LLEventPumps::obtain()
+ * instantiates the LLEventPump, because obtain() uses find-or-create
+ * logic. It can only happen if you instantiate an LLEventPump in your own
+ * code -- and a collision with the name of some other LLEventPump is
+ * likely to cause much more subtle problems!
+ *
+ * When you hand-instantiate an LLEventPump, consider passing @a tweak as
+ * @c true. This directs LLEventPump() to append a suffix to the passed @a
+ * name to make it unique. You can retrieve the adjusted name by calling
+ * getName() on your new instance.
+ */
+ LLEventPump(const std::string& name, bool tweak=false);
+ virtual ~LLEventPump();
+
+ /// group exceptions thrown by listen(). We use exceptions because these
+ /// particular errors are likely to be coding errors, found and fixed by
+ /// the developer even before preliminary checkin.
+ struct ListenError: public std::runtime_error
+ {
+ ListenError(const std::string& what): std::runtime_error(what) {}
+ };
+ /**
+ * exception thrown by listen(). You are attempting to register a
+ * listener on this LLEventPump using the same listener name as an
+ * already-registered listener.
+ */
+ struct DupListenerName: public ListenError
+ {
+ DupListenerName(const std::string& what):
+ ListenError(std::string("DupListenerName: ") + what)
+ {}
+ };
+ /**
+ * exception thrown by listen(). The order dependencies specified for your
+ * listener are incompatible with existing listeners.
+ *
+ * Consider listener "a" which specifies before "b" and "b" which
+ * specifies before "c". You are now attempting to register "c" before
+ * "a". There is no order that can satisfy all constraints.
+ */
+ struct Cycle: public ListenError
+ {
+ Cycle(const std::string& what): ListenError(std::string("Cycle: ") + what) {}
+ };
+ /**
+ * exception thrown by listen(). This one means that your new listener
+ * would force a change to the order of previously-registered listeners,
+ * and we don't have a good way to implement that.
+ *
+ * Consider listeners "some", "other" and "third". "some" and "other" are
+ * registered earlier without specifying relative order, so "other"
+ * happens to be first. Now you attempt to register "third" after "some"
+ * and before "other". Whoops, that would require swapping "some" and
+ * "other", which we can't do. Instead we throw this exception.
+ *
+ * It may not be possible to change the registration order so we already
+ * know "third"s order requirement by the time we register the second of
+ * "some" and "other". A solution would be to specify that "some" must
+ * come before "other", or equivalently that "other" must come after
+ * "some".
+ */
+ struct OrderChange: public ListenError
+ {
+ OrderChange(const std::string& what): ListenError(std::string("OrderChange: ") + what) {}
+ };
+
+ /// used by listen()
+ typedef std::vector<std::string> NameList;
+ /// convenience placeholder for when you explicitly want to pass an empty
+ /// NameList
+ const static NameList empty;
+
+ /// Get this LLEventPump's name
+ std::string getName() const { return mName; }
+
+ /**
+ * Register a new listener with a unique name. Specify an optional list
+ * of other listener names after which this one must be called, likewise
+ * an optional list of other listener names before which this one must be
+ * called. The other listeners mentioned need not yet be registered
+ * themselves. listen() can throw any ListenError; see ListenError
+ * subclasses.
+ *
+ * The listener name must be unique among active listeners for this
+ * LLEventPump, else you get DupListenerName. If you don't care to invent
+ * a name yourself, use inventName(). (I was tempted to recognize e.g. ""
+ * and internally generate a distinct name for that case. But that would
+ * handle badly the scenario in which you want to add, remove, re-add,
+ * etc. the same listener: each new listen() call would necessarily
+ * perform a new dependency sort. Assuming you specify the same
+ * after/before lists each time, using inventName() when you first
+ * instantiate your listener, then passing the same name on each listen()
+ * call, allows us to optimize away the second and subsequent dependency
+ * sorts.
+ *
+ * If (as is typical) you pass a <tt>boost::bind()</tt> expression as @a
+ * listener, listen() will inspect the components of that expression. If a
+ * bound object matches any of several cases, the connection will
+ * automatically be disconnected when that object is destroyed.
+ *
+ * * You bind a <tt>boost::weak_ptr</tt>.
+ * * Binding a <tt>boost::shared_ptr</tt> that way would ensure that the
+ * referenced object would @em never be destroyed, since the @c
+ * shared_ptr stored in the LLEventPump would remain an outstanding
+ * reference. Use the weaken() function to convert your @c shared_ptr to
+ * @c weak_ptr. Because this is easy to forget, binding a @c shared_ptr
+ * will produce a compile error (@c BOOST_STATIC_ASSERT failure).
+ * * You bind a simple pointer or reference to an object derived from
+ * <tt>boost::enable_shared_from_this</tt>. (UNDER CONSTRUCTION)
+ * * You bind a simple pointer or reference to an object derived from
+ * LLEventTrackable. Unlike the cases described above, though, this is
+ * vulnerable to a couple of cross-thread race conditions, as described
+ * in the LLEventTrackable documentation.
+ */
+ template <typename LISTENER>
+ LLBoundListener listen(const std::string& name, const LISTENER& listener,
+ const NameList& after=NameList(),
+ const NameList& before=NameList())
+ {
+ // Examine listener, using our listen_impl() method to make the
+ // actual connection.
+ // This is why listen() is a template. Conversion from boost::bind()
+ // to LLEventListener performs type erasure, so it's important to look
+ // at the boost::bind object itself before that happens.
+ return LLEventDetail::visit_and_connect(listener,
+ boost::bind(&LLEventPump::listen_impl,
+ this,
+ name,
+ _1,
+ after,
+ before));
+ }
+
+ /// Get the LLBoundListener associated with the passed name (dummy
+ /// LLBoundListener if not found)
+ virtual LLBoundListener getListener(const std::string& name) const;
+ /**
+ * Instantiate one of these to block an existing connection:
+ * @code
+ * { // in some local scope
+ * LLEventPump::Blocker block(someLLBoundListener);
+ * // code that needs the connection blocked
+ * } // unblock the connection again
+ * @endcode
+ */
+ typedef boost::signals2::shared_connection_block Blocker;
+ /// Unregister a listener by name. Prefer this to
+ /// <tt>getListener(name).disconnect()</tt> because stopListening() also
+ /// forgets this name.
+ virtual void stopListening(const std::string& name);
+ /// Post an event to all listeners. The @c bool return is only meaningful
+ /// if the underlying leaf class is LLEventStream -- beware of relying on
+ /// it too much! Truthfully, we return @c bool mostly to permit chaining
+ /// one LLEventPump as a listener on another.
+ virtual bool post(const LLSD&) = 0;
+ /// Enable/disable: while disabled, silently ignore all post() calls
+ virtual void enable(bool enabled=true) { mEnabled = enabled; }
+ /// query
+ virtual bool enabled() const { return mEnabled; }
+
+ /// Generate a distinct name for a listener -- see listen()
+ static std::string inventName(const std::string& pfx="listener");
+
+private:
+ friend class LLEventPumps;
+ /// flush queued events
+ virtual void flush() {}
+
+private:
+ virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&,
+ const NameList& after,
+ const NameList& before);
+ std::string mName;
+
+protected:
+ /// implement the dispatching
+ LLStandardSignal mSignal;
+ /// valve open?
+ bool mEnabled;
+ /// Map of named listeners. This tracks the listeners that actually exist
+ /// at this moment. When we stopListening(), we discard the entry from
+ /// this map.
+ typedef std::map<std::string, boost::signals2::connection> ConnectionMap;
+ ConnectionMap mConnections;
+ typedef LLDependencies<std::string, float> DependencyMap;
+ /// Dependencies between listeners. For each listener, track the float
+ /// used to establish its place in mSignal's order. This caches all the
+ /// listeners that have ever registered; stopListening() does not discard
+ /// the entry from this map. This is to avoid a new dependency sort if the
+ /// same listener with the same dependencies keeps hopping on and off this
+ /// LLEventPump.
+ DependencyMap mDeps;
+};
+
+/*****************************************************************************
+* LLEventStream
+*****************************************************************************/
+/**
+ * LLEventStream is a thin wrapper around LLStandardSignal. Posting an
+ * event immediately calls all registered listeners.
+ */
+class LL_COMMON_API LLEventStream: public LLEventPump
+{
+public:
+ LLEventStream(const std::string& name, bool tweak=false): LLEventPump(name, tweak) {}
+ virtual ~LLEventStream() {}
+
+ /// Post an event to all listeners
+ virtual bool post(const LLSD& event);
+};
+
+/*****************************************************************************
+* LLEventQueue
+*****************************************************************************/
+/**
+ * LLEventQueue isa LLEventPump whose post() method defers calling registered
+ * listeners until flush() is called.
+ */
+class LL_COMMON_API LLEventQueue: public LLEventPump
+{
+public:
+ LLEventQueue(const std::string& name, bool tweak=false): LLEventPump(name, tweak) {}
+ virtual ~LLEventQueue() {}
+
+ /// Post an event to all listeners
+ virtual bool post(const LLSD& event);
+
+private:
+ /// flush queued events
+ virtual void flush();
+
+private:
+ typedef std::deque<LLSD> EventQueue;
+ EventQueue mEventQueue;
+};
+
+/*****************************************************************************
+* LLReqID
+*****************************************************************************/
+/**
+ * This class helps the implementer of a given event API to honor the
+ * ["reqid"] convention. By this convention, each event API stamps into its
+ * response LLSD a ["reqid"] key whose value echoes the ["reqid"] value, if
+ * any, from the corresponding request.
+ *
+ * This supports an (atypical, but occasionally necessary) use case in which
+ * two or more asynchronous requests are multiplexed onto the same ["reply"]
+ * LLEventPump. Since the response events could arrive in arbitrary order, the
+ * caller must be able to demux them. It does so by matching the ["reqid"]
+ * value in each response with the ["reqid"] value in the corresponding
+ * request.
+ *
+ * It is the caller's responsibility to ensure distinct ["reqid"] values for
+ * that case. Though LLSD::UUID is guaranteed to work, it might be overkill:
+ * the "namespace" of unique ["reqid"] values is simply the set of requests
+ * specifying the same ["reply"] LLEventPump name.
+ *
+ * Making a given event API echo the request's ["reqid"] into the response is
+ * nearly trivial. This helper is mostly for mnemonic purposes, to serve as a
+ * place to put these comments. We hope that each time a coder implements a
+ * new event API based on some existing one, s/he will say, "Huh, what's an
+ * LLReqID?" and look up this material.
+ *
+ * The hardest part about the convention is deciding where to store the
+ * ["reqid"] value. Ironically, LLReqID can't help with that: you must store
+ * an LLReqID instance in whatever storage will persist until the reply is
+ * sent. For example, if the request ultimately ends up using a Responder
+ * subclass, storing an LLReqID instance in the Responder works.
+ *
+ * @note
+ * The @em implementer of an event API must honor the ["reqid"] convention.
+ * However, the @em caller of an event API need only use it if s/he is sharing
+ * the same ["reply"] LLEventPump for two or more asynchronous event API
+ * requests.
+ *
+ * In most cases, it's far easier for the caller to instantiate a local
+ * LLEventStream and pass its name to the event API in question. Then it's
+ * perfectly reasonable not to set a ["reqid"] key in the request, ignoring
+ * the @c isUndefined() ["reqid"] value in the response.
+ */
+class LL_COMMON_API LLReqID
+{
+public:
+ /**
+ * If you have the request in hand at the time you instantiate the
+ * LLReqID, pass that request to extract its ["reqid"].
+ */
+ LLReqID(const LLSD& request):
+ mReqid(request["reqid"])
+ {}
+ /// If you don't yet have the request, use setFrom() later.
+ LLReqID() {}
+
+ /// Extract and store the ["reqid"] value from an incoming request.
+ void setFrom(const LLSD& request)
+ {
+ mReqid = request["reqid"];
+ }
+
+ /// Set ["reqid"] key into a pending response LLSD object.
+ void stamp(LLSD& response) const;
+
+ /// Make a whole new response LLSD object with our ["reqid"].
+ LLSD makeResponse() const
+ {
+ LLSD response;
+ stamp(response);
+ return response;
+ }
+
+ /// Not really sure of a use case for this accessor...
+ LLSD getReqID() const { return mReqid; }
+
+private:
+ LLSD mReqid;
+};
+
+/*****************************************************************************
+* Underpinnings
+*****************************************************************************/
+/**
+ * We originally provided a suite of overloaded
+ * LLEventTrackable::listenTo(LLEventPump&, ...) methods that would call
+ * LLEventPump::listen(...) and then pass the returned LLBoundListener to
+ * LLEventTrackable::track(). This was workable but error-prone: the coder
+ * must remember to call listenTo() rather than the more straightforward
+ * listen() method.
+ *
+ * Now we publish only the single canonical listen() method, so there's a
+ * uniform mechanism. Having a single way to do this is good, in that there's
+ * no question in the coder's mind which of several alternatives to choose.
+ *
+ * To support automatic connection management, we use boost::visit_each
+ * (http://www.boost.org/doc/libs/1_37_0/doc/html/boost/visit_each.html) to
+ * inspect each argument of a boost::bind expression. (Although the visit_each
+ * mechanism was first introduced with the original Boost.Signals library, it
+ * was only later documented.)
+ *
+ * Cases:
+ * * At least one of the function's arguments is a boost::weak_ptr<T>. Pass
+ * the corresponding shared_ptr to slot_type::track(). Ideally that would be
+ * the object whose method we want to call, but in fact we do the same for
+ * any weak_ptr we might find among the bound arguments. If we're passing
+ * our bound method a weak_ptr to some object, wouldn't the destruction of
+ * that object invalidate the call? So we disconnect automatically when any
+ * such object is destroyed. This is the mechanism preferred by boost::
+ * signals2.
+ * * One of the functions's arguments is a boost::shared_ptr<T>. This produces
+ * a compile error: the bound copy of the shared_ptr stored in the
+ * boost_bind object stored in the signal object would make the referenced
+ * T object immortal. We provide a weaken() function. Pass
+ * weaken(your_shared_ptr) instead. (We can inspect, but not modify, the
+ * boost::bind object. Otherwise we'd replace the shared_ptr with weak_ptr
+ * implicitly and just proceed.)
+ * * One of the function's arguments is a plain pointer/reference to an object
+ * derived from boost::enable_shared_from_this. We assume that this object
+ * is managed using boost::shared_ptr, so we implicitly extract a shared_ptr
+ * and track that. (UNDER CONSTRUCTION)
+ * * One of the function's arguments is derived from LLEventTrackable. Pass
+ * the LLBoundListener to its LLEventTrackable::track(). This is vulnerable
+ * to a couple different race conditions, as described in LLEventTrackable
+ * documentation. (NOTE: Now that LLEventTrackable is a typedef for
+ * boost::signals2::trackable, the Signals2 library handles this itself, so
+ * our visitor needs no special logic for this case.)
+ * * Any other argument type is irrelevant to automatic connection management.
+ */
+
+namespace LLEventDetail
+{
+ template <typename F>
+ const F& unwrap(const F& f) { return f; }
+
+ template <typename F>
+ const F& unwrap(const boost::reference_wrapper<F>& f) { return f.get(); }
+
+ // Most of the following is lifted from the Boost.Signals use of
+ // visit_each.
+ template<bool Cond> struct truth {};
+
+ /**
+ * boost::visit_each() Visitor, used on a template argument <tt>const F&
+ * f</tt> as follows (see visit_and_connect()):
+ * @code
+ * LLEventListener listener(f);
+ * Visitor visitor(listener); // bind listener so it can track() shared_ptrs
+ * using boost::visit_each; // allow unqualified visit_each() call for ADL
+ * visit_each(visitor, unwrap(f));
+ * @endcode
+ */
+ class Visitor
+ {
+ public:
+ /**
+ * Visitor binds a reference to LLEventListener so we can track() any
+ * shared_ptrs we find in the argument list.
+ */
+ Visitor(LLEventListener& listener):
+ mListener(listener)
+ {
+ }
+
+ /**
+ * boost::visit_each() calls this method for each component of a
+ * boost::bind() expression.
+ */
+ template <typename T>
+ void operator()(const T& t) const
+ {
+ decode(t, 0);
+ }
+
+ private:
+ // decode() decides between a reference wrapper and anything else
+ // boost::ref() variant
+ template<typename T>
+ void decode(const boost::reference_wrapper<T>& t, int) const
+ {
+// add_if_trackable(t.get_pointer());
+ }
+
+ // decode() anything else
+ template<typename T>
+ void decode(const T& t, long) const
+ {
+ typedef truth<(boost::is_pointer<T>::value)> is_a_pointer;
+ maybe_get_pointer(t, is_a_pointer());
+ }
+
+ // maybe_get_pointer() decides between a pointer and a non-pointer
+ // plain pointer variant
+ template<typename T>
+ void maybe_get_pointer(const T& t, truth<true>) const
+ {
+// add_if_trackable(t);
+ }
+
+ // shared_ptr variant
+ template<typename T>
+ void maybe_get_pointer(const boost::shared_ptr<T>& t, truth<false>) const
+ {
+ // If we have a shared_ptr to this object, it doesn't matter
+ // whether the object is derived from LLEventTrackable, so no
+ // further analysis of T is needed.
+// mListener.track(t);
+
+ // Make this case illegal. Passing a bound shared_ptr to
+ // slot_type::track() is useless, since the bound shared_ptr will
+ // keep the object alive anyway! Force the coder to cast to weak_ptr.
+
+ // Trivial as it is, make the BOOST_STATIC_ASSERT() condition
+ // dependent on template param so the macro is only evaluated if
+ // this method is in fact instantiated, as described here:
+ // http://www.boost.org/doc/libs/1_34_1/doc/html/boost_staticassert.html
+
+ // ATTENTION: Don't bind a shared_ptr<anything> using
+ // LLEventPump::listen(boost::bind()). Doing so captures a copy of
+ // the shared_ptr, making the referenced object effectively
+ // immortal. Use the weaken() function, e.g.:
+ // somepump.listen(boost::bind(...weaken(my_shared_ptr)...));
+ // This lets us automatically disconnect when the referenced
+ // object is destroyed.
+ BOOST_STATIC_ASSERT(sizeof(T) == 0);
+ }
+
+ // weak_ptr variant
+ template<typename T>
+ void maybe_get_pointer(const boost::weak_ptr<T>& t, truth<false>) const
+ {
+ // If we have a weak_ptr to this object, it doesn't matter
+ // whether the object is derived from LLEventTrackable, so no
+ // further analysis of T is needed.
+ mListener.track(t);
+// std::cout << "Found weak_ptr<" << typeid(T).name() << ">!\n";
+ }
+
+#if 0
+ // reference to anything derived from boost::enable_shared_from_this
+ template <typename T>
+ inline void maybe_get_pointer(const boost::enable_shared_from_this<T>& ct,
+ truth<false>) const
+ {
+ // Use the slot_type::track(shared_ptr) mechanism. Cast away
+ // const-ness because (in our code base anyway) it's unusual
+ // to find shared_ptr<const T>.
+ boost::enable_shared_from_this<T>&
+ t(const_cast<boost::enable_shared_from_this<T>&>(ct));
+ std::cout << "Capturing shared_from_this()" << std::endl;
+ boost::shared_ptr<T> sp(t.shared_from_this());
+/*==========================================================================*|
+ std::cout << "Capturing weak_ptr" << std::endl;
+ boost::weak_ptr<T> wp(sp);
+|*==========================================================================*/
+ std::cout << "Tracking shared__ptr" << std::endl;
+ mListener.track(sp);
+ }
+#endif
+
+ // non-pointer variant
+ template<typename T>
+ void maybe_get_pointer(const T& t, truth<false>) const
+ {
+ // Take the address of this object, because the object itself may be
+ // trackable
+// add_if_trackable(boost::addressof(t));
+ }
+
+/*==========================================================================*|
+ // add_if_trackable() adds LLEventTrackable objects to mTrackables
+ inline void add_if_trackable(const LLEventTrackable* t) const
+ {
+ if (t)
+ {
+ }
+ }
+
+ // pointer to anything not an LLEventTrackable subclass
+ inline void add_if_trackable(const void*) const
+ {
+ }
+
+ // pointer to free function
+ // The following construct uses the preprocessor to generate
+ // add_if_trackable() overloads accepting pointer-to-function taking
+ // 0, 1, ..., LLEVENTS_LISTENER_ARITY parameters of arbitrary type.
+#define BOOST_PP_LOCAL_MACRO(n) \
+ template <typename R \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_PP_ENUM_PARAMS(n, typename T)> \
+ inline void \
+ add_if_trackable(R (*)(BOOST_PP_ENUM_PARAMS(n, T))) const \
+ { \
+ }
+#define BOOST_PP_LOCAL_LIMITS (0, LLEVENTS_LISTENER_ARITY)
+#include BOOST_PP_LOCAL_ITERATE()
+#undef BOOST_PP_LOCAL_MACRO
+#undef BOOST_PP_LOCAL_LIMITS
+|*==========================================================================*/
+
+ /// Bind a reference to the LLEventListener to call its track() method.
+ LLEventListener& mListener;
+ };
+
+ /**
+ * Utility template function to use Visitor appropriately
+ *
+ * @param raw_listener Callable to connect, typically a boost::bind()
+ * expression. This will be visited by Visitor using boost::visit_each().
+ * @param connect_funct Callable that will connect() @a raw_listener to an
+ * LLStandardSignal, returning LLBoundListener.
+ */
+ template <typename LISTENER>
+ LLBoundListener visit_and_connect(const LISTENER& raw_listener,
+ const ConnectFunc& connect_func)
+ {
+ // Capture the listener
+ LLEventListener listener(raw_listener);
+ // Define our Visitor, binding the listener so we can call
+ // listener.track() if we discover any shared_ptr<Foo>.
+ LLEventDetail::Visitor visitor(listener);
+ // Allow unqualified visit_each() call for ADL
+ using boost::visit_each;
+ // Visit each component of a boost::bind() expression. Pass
+ // 'raw_listener', our template argument, rather than 'listener' from
+ // which type details have been erased. unwrap() comes from
+ // Boost.Signals, in case we were passed a boost::ref().
+ visit_each(visitor, LLEventDetail::unwrap(raw_listener));
+ // Make the connection using passed function. At present, wrapping
+ // this functionality into this function is a bit silly: we don't
+ // really need a visit_and_connect() function any more, just a visit()
+ // function. The definition of this function dates from when, after
+ // visit_each(), after establishing the connection, we had to
+ // postprocess the new connection with the visitor object. That's no
+ // longer necessary.
+ return connect_func(listener);
+ }
+} // namespace LLEventDetail
+
+// Somewhat to my surprise, passing boost::bind(...boost::weak_ptr<T>...) to
+// listen() fails in Boost code trying to instantiate LLEventListener (i.e.
+// LLStandardSignal::slot_type) because the boost::get_pointer() utility function isn't
+// specialized for boost::weak_ptr. This remedies that omission.
+namespace boost
+{
+ template <typename T>
+ T* get_pointer(const weak_ptr<T>& ptr) { return shared_ptr<T>(ptr).get(); }
+}
+
+/// Since we forbid use of listen(boost::bind(...shared_ptr<T>...)), provide an
+/// easy way to cast to the corresponding weak_ptr.
+template <typename T>
+boost::weak_ptr<T> weaken(const boost::shared_ptr<T>& ptr)
+{
+ return boost::weak_ptr<T>(ptr);
+}
+
+#endif /* ! defined(LL_LLEVENTS_H) */
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 0d89353dee..6ea9762546 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -1,244 +1,244 @@
-/**
- * @file llfasttimer.h
- * @brief Declaration of a fast timer.
- *
- * $LicenseInfo:firstyear=2004&license=viewergpl$
- *
- * Copyright (c) 2004-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-#ifndef LL_FASTTIMER_H
-#define LL_FASTTIMER_H
-
-#include "llinstancetracker.h"
-
-#define FAST_TIMER_ON 1
-
-U64 get_cpu_clock_count();
-
-class LLMutex;
-
-#include <queue>
-#include "llsd.h"
-
-
-class LLFastTimer
-{
-public:
- // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances
- class NamedTimer
- : public LLInstanceTracker<NamedTimer>
- {
- public:
- ~NamedTimer();
-
- enum { HISTORY_NUM = 60 };
-
- const std::string& getName() { return mName; }
- NamedTimer* getParent() { return mParent; }
- void setParent(NamedTimer* parent);
- S32 getDepth();
- std::string getToolTip(S32 history_index = -1);
-
- typedef std::vector<NamedTimer*>::const_iterator child_const_iter;
- child_const_iter beginChildren();
- child_const_iter endChildren();
- std::vector<NamedTimer*>& getChildren();
-
- void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
- bool getCollapsed() const { return mCollapsed; }
-
- U64 getCountAverage() const { return mCountAverage; }
- U64 getCallAverage() const { return mCallAverage; }
-
- U64 getHistoricalCount(S32 history_index = 0) const;
- U64 getHistoricalCalls(S32 history_index = 0) const;
-
- static NamedTimer& getRootNamedTimer();
-
- struct FrameState
- {
- FrameState(NamedTimer* timerp);
-
- U64 mSelfTimeCounter;
- U64 mLastStartTime; // most recent time when this timer was started
- U32 mCalls;
- FrameState* mParent; // info for caller timer
- FrameState* mLastCaller; // used to bootstrap tree construction
- NamedTimer* mTimer;
- U16 mActiveCount; // number of timers with this ID active on stack
- bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame
- };
-
- FrameState& getFrameStateFast() const
- {
- return (*sTimerInfos)[mFrameStateIndex];
- }
-
- S32 getFrameStateIndex() const { return mFrameStateIndex; }
-
- FrameState& getFrameState() const;
-
-
- private:
- friend class LLFastTimer;
- friend class NamedTimerFactory;
-
- //
- // methods
- //
- NamedTimer(const std::string& name);
- // recursive call to gather total time from children
- static void accumulateTimings();
-
- // called once per frame by LLFastTimer
- static void processFrame();
-
- static void buildHierarchy();
- static void resetFrame();
- static void reset();
-
- typedef std::vector<FrameState> info_list_t;
- static info_list_t& getFrameStateList();
- static void createFrameStateList(); // must call before any call to getFrameStateList()
-
- //
- // members
- //
- S32 mFrameStateIndex;
-
- std::string mName;
-
- U64 mTotalTimeCounter;
-
- U64 mCountAverage;
- U64 mCallAverage;
-
- U64* mCountHistory;
- U64* mCallHistory;
-
- // tree structure
- NamedTimer* mParent; // NamedTimer of caller(parent)
- std::vector<NamedTimer*> mChildren;
- bool mCollapsed; // don't show children
- bool mNeedsSorting; // sort children whenever child added
-
- static info_list_t* sTimerInfos;
- };
-
- // used to statically declare a new named timer
- class DeclareTimer
- {
- public:
- DeclareTimer(const std::string& name, bool open);
- DeclareTimer(const std::string& name);
-
- // convertable to NamedTimer::FrameState for convenient usage of LLFastTimer(declared_timer)
- operator NamedTimer::FrameState&() { return mNamedTimer.getFrameStateFast(); }
- private:
- NamedTimer& mNamedTimer;
- };
-
-
-public:
- enum RootTimerMarker { ROOT };
-
- static LLMutex* sLogLock;
- static std::queue<LLSD> sLogQueue;
- static BOOL sLog;
- static BOOL sMetricLog;
-
- LLFastTimer(RootTimerMarker);
-
- LLFastTimer(NamedTimer::FrameState& timer)
- : mFrameState(&timer)
- {
-#if FAST_TIMER_ON
- NamedTimer::FrameState* frame_state = mFrameState;
- frame_state->mLastStartTime = get_cpu_clock_count();
- mStartSelfTime = frame_state->mLastStartTime;
-
- frame_state->mActiveCount++;
- frame_state->mCalls++;
- // keep current parent as long as it is active when we are
- frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0);
-
- mLastTimer = sCurTimer;
- sCurTimer = this;
-#endif
- }
-
- ~LLFastTimer()
- {
-#if FAST_TIMER_ON
- NamedTimer::FrameState* frame_state = mFrameState;
- U64 cur_time = get_cpu_clock_count();
- frame_state->mSelfTimeCounter += cur_time - mStartSelfTime;
-
- frame_state->mActiveCount--;
- LLFastTimer* last_timer = mLastTimer;
- sCurTimer = last_timer;
-
- // store last caller to bootstrap tree creation
- frame_state->mLastCaller = last_timer->mFrameState;
-
- // we are only tracking self time, so subtract our total time delta from parents
- U64 total_time = cur_time - frame_state->mLastStartTime;
- last_timer->mStartSelfTime += total_time;
-#endif
- }
-
-
- // call this once a frame to reset timers
- static void nextFrame();
-
- // call this to reset timer hierarchy, averages, etc.
- static void reset();
-
- static U64 countsPerSecond();
- static S32 getLastFrameIndex() { return sLastFrameIndex; }
- static S32 getCurFrameIndex() { return sCurFrameIndex; }
-
- static void writeLog(std::ostream& os);
- static const NamedTimer* getTimerByName(const std::string& name);
-
-public:
- static bool sPauseHistory;
- static bool sResetHistory;
-
-private:
- typedef std::vector<LLFastTimer*> timer_stack_t;
- static LLFastTimer* sCurTimer;
- static S32 sCurFrameIndex;
- static S32 sLastFrameIndex;
-
- static F64 sCPUClockFrequency;
- U64 mStartSelfTime; // start time + time of all child timers
- NamedTimer::FrameState* mFrameState;
- LLFastTimer* mLastTimer;
-};
-
-#endif // LL_LLFASTTIMER_H
+/**
+ * @file llfasttimer.h
+ * @brief Declaration of a fast timer.
+ *
+ * $LicenseInfo:firstyear=2004&license=viewergpl$
+ *
+ * Copyright (c) 2004-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_FASTTIMER_H
+#define LL_FASTTIMER_H
+
+#include "llinstancetracker.h"
+
+#define FAST_TIMER_ON 1
+
+LL_COMMON_API U64 get_cpu_clock_count();
+
+class LLMutex;
+
+#include <queue>
+#include "llsd.h"
+
+
+class LL_COMMON_API LLFastTimer
+{
+public:
+ // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances
+ class LL_COMMON_API NamedTimer
+ : public LLInstanceTracker<NamedTimer>
+ {
+ public:
+ ~NamedTimer();
+
+ enum { HISTORY_NUM = 60 };
+
+ const std::string& getName() { return mName; }
+ NamedTimer* getParent() { return mParent; }
+ void setParent(NamedTimer* parent);
+ S32 getDepth();
+ std::string getToolTip(S32 history_index = -1);
+
+ typedef std::vector<NamedTimer*>::const_iterator child_const_iter;
+ child_const_iter beginChildren();
+ child_const_iter endChildren();
+ std::vector<NamedTimer*>& getChildren();
+
+ void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
+ bool getCollapsed() const { return mCollapsed; }
+
+ U64 getCountAverage() const { return mCountAverage; }
+ U64 getCallAverage() const { return mCallAverage; }
+
+ U64 getHistoricalCount(S32 history_index = 0) const;
+ U64 getHistoricalCalls(S32 history_index = 0) const;
+
+ static NamedTimer& getRootNamedTimer();
+
+ struct FrameState
+ {
+ FrameState(NamedTimer* timerp);
+
+ U64 mSelfTimeCounter;
+ U64 mLastStartTime; // most recent time when this timer was started
+ U32 mCalls;
+ FrameState* mParent; // info for caller timer
+ FrameState* mLastCaller; // used to bootstrap tree construction
+ NamedTimer* mTimer;
+ U16 mActiveCount; // number of timers with this ID active on stack
+ bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame
+ };
+
+ FrameState& getFrameStateFast() const
+ {
+ return (*sTimerInfos)[mFrameStateIndex];
+ }
+
+ S32 getFrameStateIndex() const { return mFrameStateIndex; }
+
+ FrameState& getFrameState() const;
+
+
+ private:
+ friend class LLFastTimer;
+ friend class NamedTimerFactory;
+
+ //
+ // methods
+ //
+ NamedTimer(const std::string& name);
+ // recursive call to gather total time from children
+ static void accumulateTimings();
+
+ // called once per frame by LLFastTimer
+ static void processFrame();
+
+ static void buildHierarchy();
+ static void resetFrame();
+ static void reset();
+
+ typedef std::vector<FrameState> info_list_t;
+ static info_list_t& getFrameStateList();
+ static void createFrameStateList(); // must call before any call to getFrameStateList()
+
+ //
+ // members
+ //
+ S32 mFrameStateIndex;
+
+ std::string mName;
+
+ U64 mTotalTimeCounter;
+
+ U64 mCountAverage;
+ U64 mCallAverage;
+
+ U64* mCountHistory;
+ U64* mCallHistory;
+
+ // tree structure
+ NamedTimer* mParent; // NamedTimer of caller(parent)
+ std::vector<NamedTimer*> mChildren;
+ bool mCollapsed; // don't show children
+ bool mNeedsSorting; // sort children whenever child added
+
+ static info_list_t* sTimerInfos;
+ };
+
+ // used to statically declare a new named timer
+ class LL_COMMON_API DeclareTimer
+ {
+ public:
+ DeclareTimer(const std::string& name, bool open);
+ DeclareTimer(const std::string& name);
+
+ // convertable to NamedTimer::FrameState for convenient usage of LLFastTimer(declared_timer)
+ operator NamedTimer::FrameState&() { return mNamedTimer.getFrameStateFast(); }
+ private:
+ NamedTimer& mNamedTimer;
+ };
+
+
+public:
+ enum RootTimerMarker { ROOT };
+
+ static LLMutex* sLogLock;
+ static std::queue<LLSD> sLogQueue;
+ static BOOL sLog;
+ static BOOL sMetricLog;
+
+ LLFastTimer(RootTimerMarker);
+
+ LLFastTimer(NamedTimer::FrameState& timer)
+ : mFrameState(&timer)
+ {
+#if FAST_TIMER_ON
+ NamedTimer::FrameState* frame_state = mFrameState;
+ frame_state->mLastStartTime = get_cpu_clock_count();
+ mStartSelfTime = frame_state->mLastStartTime;
+
+ frame_state->mActiveCount++;
+ frame_state->mCalls++;
+ // keep current parent as long as it is active when we are
+ frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0);
+
+ mLastTimer = sCurTimer;
+ sCurTimer = this;
+#endif
+ }
+
+ ~LLFastTimer()
+ {
+#if FAST_TIMER_ON
+ NamedTimer::FrameState* frame_state = mFrameState;
+ U64 cur_time = get_cpu_clock_count();
+ frame_state->mSelfTimeCounter += cur_time - mStartSelfTime;
+
+ frame_state->mActiveCount--;
+ LLFastTimer* last_timer = mLastTimer;
+ sCurTimer = last_timer;
+
+ // store last caller to bootstrap tree creation
+ frame_state->mLastCaller = last_timer->mFrameState;
+
+ // we are only tracking self time, so subtract our total time delta from parents
+ U64 total_time = cur_time - frame_state->mLastStartTime;
+ last_timer->mStartSelfTime += total_time;
+#endif
+ }
+
+
+ // call this once a frame to reset timers
+ static void nextFrame();
+
+ // call this to reset timer hierarchy, averages, etc.
+ static void reset();
+
+ static U64 countsPerSecond();
+ static S32 getLastFrameIndex() { return sLastFrameIndex; }
+ static S32 getCurFrameIndex() { return sCurFrameIndex; }
+
+ static void writeLog(std::ostream& os);
+ static const NamedTimer* getTimerByName(const std::string& name);
+
+public:
+ static bool sPauseHistory;
+ static bool sResetHistory;
+
+private:
+ typedef std::vector<LLFastTimer*> timer_stack_t;
+ static LLFastTimer* sCurTimer;
+ static S32 sCurFrameIndex;
+ static S32 sLastFrameIndex;
+
+ static F64 sCPUClockFrequency;
+ U64 mStartSelfTime; // start time + time of all child timers
+ NamedTimer::FrameState* mFrameState;
+ LLFastTimer* mLastTimer;
+};
+
+#endif // LL_LLFASTTIMER_H
diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h
index c6092f7b9c..fea5d3ed2b 100644
--- a/indra/llcommon/llfile.h
+++ b/indra/llcommon/llfile.h
@@ -70,7 +70,7 @@ typedef struct stat llstat;
#include "llstring.h" // safe char* -> std::string conversion
-class LLFile
+class LL_COMMON_API LLFile
{
public:
// All these functions take UTF8 path/filenames.
@@ -95,7 +95,7 @@ public:
#if USE_LLFILESTREAMS
-class llifstream : public std::basic_istream < char , std::char_traits < char > >
+class LL_COMMON_API llifstream : public std::basic_istream < char , std::char_traits < char > >
{
// input stream associated with a C stream
public:
@@ -136,7 +136,7 @@ private:
};
-class llofstream : public std::basic_ostream< char , std::char_traits < char > >
+class LL_COMMON_API llofstream : public std::basic_ostream< char , std::char_traits < char > >
{
public:
typedef std::basic_ostream< char , std::char_traits < char > > _Myt;
@@ -185,7 +185,7 @@ private:
//#define llifstream std::ifstream
//#define llofstream std::ofstream
-class llifstream : public std::ifstream
+class LL_COMMON_API llifstream : public std::ifstream
{
public:
llifstream() : std::ifstream()
@@ -203,7 +203,7 @@ public:
};
-class llofstream : public std::ofstream
+class LL_COMMON_API llofstream : public std::ofstream
{
public:
llofstream() : std::ofstream()
@@ -231,7 +231,7 @@ public:
* and should only be used for config files and the like -- not in a
* loop.
*/
-std::streamsize llifstream_size(llifstream& fstr);
-std::streamsize llofstream_size(llofstream& fstr);
+std::streamsize LL_COMMON_API llifstream_size(llifstream& fstr);
+std::streamsize LL_COMMON_API llofstream_size(llofstream& fstr);
#endif // not LL_LLFILE_H
diff --git a/indra/llcommon/llfindlocale.h b/indra/llcommon/llfindlocale.h
index f17c7740f3..b812a065db 100644
--- a/indra/llcommon/llfindlocale.h
+++ b/indra/llcommon/llfindlocale.h
@@ -59,8 +59,8 @@ typedef enum {
/* This allocates/fills in a FL_Locale structure with pointers to
strings (which should be treated as static), or NULL for inappropriate /
undetected fields. */
-FL_Success FL_FindLocale(FL_Locale **locale, FL_Domain domain);
+LL_COMMON_API FL_Success FL_FindLocale(FL_Locale **locale, FL_Domain domain);
/* This should be used to free the struct written by FL_FindLocale */
-void FL_FreeLocale(FL_Locale **locale);
+LL_COMMON_API void FL_FreeLocale(FL_Locale **locale);
#endif /*__findlocale_h_*/
diff --git a/indra/llcommon/llfixedbuffer.h b/indra/llcommon/llfixedbuffer.h
index 01b46d327a..17fdef27d7 100644
--- a/indra/llcommon/llfixedbuffer.h
+++ b/indra/llcommon/llfixedbuffer.h
@@ -41,7 +41,7 @@
#include "llerrorcontrol.h"
// fixed buffer implementation
-class LLFixedBuffer : public LLLineBuffer
+class LL_COMMON_API LLFixedBuffer : public LLLineBuffer
{
public:
LLFixedBuffer(const U32 max_lines = 20);
diff --git a/indra/llcommon/llformat.h b/indra/llcommon/llformat.h
index 44c62d9710..dc64edb26d 100644
--- a/indra/llcommon/llformat.h
+++ b/indra/llcommon/llformat.h
@@ -40,6 +40,6 @@
// *NOTE: buffer limited to 1024, (but vsnprintf prevents overrun)
// should perhaps be replaced with boost::format.
-std::string llformat(const char *fmt, ...);
+std::string LL_COMMON_API llformat(const char *fmt, ...);
#endif // LL_LLFORMAT_H
diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h
index 8f51272af2..be2d9b0703 100644
--- a/indra/llcommon/llframetimer.h
+++ b/indra/llcommon/llframetimer.h
@@ -43,7 +43,7 @@
#include "lltimer.h"
#include "timing.h"
-class LLFrameTimer
+class LL_COMMON_API LLFrameTimer
{
public:
LLFrameTimer() : mStartTime( sFrameTime ), mExpiry(0), mStarted(TRUE) {}
diff --git a/indra/llcommon/llheartbeat.h b/indra/llcommon/llheartbeat.h
index fecb5b1e54..6f7026970f 100644
--- a/indra/llcommon/llheartbeat.h
+++ b/indra/llcommon/llheartbeat.h
@@ -40,7 +40,7 @@
// Note: Win32 does not support the heartbeat/smackdown system;
// heartbeat-delivery turns into a no-op there.
-class LLHeartbeat
+class LL_COMMON_API LLHeartbeat
{
public:
// secs_between_heartbeat: after a heartbeat is successfully delivered,
diff --git a/indra/llcommon/llliveappconfig.h b/indra/llcommon/llliveappconfig.h
index a6ece6e8b3..73b3a23352 100644
--- a/indra/llcommon/llliveappconfig.h
+++ b/indra/llcommon/llliveappconfig.h
@@ -45,7 +45,7 @@
* loop. The traditional name for it is live_config. Be sure to call
* <code>live_config.checkAndReload()</code> periodically.
*/
-class LLLiveAppConfig : public LLLiveFile
+class LL_COMMON_API LLLiveAppConfig : public LLLiveFile
{
public:
diff --git a/indra/llcommon/lllivefile.h b/indra/llcommon/lllivefile.h
index 89b5d95e44..2453d7a125 100644
--- a/indra/llcommon/lllivefile.h
+++ b/indra/llcommon/lllivefile.h
@@ -36,7 +36,7 @@
extern const F32 DEFAULT_CONFIG_FILE_REFRESH;
-class LLLiveFile
+class LL_COMMON_API LLLiveFile
{
public:
LLLiveFile(const std::string& filename, const F32 refresh_period = 5.f);
diff --git a/indra/llcommon/lllog.h b/indra/llcommon/lllog.h
index 7ac6c8aa42..4b6777bb9c 100644
--- a/indra/llcommon/lllog.h
+++ b/indra/llcommon/lllog.h
@@ -41,7 +41,7 @@ class LLLogImpl;
class LLApp;
class LLSD;
-class LLLog
+class LL_COMMON_API LLLog
{
public:
LLLog(LLApp* app);
diff --git a/indra/llcommon/llmd5.h b/indra/llcommon/llmd5.h
index d8bca03e4e..df9d7324ab 100644
--- a/indra/llcommon/llmd5.h
+++ b/indra/llcommon/llmd5.h
@@ -80,7 +80,7 @@ const int MD5RAW_BYTES = 16;
const int MD5HEX_STR_SIZE = 33; // char hex[MD5HEX_STR_SIZE]; with null
const int MD5HEX_STR_BYTES = 32; // message system fixed size
-class LLMD5 {
+class LL_COMMON_API LLMD5 {
// first, some types:
typedef unsigned int uint4; // assumes integer is 4 words long
typedef unsigned short int uint2; // assumes short integer is 2 words long
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index f41da37ba6..09f19532b7 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -1,65 +1,65 @@
-/**
- * @file llmemory.h
- * @brief Memory allocation/deallocation header-stuff goes here.
- *
- * $LicenseInfo:firstyear=2002&license=viewergpl$
- *
- * Copyright (c) 2002-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-#ifndef LLMEMORY_H
-#define LLMEMORY_H
-
-
-
-extern S32 gTotalDAlloc;
-extern S32 gTotalDAUse;
-extern S32 gDACount;
-
-extern void* ll_allocate (size_t size);
-extern void ll_release (void *p);
-
-class LLMemory
-{
-public:
- static void initClass();
- static void cleanupClass();
- static void freeReserve();
- // Return the resident set size of the current process, in bytes.
- // Return value is zero if not known.
- static U64 getCurrentRSS();
-private:
- static char* reserveMem;
-};
-
-// LLRefCount moved to llrefcount.h
-
-// LLPointer moved to llpointer.h
-
-// LLSafeHandle moved to llsafehandle.h
-
-// LLSingleton moved to llsingleton.h
-
-#endif
+/**
+ * @file llmemory.h
+ * @brief Memory allocation/deallocation header-stuff goes here.
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ *
+ * Copyright (c) 2002-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+#ifndef LLMEMORY_H
+#define LLMEMORY_H
+
+
+
+extern S32 gTotalDAlloc;
+extern S32 gTotalDAUse;
+extern S32 gDACount;
+
+extern void* ll_allocate (size_t size);
+extern void ll_release (void *p);
+
+class LL_COMMON_API LLMemory
+{
+public:
+ static void initClass();
+ static void cleanupClass();
+ static void freeReserve();
+ // Return the resident set size of the current process, in bytes.
+ // Return value is zero if not known.
+ static U64 getCurrentRSS();
+private:
+ static char* reserveMem;
+};
+
+// LLRefCount moved to llrefcount.h
+
+// LLPointer moved to llpointer.h
+
+// LLSafeHandle moved to llsafehandle.h
+
+// LLSingleton moved to llsingleton.h
+
+#endif
diff --git a/indra/llcommon/llmemorystream.h b/indra/llcommon/llmemorystream.h
index f3486324c5..fa0f5d22f2 100644
--- a/indra/llcommon/llmemorystream.h
+++ b/indra/llcommon/llmemorystream.h
@@ -52,7 +52,7 @@
* be careful to always pass in a valid memory location that exists
* for at least as long as this streambuf.
*/
-class LLMemoryStreamBuf : public std::streambuf
+class LL_COMMON_API LLMemoryStreamBuf : public std::streambuf
{
public:
LLMemoryStreamBuf(const U8* start, S32 length);
@@ -74,7 +74,7 @@ protected:
* be careful to always pass in a valid memory location that exists
* for at least as long as this streambuf.
*/
-class LLMemoryStream : public std::istream
+class LL_COMMON_API LLMemoryStream : public std::istream
{
public:
LLMemoryStream(const U8* start, S32 length);
diff --git a/indra/llcommon/llmemtype.h b/indra/llcommon/llmemtype.h
index 12310fcdb4..5952a3a7c5 100644
--- a/indra/llcommon/llmemtype.h
+++ b/indra/llcommon/llmemtype.h
@@ -1,248 +1,248 @@
-/**
- * @file llmemtype.h
- * @brief Runtime memory usage debugging utilities.
- *
- * $LicenseInfo:firstyear=2005&license=viewergpl$
- *
- * Copyright (c) 2005-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-#ifndef LL_MEMTYPE_H
-#define LL_MEMTYPE_H
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------
-
-#include "linden_common.h"
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-// WARNING: Never commit with MEM_TRACK_MEM == 1
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-#define MEM_TRACK_MEM (0 && LL_WINDOWS)
-
-#include <vector>
-
-#define MEM_TYPE_NEW(T)
-
-class LLMemType
-{
-public:
-
- // class we'll initialize all instances of as
- // static members of MemType. Then use
- // to construct any new mem type.
- class DeclareMemType
- {
- public:
- DeclareMemType(char const * st);
- ~DeclareMemType();
-
- S32 mID;
- char const * mName;
-
- // array so we can map an index ID to Name
- static std::vector<char const *> mNameList;
- };
-
- LLMemType(DeclareMemType& dt);
- ~LLMemType();
-
- static char const * getNameFromID(S32 id);
-
- static DeclareMemType MTYPE_INIT;
- static DeclareMemType MTYPE_STARTUP;
- static DeclareMemType MTYPE_MAIN;
- static DeclareMemType MTYPE_FRAME;
-
- static DeclareMemType MTYPE_GATHER_INPUT;
- static DeclareMemType MTYPE_JOY_KEY;
-
- static DeclareMemType MTYPE_IDLE;
- static DeclareMemType MTYPE_IDLE_PUMP;
- static DeclareMemType MTYPE_IDLE_NETWORK;
- static DeclareMemType MTYPE_IDLE_UPDATE_REGIONS;
- static DeclareMemType MTYPE_IDLE_UPDATE_VIEWER_REGION;
- static DeclareMemType MTYPE_IDLE_UPDATE_SURFACE;
- static DeclareMemType MTYPE_IDLE_UPDATE_PARCEL_OVERLAY;
- static DeclareMemType MTYPE_IDLE_AUDIO;
-
- static DeclareMemType MTYPE_CACHE_PROCESS_PENDING;
- static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_ASKS;
- static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_REPLIES;
-
- static DeclareMemType MTYPE_MESSAGE_CHECK_ALL;
- static DeclareMemType MTYPE_MESSAGE_PROCESS_ACKS;
-
- static DeclareMemType MTYPE_RENDER;
- static DeclareMemType MTYPE_SLEEP;
-
- static DeclareMemType MTYPE_NETWORK;
- static DeclareMemType MTYPE_PHYSICS;
- static DeclareMemType MTYPE_INTERESTLIST;
-
- static DeclareMemType MTYPE_IMAGEBASE;
- static DeclareMemType MTYPE_IMAGERAW;
- static DeclareMemType MTYPE_IMAGEFORMATTED;
-
- static DeclareMemType MTYPE_APPFMTIMAGE;
- static DeclareMemType MTYPE_APPRAWIMAGE;
- static DeclareMemType MTYPE_APPAUXRAWIMAGE;
-
- static DeclareMemType MTYPE_DRAWABLE;
-
- static DeclareMemType MTYPE_OBJECT;
- static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE;
- static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE_CORE;
-
- static DeclareMemType MTYPE_DISPLAY;
- static DeclareMemType MTYPE_DISPLAY_UPDATE;
- static DeclareMemType MTYPE_DISPLAY_UPDATE_CAMERA;
- static DeclareMemType MTYPE_DISPLAY_UPDATE_GEOM;
- static DeclareMemType MTYPE_DISPLAY_SWAP;
- static DeclareMemType MTYPE_DISPLAY_UPDATE_HUD;
- static DeclareMemType MTYPE_DISPLAY_GEN_REFLECTION;
- static DeclareMemType MTYPE_DISPLAY_IMAGE_UPDATE;
- static DeclareMemType MTYPE_DISPLAY_STATE_SORT;
- static DeclareMemType MTYPE_DISPLAY_SKY;
- static DeclareMemType MTYPE_DISPLAY_RENDER_GEOM;
- static DeclareMemType MTYPE_DISPLAY_RENDER_FLUSH;
- static DeclareMemType MTYPE_DISPLAY_RENDER_UI;
- static DeclareMemType MTYPE_DISPLAY_RENDER_ATTACHMENTS;
-
- static DeclareMemType MTYPE_VERTEX_DATA;
- static DeclareMemType MTYPE_VERTEX_CONSTRUCTOR;
- static DeclareMemType MTYPE_VERTEX_DESTRUCTOR;
- static DeclareMemType MTYPE_VERTEX_CREATE_VERTICES;
- static DeclareMemType MTYPE_VERTEX_CREATE_INDICES;
- static DeclareMemType MTYPE_VERTEX_DESTROY_BUFFER;
- static DeclareMemType MTYPE_VERTEX_DESTROY_INDICES;
- static DeclareMemType MTYPE_VERTEX_UPDATE_VERTS;
- static DeclareMemType MTYPE_VERTEX_UPDATE_INDICES;
- static DeclareMemType MTYPE_VERTEX_ALLOCATE_BUFFER;
- static DeclareMemType MTYPE_VERTEX_RESIZE_BUFFER;
- static DeclareMemType MTYPE_VERTEX_MAP_BUFFER;
- static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_VERTICES;
- static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_INDICES;
- static DeclareMemType MTYPE_VERTEX_UNMAP_BUFFER;
- static DeclareMemType MTYPE_VERTEX_SET_STRIDE;
- static DeclareMemType MTYPE_VERTEX_SET_BUFFER;
- static DeclareMemType MTYPE_VERTEX_SETUP_VERTEX_BUFFER;
- static DeclareMemType MTYPE_VERTEX_CLEANUP_CLASS;
-
- static DeclareMemType MTYPE_SPACE_PARTITION;
-
- static DeclareMemType MTYPE_PIPELINE;
- static DeclareMemType MTYPE_PIPELINE_INIT;
- static DeclareMemType MTYPE_PIPELINE_CREATE_BUFFERS;
- static DeclareMemType MTYPE_PIPELINE_RESTORE_GL;
- static DeclareMemType MTYPE_PIPELINE_UNLOAD_SHADERS;
- static DeclareMemType MTYPE_PIPELINE_LIGHTING_DETAIL;
- static DeclareMemType MTYPE_PIPELINE_GET_POOL_TYPE;
- static DeclareMemType MTYPE_PIPELINE_ADD_POOL;
- static DeclareMemType MTYPE_PIPELINE_ALLOCATE_DRAWABLE;
- static DeclareMemType MTYPE_PIPELINE_ADD_OBJECT;
- static DeclareMemType MTYPE_PIPELINE_CREATE_OBJECTS;
- static DeclareMemType MTYPE_PIPELINE_UPDATE_MOVE;
- static DeclareMemType MTYPE_PIPELINE_UPDATE_GEOM;
- static DeclareMemType MTYPE_PIPELINE_MARK_VISIBLE;
- static DeclareMemType MTYPE_PIPELINE_MARK_MOVED;
- static DeclareMemType MTYPE_PIPELINE_MARK_SHIFT;
- static DeclareMemType MTYPE_PIPELINE_SHIFT_OBJECTS;
- static DeclareMemType MTYPE_PIPELINE_MARK_TEXTURED;
- static DeclareMemType MTYPE_PIPELINE_MARK_REBUILD;
- static DeclareMemType MTYPE_PIPELINE_UPDATE_CULL;
- static DeclareMemType MTYPE_PIPELINE_STATE_SORT;
- static DeclareMemType MTYPE_PIPELINE_POST_SORT;
-
- static DeclareMemType MTYPE_PIPELINE_RENDER_HUD_ELS;
- static DeclareMemType MTYPE_PIPELINE_RENDER_HL;
- static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM;
- static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED;
- static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_POST_DEF;
- static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_SHADOW;
- static DeclareMemType MTYPE_PIPELINE_RENDER_SELECT;
- static DeclareMemType MTYPE_PIPELINE_REBUILD_POOLS;
- static DeclareMemType MTYPE_PIPELINE_QUICK_LOOKUP;
- static DeclareMemType MTYPE_PIPELINE_RENDER_OBJECTS;
- static DeclareMemType MTYPE_PIPELINE_GENERATE_IMPOSTOR;
- static DeclareMemType MTYPE_PIPELINE_RENDER_BLOOM;
-
- static DeclareMemType MTYPE_UPKEEP_POOLS;
-
- static DeclareMemType MTYPE_AVATAR;
- static DeclareMemType MTYPE_AVATAR_MESH;
- static DeclareMemType MTYPE_PARTICLES;
- static DeclareMemType MTYPE_REGIONS;
-
- static DeclareMemType MTYPE_INVENTORY;
- static DeclareMemType MTYPE_INVENTORY_DRAW;
- static DeclareMemType MTYPE_INVENTORY_BUILD_NEW_VIEWS;
- static DeclareMemType MTYPE_INVENTORY_DO_FOLDER;
- static DeclareMemType MTYPE_INVENTORY_POST_BUILD;
- static DeclareMemType MTYPE_INVENTORY_FROM_XML;
- static DeclareMemType MTYPE_INVENTORY_CREATE_NEW_ITEM;
- static DeclareMemType MTYPE_INVENTORY_VIEW_INIT;
- static DeclareMemType MTYPE_INVENTORY_VIEW_SHOW;
- static DeclareMemType MTYPE_INVENTORY_VIEW_TOGGLE;
-
- static DeclareMemType MTYPE_ANIMATION;
- static DeclareMemType MTYPE_VOLUME;
- static DeclareMemType MTYPE_PRIMITIVE;
-
- static DeclareMemType MTYPE_SCRIPT;
- static DeclareMemType MTYPE_SCRIPT_RUN;
- static DeclareMemType MTYPE_SCRIPT_BYTECODE;
-
- static DeclareMemType MTYPE_IO_PUMP;
- static DeclareMemType MTYPE_IO_TCP;
- static DeclareMemType MTYPE_IO_BUFFER;
- static DeclareMemType MTYPE_IO_HTTP_SERVER;
- static DeclareMemType MTYPE_IO_SD_SERVER;
- static DeclareMemType MTYPE_IO_SD_CLIENT;
- static DeclareMemType MTYPE_IO_URL_REQUEST;
-
- static DeclareMemType MTYPE_DIRECTX_INIT;
-
- static DeclareMemType MTYPE_TEMP1;
- static DeclareMemType MTYPE_TEMP2;
- static DeclareMemType MTYPE_TEMP3;
- static DeclareMemType MTYPE_TEMP4;
- static DeclareMemType MTYPE_TEMP5;
- static DeclareMemType MTYPE_TEMP6;
- static DeclareMemType MTYPE_TEMP7;
- static DeclareMemType MTYPE_TEMP8;
- static DeclareMemType MTYPE_TEMP9;
-
- static DeclareMemType MTYPE_OTHER; // Special; used by display code
-
- S32 mTypeIndex;
-};
-
-//----------------------------------------------------------------------------
-
-#endif
-
+/**
+ * @file llmemtype.h
+ * @brief Runtime memory usage debugging utilities.
+ *
+ * $LicenseInfo:firstyear=2005&license=viewergpl$
+ *
+ * Copyright (c) 2005-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_MEMTYPE_H
+#define LL_MEMTYPE_H
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+
+#include "linden_common.h"
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+// WARNING: Never commit with MEM_TRACK_MEM == 1
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+#define MEM_TRACK_MEM (0 && LL_WINDOWS)
+
+#include <vector>
+
+#define MEM_TYPE_NEW(T)
+
+class LL_COMMON_API LLMemType
+{
+public:
+
+ // class we'll initialize all instances of as
+ // static members of MemType. Then use
+ // to construct any new mem type.
+ class LL_COMMON_API DeclareMemType
+ {
+ public:
+ DeclareMemType(char const * st);
+ ~DeclareMemType();
+
+ S32 mID;
+ char const * mName;
+
+ // array so we can map an index ID to Name
+ static std::vector<char const *> mNameList;
+ };
+
+ LLMemType(DeclareMemType& dt);
+ ~LLMemType();
+
+ static char const * getNameFromID(S32 id);
+
+ static DeclareMemType MTYPE_INIT;
+ static DeclareMemType MTYPE_STARTUP;
+ static DeclareMemType MTYPE_MAIN;
+ static DeclareMemType MTYPE_FRAME;
+
+ static DeclareMemType MTYPE_GATHER_INPUT;
+ static DeclareMemType MTYPE_JOY_KEY;
+
+ static DeclareMemType MTYPE_IDLE;
+ static DeclareMemType MTYPE_IDLE_PUMP;
+ static DeclareMemType MTYPE_IDLE_NETWORK;
+ static DeclareMemType MTYPE_IDLE_UPDATE_REGIONS;
+ static DeclareMemType MTYPE_IDLE_UPDATE_VIEWER_REGION;
+ static DeclareMemType MTYPE_IDLE_UPDATE_SURFACE;
+ static DeclareMemType MTYPE_IDLE_UPDATE_PARCEL_OVERLAY;
+ static DeclareMemType MTYPE_IDLE_AUDIO;
+
+ static DeclareMemType MTYPE_CACHE_PROCESS_PENDING;
+ static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_ASKS;
+ static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_REPLIES;
+
+ static DeclareMemType MTYPE_MESSAGE_CHECK_ALL;
+ static DeclareMemType MTYPE_MESSAGE_PROCESS_ACKS;
+
+ static DeclareMemType MTYPE_RENDER;
+ static DeclareMemType MTYPE_SLEEP;
+
+ static DeclareMemType MTYPE_NETWORK;
+ static DeclareMemType MTYPE_PHYSICS;
+ static DeclareMemType MTYPE_INTERESTLIST;
+
+ static DeclareMemType MTYPE_IMAGEBASE;
+ static DeclareMemType MTYPE_IMAGERAW;
+ static DeclareMemType MTYPE_IMAGEFORMATTED;
+
+ static DeclareMemType MTYPE_APPFMTIMAGE;
+ static DeclareMemType MTYPE_APPRAWIMAGE;
+ static DeclareMemType MTYPE_APPAUXRAWIMAGE;
+
+ static DeclareMemType MTYPE_DRAWABLE;
+
+ static DeclareMemType MTYPE_OBJECT;
+ static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE;
+ static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE_CORE;
+
+ static DeclareMemType MTYPE_DISPLAY;
+ static DeclareMemType MTYPE_DISPLAY_UPDATE;
+ static DeclareMemType MTYPE_DISPLAY_UPDATE_CAMERA;
+ static DeclareMemType MTYPE_DISPLAY_UPDATE_GEOM;
+ static DeclareMemType MTYPE_DISPLAY_SWAP;
+ static DeclareMemType MTYPE_DISPLAY_UPDATE_HUD;
+ static DeclareMemType MTYPE_DISPLAY_GEN_REFLECTION;
+ static DeclareMemType MTYPE_DISPLAY_IMAGE_UPDATE;
+ static DeclareMemType MTYPE_DISPLAY_STATE_SORT;
+ static DeclareMemType MTYPE_DISPLAY_SKY;
+ static DeclareMemType MTYPE_DISPLAY_RENDER_GEOM;
+ static DeclareMemType MTYPE_DISPLAY_RENDER_FLUSH;
+ static DeclareMemType MTYPE_DISPLAY_RENDER_UI;
+ static DeclareMemType MTYPE_DISPLAY_RENDER_ATTACHMENTS;
+
+ static DeclareMemType MTYPE_VERTEX_DATA;
+ static DeclareMemType MTYPE_VERTEX_CONSTRUCTOR;
+ static DeclareMemType MTYPE_VERTEX_DESTRUCTOR;
+ static DeclareMemType MTYPE_VERTEX_CREATE_VERTICES;
+ static DeclareMemType MTYPE_VERTEX_CREATE_INDICES;
+ static DeclareMemType MTYPE_VERTEX_DESTROY_BUFFER;
+ static DeclareMemType MTYPE_VERTEX_DESTROY_INDICES;
+ static DeclareMemType MTYPE_VERTEX_UPDATE_VERTS;
+ static DeclareMemType MTYPE_VERTEX_UPDATE_INDICES;
+ static DeclareMemType MTYPE_VERTEX_ALLOCATE_BUFFER;
+ static DeclareMemType MTYPE_VERTEX_RESIZE_BUFFER;
+ static DeclareMemType MTYPE_VERTEX_MAP_BUFFER;
+ static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_VERTICES;
+ static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_INDICES;
+ static DeclareMemType MTYPE_VERTEX_UNMAP_BUFFER;
+ static DeclareMemType MTYPE_VERTEX_SET_STRIDE;
+ static DeclareMemType MTYPE_VERTEX_SET_BUFFER;
+ static DeclareMemType MTYPE_VERTEX_SETUP_VERTEX_BUFFER;
+ static DeclareMemType MTYPE_VERTEX_CLEANUP_CLASS;
+
+ static DeclareMemType MTYPE_SPACE_PARTITION;
+
+ static DeclareMemType MTYPE_PIPELINE;
+ static DeclareMemType MTYPE_PIPELINE_INIT;
+ static DeclareMemType MTYPE_PIPELINE_CREATE_BUFFERS;
+ static DeclareMemType MTYPE_PIPELINE_RESTORE_GL;
+ static DeclareMemType MTYPE_PIPELINE_UNLOAD_SHADERS;
+ static DeclareMemType MTYPE_PIPELINE_LIGHTING_DETAIL;
+ static DeclareMemType MTYPE_PIPELINE_GET_POOL_TYPE;
+ static DeclareMemType MTYPE_PIPELINE_ADD_POOL;
+ static DeclareMemType MTYPE_PIPELINE_ALLOCATE_DRAWABLE;
+ static DeclareMemType MTYPE_PIPELINE_ADD_OBJECT;
+ static DeclareMemType MTYPE_PIPELINE_CREATE_OBJECTS;
+ static DeclareMemType MTYPE_PIPELINE_UPDATE_MOVE;
+ static DeclareMemType MTYPE_PIPELINE_UPDATE_GEOM;
+ static DeclareMemType MTYPE_PIPELINE_MARK_VISIBLE;
+ static DeclareMemType MTYPE_PIPELINE_MARK_MOVED;
+ static DeclareMemType MTYPE_PIPELINE_MARK_SHIFT;
+ static DeclareMemType MTYPE_PIPELINE_SHIFT_OBJECTS;
+ static DeclareMemType MTYPE_PIPELINE_MARK_TEXTURED;
+ static DeclareMemType MTYPE_PIPELINE_MARK_REBUILD;
+ static DeclareMemType MTYPE_PIPELINE_UPDATE_CULL;
+ static DeclareMemType MTYPE_PIPELINE_STATE_SORT;
+ static DeclareMemType MTYPE_PIPELINE_POST_SORT;
+
+ static DeclareMemType MTYPE_PIPELINE_RENDER_HUD_ELS;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_HL;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_POST_DEF;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_SHADOW;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_SELECT;
+ static DeclareMemType MTYPE_PIPELINE_REBUILD_POOLS;
+ static DeclareMemType MTYPE_PIPELINE_QUICK_LOOKUP;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_OBJECTS;
+ static DeclareMemType MTYPE_PIPELINE_GENERATE_IMPOSTOR;
+ static DeclareMemType MTYPE_PIPELINE_RENDER_BLOOM;
+
+ static DeclareMemType MTYPE_UPKEEP_POOLS;
+
+ static DeclareMemType MTYPE_AVATAR;
+ static DeclareMemType MTYPE_AVATAR_MESH;
+ static DeclareMemType MTYPE_PARTICLES;
+ static DeclareMemType MTYPE_REGIONS;
+
+ static DeclareMemType MTYPE_INVENTORY;
+ static DeclareMemType MTYPE_INVENTORY_DRAW;
+ static DeclareMemType MTYPE_INVENTORY_BUILD_NEW_VIEWS;
+ static DeclareMemType MTYPE_INVENTORY_DO_FOLDER;
+ static DeclareMemType MTYPE_INVENTORY_POST_BUILD;
+ static DeclareMemType MTYPE_INVENTORY_FROM_XML;
+ static DeclareMemType MTYPE_INVENTORY_CREATE_NEW_ITEM;
+ static DeclareMemType MTYPE_INVENTORY_VIEW_INIT;
+ static DeclareMemType MTYPE_INVENTORY_VIEW_SHOW;
+ static DeclareMemType MTYPE_INVENTORY_VIEW_TOGGLE;
+
+ static DeclareMemType MTYPE_ANIMATION;
+ static DeclareMemType MTYPE_VOLUME;
+ static DeclareMemType MTYPE_PRIMITIVE;
+
+ static DeclareMemType MTYPE_SCRIPT;
+ static DeclareMemType MTYPE_SCRIPT_RUN;
+ static DeclareMemType MTYPE_SCRIPT_BYTECODE;
+
+ static DeclareMemType MTYPE_IO_PUMP;
+ static DeclareMemType MTYPE_IO_TCP;
+ static DeclareMemType MTYPE_IO_BUFFER;
+ static DeclareMemType MTYPE_IO_HTTP_SERVER;
+ static DeclareMemType MTYPE_IO_SD_SERVER;
+ static DeclareMemType MTYPE_IO_SD_CLIENT;
+ static DeclareMemType MTYPE_IO_URL_REQUEST;
+
+ static DeclareMemType MTYPE_DIRECTX_INIT;
+
+ static DeclareMemType MTYPE_TEMP1;
+ static DeclareMemType MTYPE_TEMP2;
+ static DeclareMemType MTYPE_TEMP3;
+ static DeclareMemType MTYPE_TEMP4;
+ static DeclareMemType MTYPE_TEMP5;
+ static DeclareMemType MTYPE_TEMP6;
+ static DeclareMemType MTYPE_TEMP7;
+ static DeclareMemType MTYPE_TEMP8;
+ static DeclareMemType MTYPE_TEMP9;
+
+ static DeclareMemType MTYPE_OTHER; // Special; used by display code
+
+ S32 mTypeIndex;
+};
+
+//----------------------------------------------------------------------------
+
+#endif
+
diff --git a/indra/llcommon/llmetrics.h b/indra/llcommon/llmetrics.h
index 1d91e8c8a2..f6f49eb456 100644
--- a/indra/llcommon/llmetrics.h
+++ b/indra/llcommon/llmetrics.h
@@ -38,7 +38,7 @@
class LLMetricsImpl;
class LLSD;
-class LLMetrics
+class LL_COMMON_API LLMetrics
{
public:
LLMetrics();
diff --git a/indra/llcommon/llmortician.h b/indra/llcommon/llmortician.h
index fcda3df58e..27bd8cd9b5 100644
--- a/indra/llcommon/llmortician.h
+++ b/indra/llcommon/llmortician.h
@@ -35,7 +35,7 @@
#include "stdtypes.h"
-class LLMortician
+class LL_COMMON_API LLMortician
{
public:
LLMortician() { mIsDead = FALSE; }
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 4401be1679..f853e31002 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -1,140 +1,166 @@
-/**
- * @file llpreprocessor.h
- * @brief This file should be included in all Linden Lab files and
- * should only contain special preprocessor directives
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-#ifndef LLPREPROCESSOR_H
-#define LLPREPROCESSOR_H
-
-// Figure out endianness of platform
-#ifdef LL_LINUX
-#define __ENABLE_WSTRING
-#include <endian.h>
-#endif // LL_LINUX
-
-#if LL_SOLARIS
-# ifdef __sparc // Since we're talking Solaris 10 and up, only 64 bit is supported.
-# define LL_BIG_ENDIAN 1
-# define LL_SOLARIS_ALIGNED_CPU 1 // used to designate issues where SPARC alignment is addressed
-# define LL_SOLARIS_NON_MESA_GL 1 // The SPARC GL does not provide a MESA-based GL API
-# endif
-# include <sys/isa_defs.h> // ensure we know which end is up
-#endif // LL_SOLARIS
-
-#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)) || (defined(LL_SOLARIS) && defined(__i386)))
-#define LL_LITTLE_ENDIAN 1
-#else
-#define LL_BIG_ENDIAN 1
-#endif
-
-// Per-compiler switches
-#ifdef __GNUC__
-#define LL_FORCE_INLINE inline __attribute__((always_inline))
-#else
-#define LL_FORCE_INLINE __forceinline
-#endif
-
-// Figure out differences between compilers
-#if defined(__GNUC__)
- #define GCC_VERSION (__GNUC__ * 10000 \
- + __GNUC_MINOR__ * 100 \
- + __GNUC_PATCHLEVEL__)
- #ifndef LL_GNUC
- #define LL_GNUC 1
- #endif
-#elif defined(__MSVC_VER__) || defined(_MSC_VER)
- #ifndef LL_MSVC
- #define LL_MSVC 1
- #endif
- #if _MSC_VER < 1400
- #define LL_MSVC7 //Visual C++ 2003 or earlier
- #endif
-#endif
-
-// Deal with minor differences on Unixy OSes.
-#if LL_DARWIN || LL_LINUX
- // Different name, same functionality.
- #define stricmp strcasecmp
- #define strnicmp strncasecmp
-
- // Not sure why this is different, but...
- #ifndef MAX_PATH
- #define MAX_PATH PATH_MAX
- #endif // not MAX_PATH
-
-#endif
-
-
-// Deal with the differeneces on Windows
-#if LL_MSVC
-namespace snprintf_hack
-{
- int snprintf(char *str, size_t size, const char *format, ...);
-}
-
-// #define snprintf safe_snprintf /* Flawfinder: ignore */
-using snprintf_hack::snprintf;
-#endif // LL_MSVC
-
-// Static linking with apr on windows needs to be declared.
-#ifdef LL_WINDOWS
-#ifndef APR_DECLARE_STATIC
-#define APR_DECLARE_STATIC // For APR on Windows
-#endif
-#ifndef APU_DECLARE_STATIC
-#define APU_DECLARE_STATIC // For APR util on Windows
-#endif
-#endif
-
-#if defined(LL_WINDOWS)
-#define BOOST_REGEX_NO_LIB 1
-#define CURL_STATICLIB 1
-#define XML_STATIC
-#endif // LL_WINDOWS
-
-
-// Deal with VC6 problems
-#if LL_MSVC
-#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
-//#pragma warning( 3 : 4018 ) // "signed/unsigned mismatch" Treat this as level 3, not level 4.
-#pragma warning( 3 : 4263 ) // 'function' : member function does not override any base class virtual member function
-#pragma warning( 3 : 4264 ) // "'virtual_function' : no override available for virtual member function from base 'class'; function is hidden"
-#pragma warning( 3 : 4265 ) // "class has virtual functions, but destructor is not virtual"
-#pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden
-#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
-#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
-#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
-#pragma warning( disable : 4996 ) // warning: deprecated
-#endif // LL_MSVC
-
-#endif // not LL_LINDEN_PREPROCESSOR_H
+/**
+ * @file llpreprocessor.h
+ * @brief This file should be included in all Linden Lab files and
+ * should only contain special preprocessor directives
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LLPREPROCESSOR_H
+#define LLPREPROCESSOR_H
+
+// Figure out endianness of platform
+#ifdef LL_LINUX
+#define __ENABLE_WSTRING
+#include <endian.h>
+#endif // LL_LINUX
+
+#if LL_SOLARIS
+# ifdef __sparc // Since we're talking Solaris 10 and up, only 64 bit is supported.
+# define LL_BIG_ENDIAN 1
+# define LL_SOLARIS_ALIGNED_CPU 1 // used to designate issues where SPARC alignment is addressed
+# define LL_SOLARIS_NON_MESA_GL 1 // The SPARC GL does not provide a MESA-based GL API
+# endif
+# include <sys/isa_defs.h> // ensure we know which end is up
+#endif // LL_SOLARIS
+
+#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)) || (defined(LL_SOLARIS) && defined(__i386)))
+#define LL_LITTLE_ENDIAN 1
+#else
+#define LL_BIG_ENDIAN 1
+#endif
+
+// Per-compiler switches
+#ifdef __GNUC__
+#define LL_FORCE_INLINE inline __attribute__((always_inline))
+#else
+#define LL_FORCE_INLINE __forceinline
+#endif
+
+// Figure out differences between compilers
+#if defined(__GNUC__)
+ #define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+ #ifndef LL_GNUC
+ #define LL_GNUC 1
+ #endif
+#elif defined(__MSVC_VER__) || defined(_MSC_VER)
+ #ifndef LL_MSVC
+ #define LL_MSVC 1
+ #endif
+ #if _MSC_VER < 1400
+ #define LL_MSVC7 //Visual C++ 2003 or earlier
+ #endif
+#endif
+
+// Deal with minor differences on Unixy OSes.
+#if LL_DARWIN || LL_LINUX
+ // Different name, same functionality.
+ #define stricmp strcasecmp
+ #define strnicmp strncasecmp
+
+ // Not sure why this is different, but...
+ #ifndef MAX_PATH
+ #define MAX_PATH PATH_MAX
+ #endif // not MAX_PATH
+
+#endif
+
+
+// Static linking with apr on windows needs to be declared.
+#if LL_WINDOWS && !LL_COMMON_LINK_SHARED
+#ifndef APR_DECLARE_STATIC
+#define APR_DECLARE_STATIC // For APR on Windows
+#endif
+#ifndef APU_DECLARE_STATIC
+#define APU_DECLARE_STATIC // For APR util on Windows
+#endif
+#endif
+
+#if defined(LL_WINDOWS)
+#define BOOST_REGEX_NO_LIB 1
+#define CURL_STATICLIB 1
+#define XML_STATIC
+#endif // LL_WINDOWS
+
+
+// Deal with VC6 problems
+#if LL_MSVC
+#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
+#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
+#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
+//#pragma warning( 3 : 4018 ) // "signed/unsigned mismatch" Treat this as level 3, not level 4.
+#pragma warning( 3 : 4263 ) // 'function' : member function does not override any base class virtual member function
+#pragma warning( 3 : 4264 ) // "'virtual_function' : no override available for virtual member function from base 'class'; function is hidden"
+#pragma warning( 3 : 4265 ) // "class has virtual functions, but destructor is not virtual"
+#pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden
+#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
+#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
+#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
+#pragma warning( disable : 4996 ) // warning: deprecated
+
+// level 4 warnings that we need to disable:
+#pragma warning (disable : 4100) // unreferenced formal parameter
+#pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) )
+#pragma warning (disable : 4244) // possible loss of data on conversions
+#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
+#pragma warning (disable : 4512) // assignment operator could not be generated
+#pragma warning (disable : 4706) // assignment within conditional (even if((x = y)) )
+
+#pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
+#pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
+#endif // LL_MSVC
+
+#if LL_WINDOWS
+#define LL_DLLEXPORT __declspec(dllexport)
+#define LL_DLLIMPORT __declspec(dllimport)
+#elif LL_LINUX
+#define LL_DLLEXPORT __attribute__ ((visibility("default")))
+#define LL_DLLIMPORT
+#else
+#define LL_DLLEXPORT
+#define LL_DLLIMPORT
+#endif // LL_WINDOWS
+
+#if LL_COMMON_LINK_SHARED
+// CMake automagically defines llcommon_EXPORTS only when building llcommon
+// sources, and only when llcommon is a shared library (i.e. when
+// LL_COMMON_LINK_SHARED). We must still test LL_COMMON_LINK_SHARED because
+// otherwise we can't distinguish between (non-llcommon source) and (llcommon
+// not shared).
+# if defined(llcommon_EXPORTS)
+# define LL_COMMON_API LL_DLLEXPORT
+# else //llcommon_EXPORTS
+# define LL_COMMON_API LL_DLLIMPORT
+# endif //llcommon_EXPORTS
+#else // LL_COMMON_LINK_SHARED
+# define LL_COMMON_API
+#endif // LL_COMMON_LINK_SHARED
+
+#endif // not LL_LINDEN_PREPROCESSOR_H
diff --git a/indra/llcommon/llprocesslauncher.h b/indra/llcommon/llprocesslauncher.h
index a1b8e22691..880562157f 100644
--- a/indra/llcommon/llprocesslauncher.h
+++ b/indra/llcommon/llprocesslauncher.h
@@ -42,7 +42,7 @@
It also keeps track of whether the process is still running, and can kill it if required.
*/
-class LLProcessLauncher
+class LL_COMMON_API LLProcessLauncher
{
LOG_CLASS(LLProcessLauncher);
public:
diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h
index 3ba43e1e07..8bfa5632a1 100644
--- a/indra/llcommon/llqueuedthread.h
+++ b/indra/llcommon/llqueuedthread.h
@@ -47,7 +47,7 @@
// Note: ~LLQueuedThread is O(N) N=# of queued threads, assumed to be small
// It is assumed that LLQueuedThreads are rarely created/destroyed.
-class LLQueuedThread : public LLThread
+class LL_COMMON_API LLQueuedThread : public LLThread
{
//------------------------------------------------------------------------
public:
@@ -80,7 +80,7 @@ public:
//------------------------------------------------------------------------
public:
- class QueuedRequest : public LLSimpleHashEntry<handle_t>
+ class LL_COMMON_API QueuedRequest : public LLSimpleHashEntry<handle_t>
{
friend class LLQueuedThread;
@@ -148,6 +148,7 @@ protected:
}
};
+
//------------------------------------------------------------------------
public:
diff --git a/indra/llcommon/llrand.h b/indra/llcommon/llrand.h
index d12597bb53..30fec9b982 100644
--- a/indra/llcommon/llrand.h
+++ b/indra/llcommon/llrand.h
@@ -65,32 +65,32 @@
/**
*@brief Generate a float from [0, RAND_MAX).
*/
-S32 ll_rand();
+S32 LL_COMMON_API ll_rand();
/**
*@brief Generate a float from [0, val) or (val, 0].
*/
-S32 ll_rand(S32 val);
+S32 LL_COMMON_API ll_rand(S32 val);
/**
*@brief Generate a float from [0, 1.0).
*/
-F32 ll_frand();
+F32 LL_COMMON_API ll_frand();
/**
*@brief Generate a float from [0, val) or (val, 0].
*/
-F32 ll_frand(F32 val);
+F32 LL_COMMON_API ll_frand(F32 val);
/**
*@brief Generate a double from [0, 1.0).
*/
-F64 ll_drand();
+F64 LL_COMMON_API ll_drand();
/**
*@brief Generate a double from [0, val) or (val, 0].
*/
-F64 ll_drand(F64 val);
+F64 LL_COMMON_API ll_drand(F64 val);
/**
* @brief typedefs for good boost lagged fibonacci.
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h
index d3597b454c..9ab844eb22 100644
--- a/indra/llcommon/llrefcount.h
+++ b/indra/llcommon/llrefcount.h
@@ -39,9 +39,9 @@
// see llthread.h for LLThreadSafeRefCount
//----------------------------------------------------------------------------
-class LLRefCount
+class LL_COMMON_API LLRefCount
{
-protected:
+private:
LLRefCount(const LLRefCount& other); // no implementation
private:
LLRefCount& operator=(const LLRefCount&); // no implementation
diff --git a/indra/llcommon/llrun.h b/indra/llcommon/llrun.h
index 77b23d9051..1fc9925df9 100644
--- a/indra/llcommon/llrun.h
+++ b/indra/llcommon/llrun.h
@@ -48,7 +48,7 @@ class LLRunnable;
* which are scheduled to run on a repeating or one time basis.
* @see LLRunnable
*/
-class LLRunner
+class LL_COMMON_API LLRunner
{
public:
/**
@@ -149,7 +149,7 @@ protected:
* something useful.
* @see LLRunner
*/
-class LLRunnable
+class LL_COMMON_API LLRunnable
{
public:
LLRunnable();
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index d2845a3757..552bb57498 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -89,7 +89,7 @@
@nosubgrouping
*/
-class LLSD
+class LL_COMMON_API LLSD
{
public:
LLSD(); ///< initially Undefined
@@ -387,7 +387,7 @@ struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
}
};
-std::ostream& operator<<(std::ostream& s, const LLSD& llsd);
+LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLSD& llsd);
/** QUESTIONS & TO DOS
- Would Binary be more convenient as usigned char* buffer semantics?
diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h
index 7463d1e5dd..2f2b292189 100644
--- a/indra/llcommon/llsdserialize.h
+++ b/indra/llcommon/llsdserialize.h
@@ -44,7 +44,7 @@
* @class LLSDParser
* @brief Abstract base class for LLSD parsers.
*/
-class LLSDParser : public LLRefCount
+class LL_COMMON_API LLSDParser : public LLRefCount
{
protected:
/**
@@ -221,7 +221,7 @@ protected:
* @class LLSDNotationParser
* @brief Parser which handles the original notation format for LLSD.
*/
-class LLSDNotationParser : public LLSDParser
+class LL_COMMON_API LLSDNotationParser : public LLSDParser
{
protected:
/**
@@ -294,7 +294,7 @@ private:
* @class LLSDXMLParser
* @brief Parser which handles XML format LLSD.
*/
-class LLSDXMLParser : public LLSDParser
+class LL_COMMON_API LLSDXMLParser : public LLSDParser
{
protected:
/**
@@ -342,7 +342,7 @@ private:
* @class LLSDBinaryParser
* @brief Parser which handles binary formatted LLSD.
*/
-class LLSDBinaryParser : public LLSDParser
+class LL_COMMON_API LLSDBinaryParser : public LLSDParser
{
protected:
/**
@@ -407,7 +407,7 @@ private:
* @class LLSDFormatter
* @brief Abstract base class for formatting LLSD.
*/
-class LLSDFormatter : public LLRefCount
+class LL_COMMON_API LLSDFormatter : public LLRefCount
{
protected:
/**
@@ -479,7 +479,7 @@ protected:
* @class LLSDNotationFormatter
* @brief Formatter which outputs the original notation format for LLSD.
*/
-class LLSDNotationFormatter : public LLSDFormatter
+class LL_COMMON_API LLSDNotationFormatter : public LLSDFormatter
{
protected:
/**
@@ -520,7 +520,7 @@ public:
* @class LLSDXMLFormatter
* @brief Formatter which outputs the LLSD as XML.
*/
-class LLSDXMLFormatter : public LLSDFormatter
+class LL_COMMON_API LLSDXMLFormatter : public LLSDFormatter
{
protected:
/**
@@ -588,7 +588,7 @@ protected:
* Map: '{' + 4 byte integer size every(key + value) + '}'<br>
* map keys are serialized as 'k' + 4 byte integer size + string
*/
-class LLSDBinaryFormatter : public LLSDFormatter
+class LL_COMMON_API LLSDBinaryFormatter : public LLSDFormatter
{
protected:
/**
@@ -638,9 +638,14 @@ protected:
* params << "[{'version':i1}," << LLSDOStreamer<LLSDNotationFormatter>(sd)
* << "]";
* </code>
+ *
+ * *NOTE - formerly this class inherited from its template parameter Formatter,
+ * but all insnatiations passed in LLRefCount subclasses. This conflicted with
+ * the auto allocation intended for this class template (demonstrated in the
+ * example above). -brad
*/
template <class Formatter>
-class LLSDOStreamer : public Formatter
+class LLSDOStreamer
{
public:
/**
@@ -661,7 +666,8 @@ public:
std::ostream& str,
const LLSDOStreamer<Formatter>& formatter)
{
- formatter.format(formatter.mSD, str, formatter.mOptions);
+ LLPointer<Formatter> f = new Formatter;
+ f->format(formatter.mSD, str, formatter.mOptions);
return str;
}
@@ -677,7 +683,7 @@ typedef LLSDOStreamer<LLSDXMLFormatter> LLSDXMLStreamer;
* @class LLSDSerialize
* @brief Serializer / deserializer for the various LLSD formats
*/
-class LLSDSerialize
+class LL_COMMON_API LLSDSerialize
{
public:
enum ELLSD_Serialize
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index 0202a033c3..c8d8030e87 100644
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -46,6 +46,11 @@
#endif
#include "llsdserialize.h"
+#include "stringize.h"
+
+#include <map>
+#include <set>
+#include <boost/range.hpp>
// U32
LLSD ll_sd_from_U32(const U32 val)
@@ -313,3 +318,353 @@ BOOL compare_llsd_with_template(
return TRUE;
}
+
+/*****************************************************************************
+* Helpers for llsd_matches()
+*****************************************************************************/
+// raw data used for LLSD::Type lookup
+struct Data
+{
+ LLSD::Type type;
+ const char* name;
+} typedata[] =
+{
+#define def(type) { LLSD::type, #type + 4 }
+ def(TypeUndefined),
+ def(TypeBoolean),
+ def(TypeInteger),
+ def(TypeReal),
+ def(TypeString),
+ def(TypeUUID),
+ def(TypeDate),
+ def(TypeURI),
+ def(TypeBinary),
+ def(TypeMap),
+ def(TypeArray)
+#undef def
+};
+
+// LLSD::Type lookup class into which we load the above static data
+class TypeLookup
+{
+ typedef std::map<LLSD::Type, std::string> MapType;
+
+public:
+ TypeLookup()
+ {
+ for (const Data *di(boost::begin(typedata)), *dend(boost::end(typedata)); di != dend; ++di)
+ {
+ mMap[di->type] = di->name;
+ }
+ }
+
+ std::string lookup(LLSD::Type type) const
+ {
+ MapType::const_iterator found = mMap.find(type);
+ if (found != mMap.end())
+ {
+ return found->second;
+ }
+ return STRINGIZE("<unknown LLSD type " << type << ">");
+ }
+
+private:
+ MapType mMap;
+};
+
+// static instance of the lookup class
+static const TypeLookup sTypes;
+
+// describe a mismatch; phrasing may want tweaking
+const std::string op(" required instead of ");
+
+// llsd_matches() wants to identify specifically where in a complex prototype
+// structure the mismatch occurred. This entails passing a prefix string,
+// empty for the top-level call. If the prototype contains an array of maps,
+// and the mismatch occurs in the second map in a key 'foo', we want to
+// decorate the returned string with: "[1]['foo']: etc." On the other hand, we
+// want to omit the entire prefix -- including colon -- if the mismatch is at
+// top level. This helper accepts the (possibly empty) recursively-accumulated
+// prefix string, returning either empty or the original string with colon
+// appended.
+static std::string colon(const std::string& pfx)
+{
+ if (pfx.empty())
+ return pfx;
+ return pfx + ": ";
+}
+
+// param type for match_types
+typedef std::vector<LLSD::Type> TypeVector;
+
+// The scalar cases in llsd_matches() use this helper. In most cases, we can
+// accept not only the exact type specified in the prototype, but also other
+// types convertible to the expected type. That implies looping over an array
+// of such types. If the actual type doesn't match any of them, we want to
+// provide a list of acceptable conversions as well as the exact type, e.g.:
+// "Integer (or Boolean, Real, String) required instead of UUID". Both the
+// implementation and the calling logic are simplified by separating out the
+// expected type from the convertible types.
+static std::string match_types(LLSD::Type expect, // prototype.type()
+ const TypeVector& accept, // types convertible to that type
+ LLSD::Type actual, // type we're checking
+ const std::string& pfx) // as for llsd_matches
+{
+ // Trivial case: if the actual type is exactly what we expect, we're good.
+ if (actual == expect)
+ return "";
+
+ // For the rest of the logic, build up a suitable error string as we go so
+ // we only have to make a single pass over the list of acceptable types.
+ // If we detect success along the way, we'll simply discard the partial
+ // error string.
+ std::ostringstream out;
+ out << colon(pfx) << sTypes.lookup(expect);
+
+ // If there are any convertible types, append that list.
+ if (! accept.empty())
+ {
+ out << " (";
+ const char* sep = "or ";
+ for (TypeVector::const_iterator ai(accept.begin()), aend(accept.end());
+ ai != aend; ++ai, sep = ", ")
+ {
+ // Don't forget to return success if we match any of those types...
+ if (actual == *ai)
+ return "";
+ out << sep << sTypes.lookup(*ai);
+ }
+ out << ')';
+ }
+ // If we got this far, it's because 'actual' was not one of the acceptable
+ // types, so we must return an error. 'out' already contains colon(pfx)
+ // and the formatted list of acceptable types, so just append the mismatch
+ // phrase and the actual type.
+ out << op << sTypes.lookup(actual);
+ return out.str();
+}
+
+// see docstring in .h file
+std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::string& pfx)
+{
+ // An undefined prototype means that any data is valid.
+ // An undefined slot in an array or map prototype means that any data
+ // may fill that slot.
+ if (prototype.isUndefined())
+ return "";
+ // A prototype array must match a data array with at least as many
+ // entries. Moreover, every prototype entry must match the
+ // corresponding data entry.
+ if (prototype.isArray())
+ {
+ if (! data.isArray())
+ {
+ return STRINGIZE(colon(pfx) << "Array" << op << sTypes.lookup(data.type()));
+ }
+ if (data.size() < prototype.size())
+ {
+ return STRINGIZE(colon(pfx) << "Array size " << prototype.size() << op
+ << "Array size " << data.size());
+ }
+ for (LLSD::Integer i = 0; i < prototype.size(); ++i)
+ {
+ std::string match(llsd_matches(prototype[i], data[i], STRINGIZE('[' << i << ']')));
+ if (! match.empty())
+ {
+ return match;
+ }
+ }
+ return "";
+ }
+ // A prototype map must match a data map. Every key in the prototype
+ // must have a corresponding key in the data map; every value in the
+ // prototype must match the corresponding key's value in the data.
+ if (prototype.isMap())
+ {
+ if (! data.isMap())
+ {
+ return STRINGIZE(colon(pfx) << "Map" << op << sTypes.lookup(data.type()));
+ }
+ // If there are a number of keys missing from the data, it would be
+ // frustrating to a coder to discover them one at a time, with a big
+ // build each time. Enumerate all missing keys.
+ std::ostringstream out;
+ out << colon(pfx);
+ const char* init = "Map missing keys: ";
+ const char* sep = init;
+ for (LLSD::map_const_iterator mi = prototype.beginMap(); mi != prototype.endMap(); ++mi)
+ {
+ if (! data.has(mi->first))
+ {
+ out << sep << mi->first;
+ sep = ", ";
+ }
+ }
+ // So... are we missing any keys?
+ if (sep != init)
+ {
+ return out.str();
+ }
+ // Good, the data block contains all the keys required by the
+ // prototype. Now match the prototype entries.
+ for (LLSD::map_const_iterator mi2 = prototype.beginMap(); mi2 != prototype.endMap(); ++mi2)
+ {
+ std::string match(llsd_matches(mi2->second, data[mi2->first],
+ STRINGIZE("['" << mi2->first << "']")));
+ if (! match.empty())
+ {
+ return match;
+ }
+ }
+ return "";
+ }
+ // A String prototype can match String, Boolean, Integer, Real, UUID,
+ // Date and URI, because any of these can be converted to String.
+ if (prototype.isString())
+ {
+ static LLSD::Type accept[] =
+ {
+ LLSD::TypeBoolean,
+ LLSD::TypeInteger,
+ LLSD::TypeReal,
+ LLSD::TypeUUID,
+ LLSD::TypeDate,
+ LLSD::TypeURI
+ };
+ return match_types(prototype.type(),
+ TypeVector(boost::begin(accept), boost::end(accept)),
+ data.type(),
+ pfx);
+ }
+ // Boolean, Integer, Real match each other or String. TBD: ensure that
+ // a String value is numeric.
+ if (prototype.isBoolean() || prototype.isInteger() || prototype.isReal())
+ {
+ static LLSD::Type all[] =
+ {
+ LLSD::TypeBoolean,
+ LLSD::TypeInteger,
+ LLSD::TypeReal,
+ LLSD::TypeString
+ };
+ // Funny business: shuffle the set of acceptable types to include all
+ // but the prototype's type. Get the acceptable types in a set.
+ std::set<LLSD::Type> rest(boost::begin(all), boost::end(all));
+ // Remove the prototype's type because we pass that separately.
+ rest.erase(prototype.type());
+ return match_types(prototype.type(),
+ TypeVector(rest.begin(), rest.end()),
+ data.type(),
+ pfx);
+ }
+ // UUID, Date and URI match themselves or String.
+ if (prototype.isUUID() || prototype.isDate() || prototype.isURI())
+ {
+ static LLSD::Type accept[] =
+ {
+ LLSD::TypeString
+ };
+ return match_types(prototype.type(),
+ TypeVector(boost::begin(accept), boost::end(accept)),
+ data.type(),
+ pfx);
+ }
+ // We don't yet know the conversion semantics associated with any new LLSD
+ // data type that might be added, so until we've been extended to handle
+ // them, assume it's strict: the new type matches only itself. (This is
+ // true of Binary, which is why we don't handle that case separately.) Too
+ // bad LLSD doesn't define isConvertible(Type to, Type from).
+ return match_types(prototype.type(), TypeVector(), data.type(), pfx);
+}
+
+bool llsd_equals(const LLSD& lhs, const LLSD& rhs)
+{
+ // We're comparing strict equality of LLSD representation rather than
+ // performing any conversions. So if the types aren't equal, the LLSD
+ // values aren't equal.
+ if (lhs.type() != rhs.type())
+ {
+ return false;
+ }
+
+ // Here we know both types are equal. Now compare values.
+ switch (lhs.type())
+ {
+ case LLSD::TypeUndefined:
+ // Both are TypeUndefined. There's nothing more to know.
+ return true;
+
+#define COMPARE_SCALAR(type) \
+ case LLSD::Type##type: \
+ /* LLSD::URI has operator!=() but not operator==() */ \
+ /* rely on the optimizer for all others */ \
+ return (! (lhs.as##type() != rhs.as##type()))
+
+ COMPARE_SCALAR(Boolean);
+ COMPARE_SCALAR(Integer);
+ // The usual caveats about comparing floating-point numbers apply. This is
+ // only useful when we expect identical bit representation for a given
+ // Real value, e.g. for integer-valued Reals.
+ COMPARE_SCALAR(Real);
+ COMPARE_SCALAR(String);
+ COMPARE_SCALAR(UUID);
+ COMPARE_SCALAR(Date);
+ COMPARE_SCALAR(URI);
+ COMPARE_SCALAR(Binary);
+
+#undef COMPARE_SCALAR
+
+ case LLSD::TypeArray:
+ {
+ LLSD::array_const_iterator
+ lai(lhs.beginArray()), laend(lhs.endArray()),
+ rai(rhs.beginArray()), raend(rhs.endArray());
+ // Compare array elements, walking the two arrays in parallel.
+ for ( ; lai != laend && rai != raend; ++lai, ++rai)
+ {
+ // If any one array element is unequal, the arrays are unequal.
+ if (! llsd_equals(*lai, *rai))
+ return false;
+ }
+ // Here we've reached the end of one or the other array. They're equal
+ // only if they're BOTH at end: that is, if they have equal length too.
+ return (lai == laend && rai == raend);
+ }
+
+ case LLSD::TypeMap:
+ {
+ // Build a set of all rhs keys.
+ std::set<LLSD::String> rhskeys;
+ for (LLSD::map_const_iterator rmi(rhs.beginMap()), rmend(rhs.endMap());
+ rmi != rmend; ++rmi)
+ {
+ rhskeys.insert(rmi->first);
+ }
+ // Now walk all the lhs keys.
+ for (LLSD::map_const_iterator lmi(lhs.beginMap()), lmend(lhs.endMap());
+ lmi != lmend; ++lmi)
+ {
+ // Try to erase this lhs key from the set of rhs keys. If rhs has
+ // no such key, the maps are unequal. erase(key) returns count of
+ // items erased.
+ if (rhskeys.erase(lmi->first) != 1)
+ return false;
+ // Both maps have the current key. Compare values.
+ if (! llsd_equals(lmi->second, rhs[lmi->first]))
+ return false;
+ }
+ // We've now established that all the lhs keys have equal values in
+ // both maps. The maps are equal unless rhs contains a superset of
+ // those keys.
+ return rhskeys.empty();
+ }
+
+ default:
+ // We expect that every possible type() value is specifically handled
+ // above. Failing to extend this switch to support a new LLSD type is
+ // an error that must be brought to the coder's attention.
+ LL_ERRS("llsd_equals") << "llsd_equals(" << lhs << ", " << rhs << "): "
+ "unknown type " << lhs.type() << LL_ENDL;
+ return false; // pacify the compiler
+ }
+}
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index 501600f1d9..6a6c396687 100644
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -35,62 +35,32 @@
#ifndef LL_LLSDUTIL_H
#define LL_LLSDUTIL_H
-#include "llsd.h"
-
-// vector3
-class LLVector3;
-LLSD ll_sd_from_vector3(const LLVector3& vec);
-LLVector3 ll_vector3_from_sd(const LLSD& sd, S32 start_index = 0);
-
-// vector4
-class LLVector4;
-LLSD ll_sd_from_vector4(const LLVector4& vec);
-LLVector4 ll_vector4_from_sd(const LLSD& sd, S32 start_index = 0);
-
-// vector3d (double)
-class LLVector3d;
-LLSD ll_sd_from_vector3d(const LLVector3d& vec);
-LLVector3d ll_vector3d_from_sd(const LLSD& sd, S32 start_index = 0);
-
-// vector2
-class LLVector2;
-LLSD ll_sd_from_vector2(const LLVector2& vec);
-LLVector2 ll_vector2_from_sd(const LLSD& sd);
-
-// Quaternion
-class LLQuaternion;
-LLSD ll_sd_from_quaternion(const LLQuaternion& quat);
-LLQuaternion ll_quaternion_from_sd(const LLSD& sd);
-
-// color4
-class LLColor4;
-LLSD ll_sd_from_color4(const LLColor4& c);
-LLColor4 ll_color4_from_sd(const LLSD& sd);
+class LLSD;
// U32
-LLSD ll_sd_from_U32(const U32);
-U32 ll_U32_from_sd(const LLSD& sd);
+LL_COMMON_API LLSD ll_sd_from_U32(const U32);
+LL_COMMON_API U32 ll_U32_from_sd(const LLSD& sd);
// U64
-LLSD ll_sd_from_U64(const U64);
-U64 ll_U64_from_sd(const LLSD& sd);
+LL_COMMON_API LLSD ll_sd_from_U64(const U64);
+LL_COMMON_API U64 ll_U64_from_sd(const LLSD& sd);
// IP Address
-LLSD ll_sd_from_ipaddr(const U32);
-U32 ll_ipaddr_from_sd(const LLSD& sd);
+LL_COMMON_API LLSD ll_sd_from_ipaddr(const U32);
+LL_COMMON_API U32 ll_ipaddr_from_sd(const LLSD& sd);
// Binary to string
-LLSD ll_string_from_binary(const LLSD& sd);
+LL_COMMON_API LLSD ll_string_from_binary(const LLSD& sd);
//String to binary
-LLSD ll_binary_from_string(const LLSD& sd);
+LL_COMMON_API LLSD ll_binary_from_string(const LLSD& sd);
// Serializes sd to static buffer and returns pointer, useful for gdb debugging.
-char* ll_print_sd(const LLSD& sd);
+LL_COMMON_API char* ll_print_sd(const LLSD& sd);
// Serializes sd to static buffer and returns pointer, using "pretty printing" mode.
-char* ll_pretty_print_sd_ptr(const LLSD* sd);
-char* ll_pretty_print_sd(const LLSD& sd);
+LL_COMMON_API char* ll_pretty_print_sd_ptr(const LLSD* sd);
+LL_COMMON_API char* ll_pretty_print_sd(const LLSD& sd);
//compares the structure of an LLSD to a template LLSD and stores the
//"valid" values in a 3rd LLSD. Default values
@@ -99,11 +69,69 @@ char* ll_pretty_print_sd(const LLSD& sd);
//Returns false if the test is of same type but values differ in type
//Otherwise, returns true
-BOOL compare_llsd_with_template(
+LL_COMMON_API BOOL compare_llsd_with_template(
const LLSD& llsd_to_test,
const LLSD& template_llsd,
LLSD& resultant_llsd);
+/**
+ * Recursively determine whether a given LLSD data block "matches" another
+ * LLSD prototype. The returned string is empty() on success, non-empty() on
+ * mismatch.
+ *
+ * This function tests structure (types) rather than data values. It is
+ * intended for when a consumer expects an LLSD block with a particular
+ * structure, and must succinctly detect whether the arriving block is
+ * well-formed. For instance, a test of the form:
+ * @code
+ * if (! (data.has("request") && data.has("target") && data.has("modifier") ...))
+ * @endcode
+ * could instead be expressed by initializing a prototype LLSD map with the
+ * required keys and writing:
+ * @code
+ * if (! llsd_matches(prototype, data).empty())
+ * @endcode
+ *
+ * A non-empty return value is an error-message fragment intended to indicate
+ * to (English-speaking) developers where in the prototype structure the
+ * mismatch occurred.
+ *
+ * * If a slot in the prototype isUndefined(), then anything is valid at that
+ * place in the real object. (Passing prototype == LLSD() matches anything
+ * at all.)
+ * * An array in the prototype must match a data array at least that large.
+ * (Additional entries in the data array are ignored.) Every isDefined()
+ * entry in the prototype array must match the corresponding entry in the
+ * data array.
+ * * A map in the prototype must match a map in the data. Every key in the
+ * prototype map must match a corresponding key in the data map. (Additional
+ * keys in the data map are ignored.) Every isDefined() value in the
+ * prototype map must match the corresponding key's value in the data map.
+ * * Scalar values in the prototype are tested for @em type rather than value.
+ * For instance, a String in the prototype matches any String at all. In
+ * effect, storing an Integer at a particular place in the prototype asserts
+ * that the caller intends to apply asInteger() to the corresponding slot in
+ * the data.
+ * * A String in the prototype matches String, Boolean, Integer, Real, UUID,
+ * Date and URI, because asString() applied to any of these produces a
+ * meaningful result.
+ * * Similarly, a Boolean, Integer or Real in the prototype can match any of
+ * Boolean, Integer or Real in the data -- or even String.
+ * * UUID matches UUID or String.
+ * * Date matches Date or String.
+ * * URI matches URI or String.
+ * * Binary in the prototype matches only Binary in the data.
+ *
+ * @TODO: when a Boolean, Integer or Real in the prototype matches a String in
+ * the data, we should examine the String @em value to ensure it can be
+ * meaningfully converted to the requested type. The same goes for UUID, Date
+ * and URI.
+ */
+LL_COMMON_API std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::string& pfx="");
+
+/// Deep equality
+LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs);
+
// Simple function to copy data out of input & output iterators if
// there is no need for casting.
template<typename Input> LLSD llsd_copy_array(Input iter, Input end)
diff --git a/indra/llcommon/llsecondlifeurls.h b/indra/llcommon/llsecondlifeurls.h
index a2e5f0b9c6..bd2f9f7604 100644
--- a/indra/llcommon/llsecondlifeurls.h
+++ b/indra/llcommon/llsecondlifeurls.h
@@ -34,49 +34,49 @@
#define LL_LLSECONDLIFEURLS_H
/*
// Account registration web page
-extern const std::string CREATE_ACCOUNT_URL;
+LL_COMMON_API extern const std::string CREATE_ACCOUNT_URL;
// Manage Account
-extern const std::string MANAGE_ACCOUNT;
+LL_COMMON_API extern const std::string MANAGE_ACCOUNT;
-extern const std::string AUCTION_URL;
+LL_COMMON_API extern const std::string AUCTION_URL;
-extern const std::string EVENTS_URL;
+LL_COMMON_API extern const std::string EVENTS_URL;
*/
// Tier up to a new land level.
-extern const std::string TIER_UP_URL;
+LL_COMMON_API extern const std::string TIER_UP_URL;
// Tier up to a new land level.
-extern const std::string LAND_URL;
+LL_COMMON_API extern const std::string LAND_URL;
// How to get DirectX 9
-extern const std::string DIRECTX_9_URL;
+LL_COMMON_API extern const std::string DIRECTX_9_URL;
/*
// Upgrade from basic membership to premium membership
-extern const std::string UPGRADE_TO_PREMIUM_URL;
+LL_COMMON_API extern const std::string UPGRADE_TO_PREMIUM_URL;
// Out of date VIA chipset
-extern const std::string VIA_URL;
+LL_COMMON_API extern const std::string VIA_URL;
// Support URL
-extern const std::string SUPPORT_URL;
+LL_COMMON_API extern const std::string SUPPORT_URL;
// Linden Blogs page
-extern const std::string BLOGS_URL;
+LL_COMMON_API extern const std::string BLOGS_URL;
// Currency page
-extern const std::string BUY_CURRENCY_URL;
+LL_COMMON_API extern const std::string BUY_CURRENCY_URL;
// LSL script wiki
-extern const std::string LSL_DOC_URL;
+LL_COMMON_API extern const std::string LSL_DOC_URL;
// SL KnowledgeBase page
-extern const std::string SL_KB_URL;
+LL_COMMON_API extern const std::string SL_KB_URL;
// Release Notes Redirect URL for Server and Viewer
-extern const std::string RELEASE_NOTES_BASE_URL;
+LL_COMMON_API extern const std::string RELEASE_NOTES_BASE_URL;
*/
#endif
diff --git a/indra/llcommon/llsimplehash.h b/indra/llcommon/llsimplehash.h
index 0ba2a3014c..5df93b646e 100644
--- a/indra/llcommon/llsimplehash.h
+++ b/indra/llcommon/llsimplehash.h
@@ -64,7 +64,7 @@ public:
};
template <typename HASH_KEY_TYPE, int TABLE_SIZE>
-class LLSimpleHash
+class LL_COMMON_API LLSimpleHash
{
public:
LLSimpleHash()
diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp
new file mode 100644
index 0000000000..6b5feaf1c4
--- /dev/null
+++ b/indra/llcommon/llsingleton.cpp
@@ -0,0 +1,38 @@
+/**
+ * @file llsingleton.cpp
+ * @author Brad Kittenbrink
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
+ * Copyright (c) 2009-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llsingleton.h"
+
+std::map<std::string, void *> * LLSingletonRegistry::sSingletonMap = NULL;
+
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h
index 2e7d845bf7..f55fafadd8 100644
--- a/indra/llcommon/llsingleton.h
+++ b/indra/llcommon/llsingleton.h
@@ -33,7 +33,41 @@
#include "llerror.h" // *TODO: eliminate this
+#include <typeinfo>
#include <boost/noncopyable.hpp>
+#include <boost/any.hpp>
+
+/// @brief A global registry of all singletons to prevent duplicate allocations
+/// across shared library boundaries
+class LL_COMMON_API LLSingletonRegistry {
+ private:
+ typedef std::map<std::string, void *> TypeMap;
+ static TypeMap * sSingletonMap;
+
+ static void checkInit()
+ {
+ if(sSingletonMap == NULL)
+ {
+ sSingletonMap = new TypeMap();
+ }
+ }
+
+ public:
+ template<typename T> static void * & get()
+ {
+ std::string name(typeid(T).name());
+
+ checkInit();
+
+ // the first entry of the pair returned by insert will be either the existing
+ // iterator matching our key, or the newly inserted NULL initialized entry
+ // see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html
+ TypeMap::iterator result =
+ sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first;
+
+ return result->second;
+ }
+};
// LLSingleton implements the getInstance() method part of the Singleton
// pattern. It can't make the derived class constructors protected, though, so
@@ -107,8 +141,17 @@ public:
static SingletonInstanceData& getData()
{
- static SingletonInstanceData data;
- return data;
+ // this is static to cache the lookup results
+ static void * & registry = LLSingletonRegistry::get<DERIVED_TYPE>();
+
+ // *TODO - look into making this threadsafe
+ if(NULL == registry)
+ {
+ static SingletonInstanceData data;
+ registry = &data;
+ }
+
+ return *static_cast<SingletonInstanceData *>(registry);
}
static DERIVED_TYPE* getInstance()
diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp
index 4be91b5b11..3cb074257b 100644
--- a/indra/llcommon/llstacktrace.cpp
+++ b/indra/llcommon/llstacktrace.cpp
@@ -1,141 +1,142 @@
-/**
- * @file llstacktrace.cpp
- * @brief stack tracing functionality
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llstacktrace.h"
-
-#ifdef LL_WINDOWS
-
-#include <iostream>
-#include <sstream>
-
-#include "windows.h"
-#include "Dbghelp.h"
-
-typedef USHORT NTAPI RtlCaptureStackBackTrace_Function(
- IN ULONG frames_to_skip,
- IN ULONG frames_to_capture,
- OUT PVOID *backtrace,
- OUT PULONG backtrace_hash);
-
-static RtlCaptureStackBackTrace_Function* const RtlCaptureStackBackTrace_fn =
- (RtlCaptureStackBackTrace_Function*)
- GetProcAddress(GetModuleHandleA("ntdll.dll"), "RtlCaptureStackBackTrace");
-
-bool ll_get_stack_trace(std::vector<std::string>& lines)
-{
- const S32 MAX_STACK_DEPTH = 32;
- const S32 STRING_NAME_LENGTH = 200;
- const S32 FRAME_SKIP = 2;
- static BOOL symbolsLoaded = false;
- static BOOL firstCall = true;
-
- HANDLE hProc = GetCurrentProcess();
-
- // load the symbols if they're not loaded
- if(!symbolsLoaded && firstCall)
- {
- symbolsLoaded = SymInitialize(hProc, NULL, true);
- firstCall = false;
- }
-
- // if loaded, get the call stack
- if(symbolsLoaded)
- {
- // create the frames to hold the addresses
- void* frames[MAX_STACK_DEPTH];
- memset(frames, 0, sizeof(void*)*MAX_STACK_DEPTH);
- S32 depth = 0;
-
- // get the addresses
- depth = RtlCaptureStackBackTrace_fn(FRAME_SKIP, MAX_STACK_DEPTH, frames, NULL);
-
- IMAGEHLP_LINE64 line;
- memset(&line, 0, sizeof(IMAGEHLP_LINE64));
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
-
- // create something to hold address info
- PIMAGEHLP_SYMBOL64 pSym;
- pSym = (PIMAGEHLP_SYMBOL64)malloc(sizeof(IMAGEHLP_SYMBOL64) + STRING_NAME_LENGTH);
- memset(pSym, 0, sizeof(IMAGEHLP_SYMBOL64) + STRING_NAME_LENGTH);
- pSym->MaxNameLength = STRING_NAME_LENGTH;
- pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
-
- // get address info for each address frame
- // and store
- for(S32 i=0; i < depth; i++)
- {
- std::stringstream stack_line;
- BOOL ret;
-
- DWORD64 addr = (DWORD64)frames[i];
- ret = SymGetSymFromAddr64(hProc, addr, 0, pSym);
- if(ret)
- {
- stack_line << pSym->Name << " ";
- }
-
- DWORD dummy;
- ret = SymGetLineFromAddr64(hProc, addr, &dummy, &line);
- if(ret)
- {
- std::string file_name = line.FileName;
- std::string::size_type index = file_name.rfind("\\");
- stack_line << file_name.substr(index + 1, file_name.size()) << ":" << line.LineNumber;
- }
-
- lines.push_back(stack_line.str());
- }
-
- free(pSym);
-
- // TODO: figure out a way to cleanup symbol loading
- // Not hugely necessary, however.
- //SymCleanup(hProc);
- return true;
- }
- else
- {
- lines.push_back("Stack Trace Failed. PDB symbol info not loaded");
- }
-
- return false;
-}
-
-#else
-
-bool ll_get_stack_trace(std::vector<std::string>& lines)
-{
- return false;
-}
-
-#endif
-
+/**
+ * @file llstacktrace.cpp
+ * @brief stack tracing functionality
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llstacktrace.h"
+
+#ifdef LL_WINDOWS
+
+#include <iostream>
+#include <sstream>
+
+#include "windows.h"
+#include "Dbghelp.h"
+
+typedef USHORT NTAPI RtlCaptureStackBackTrace_Function(
+ IN ULONG frames_to_skip,
+ IN ULONG frames_to_capture,
+ OUT PVOID *backtrace,
+ OUT PULONG backtrace_hash);
+
+static RtlCaptureStackBackTrace_Function* const RtlCaptureStackBackTrace_fn =
+ (RtlCaptureStackBackTrace_Function*)
+ GetProcAddress(GetModuleHandleA("ntdll.dll"), "RtlCaptureStackBackTrace");
+
+bool ll_get_stack_trace(std::vector<std::string>& lines)
+{
+ const S32 MAX_STACK_DEPTH = 32;
+ const S32 STRING_NAME_LENGTH = 200;
+ const S32 FRAME_SKIP = 2;
+ static BOOL symbolsLoaded = false;
+ static BOOL firstCall = true;
+
+ HANDLE hProc = GetCurrentProcess();
+
+ // load the symbols if they're not loaded
+ if(!symbolsLoaded && firstCall)
+ {
+ symbolsLoaded = SymInitialize(hProc, NULL, true);
+ firstCall = false;
+ }
+
+ // if loaded, get the call stack
+ if(symbolsLoaded)
+ {
+ // create the frames to hold the addresses
+ void* frames[MAX_STACK_DEPTH];
+ memset(frames, 0, sizeof(void*)*MAX_STACK_DEPTH);
+ S32 depth = 0;
+
+ // get the addresses
+ depth = RtlCaptureStackBackTrace_fn(FRAME_SKIP, MAX_STACK_DEPTH, frames, NULL);
+
+ IMAGEHLP_LINE64 line;
+ memset(&line, 0, sizeof(IMAGEHLP_LINE64));
+ line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
+
+ // create something to hold address info
+ PIMAGEHLP_SYMBOL64 pSym;
+ pSym = (PIMAGEHLP_SYMBOL64)malloc(sizeof(IMAGEHLP_SYMBOL64) + STRING_NAME_LENGTH);
+ memset(pSym, 0, sizeof(IMAGEHLP_SYMBOL64) + STRING_NAME_LENGTH);
+ pSym->MaxNameLength = STRING_NAME_LENGTH;
+ pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
+
+ // get address info for each address frame
+ // and store
+ for(S32 i=0; i < depth; i++)
+ {
+ std::stringstream stack_line;
+ BOOL ret;
+
+ DWORD64 addr = (DWORD64)frames[i];
+ ret = SymGetSymFromAddr64(hProc, addr, 0, pSym);
+ if(ret)
+ {
+ stack_line << pSym->Name << " ";
+ }
+
+ DWORD dummy;
+ ret = SymGetLineFromAddr64(hProc, addr, &dummy, &line);
+ if(ret)
+ {
+ std::string file_name = line.FileName;
+ std::string::size_type index = file_name.rfind("\\");
+ stack_line << file_name.substr(index + 1, file_name.size()) << ":" << line.LineNumber;
+ }
+
+ lines.push_back(stack_line.str());
+ }
+
+ free(pSym);
+
+ // TODO: figure out a way to cleanup symbol loading
+ // Not hugely necessary, however.
+ //SymCleanup(hProc);
+ return true;
+ }
+ else
+ {
+ lines.push_back("Stack Trace Failed. PDB symbol info not loaded");
+ }
+
+ return false;
+}
+
+#else
+
+bool ll_get_stack_trace(std::vector<std::string>& lines)
+{
+ return false;
+}
+
+#endif
+
diff --git a/indra/llcommon/llstacktrace.h b/indra/llcommon/llstacktrace.h
index 609b934a97..b84b1aa6ad 100644
--- a/indra/llcommon/llstacktrace.h
+++ b/indra/llcommon/llstacktrace.h
@@ -1,44 +1,44 @@
-/**
- * @file llstacktrace.h
- * @brief stack trace functions
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-
-#ifndef LL_LLSTACKTRACE_H
-#define LL_LLSTACKTRACE_H
-
-#include "stdtypes.h"
-#include <vector>
-#include <string>
-
-bool ll_get_stack_trace(std::vector<std::string>& lines);
-
-#endif
-
+/**
+ * @file llstacktrace.h
+ * @brief stack trace functions
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+
+#ifndef LL_LLSTACKTRACE_H
+#define LL_LLSTACKTRACE_H
+
+#include "stdtypes.h"
+#include <vector>
+#include <string>
+
+LL_COMMON_API bool ll_get_stack_trace(std::vector<std::string>& lines);
+
+#endif
+
diff --git a/indra/llcommon/llstat.h b/indra/llcommon/llstat.h
index 76aa3963f4..bd73c9a6bb 100644
--- a/indra/llcommon/llstat.h
+++ b/indra/llcommon/llstat.h
@@ -52,7 +52,7 @@ class LLSD;
// amounts of time with very low memory cost.
//
-class LLStatAccum
+class LL_COMMON_API LLStatAccum
{
protected:
LLStatAccum(bool use_frame_timer);
@@ -116,7 +116,7 @@ public:
F64 mLastSampleValue;
};
-class LLStatMeasure : public LLStatAccum
+class LL_COMMON_API LLStatMeasure : public LLStatAccum
// gathers statistics about things that are measured
// ex.: tempature, time dilation
{
@@ -131,7 +131,7 @@ public:
};
-class LLStatRate : public LLStatAccum
+class LL_COMMON_API LLStatRate : public LLStatAccum
// gathers statistics about things that can be counted over time
// ex.: LSL instructions executed, messages sent, simulator frames completed
// renders it in terms of rate of thing per second
@@ -147,7 +147,7 @@ public:
};
-class LLStatTime : public LLStatAccum
+class LL_COMMON_API LLStatTime : public LLStatAccum
// gathers statistics about time spent in a block of code
// measure average duration per second in the block
{
@@ -178,7 +178,7 @@ private:
// Use this class on the stack to record statistics about an area of code
-class LLPerfBlock
+class LL_COMMON_API LLPerfBlock
{
public:
struct StatEntry
@@ -229,7 +229,7 @@ private:
// ----------------------------------------------------------------------------
-class LLPerfStats
+class LL_COMMON_API LLPerfStats
{
public:
LLPerfStats(const std::string& process_name = "unknown", S32 process_pid = 0);
@@ -265,7 +265,7 @@ private:
};
// ----------------------------------------------------------------------------
-class LLStat
+class LL_COMMON_API LLStat
{
private:
typedef std::multimap<std::string, LLStat*> stat_map_t;
diff --git a/indra/llcommon/llstreamtools.h b/indra/llcommon/llstreamtools.h
index a6dc4d51e2..f64e761409 100644
--- a/indra/llcommon/llstreamtools.h
+++ b/indra/llcommon/llstreamtools.h
@@ -39,23 +39,23 @@
// unless specifed otherwise these all return input_stream.good()
// skips spaces and tabs
-bool skip_whitespace(std::istream& input_stream);
+LL_COMMON_API bool skip_whitespace(std::istream& input_stream);
// skips whitespace and newlines
-bool skip_emptyspace(std::istream& input_stream);
+LL_COMMON_API bool skip_emptyspace(std::istream& input_stream);
// skips emptyspace and lines that start with a #
-bool skip_comments_and_emptyspace(std::istream& input_stream);
+LL_COMMON_API bool skip_comments_and_emptyspace(std::istream& input_stream);
// skips to character after next newline
-bool skip_line(std::istream& input_stream);
+LL_COMMON_API bool skip_line(std::istream& input_stream);
// skips to beginning of next non-emptyspace
-bool skip_to_next_word(std::istream& input_stream);
+LL_COMMON_API bool skip_to_next_word(std::istream& input_stream);
// skips to character after the end of next keyword
// a 'keyword' is defined as the first word on a line
-bool skip_to_end_of_next_keyword(const char* keyword, std::istream& input_stream);
+LL_COMMON_API bool skip_to_end_of_next_keyword(const char* keyword, std::istream& input_stream);
// skip_to_start_of_next_keyword() is disabled -- might tickle corruption bug
// in windows iostream
@@ -65,14 +65,14 @@ bool skip_to_end_of_next_keyword(const char* keyword, std::istream& input_stream
// characters are pulled out of input_stream and appended to output_string
// returns result of input_stream.good() after characters are pulled
-bool get_word(std::string& output_string, std::istream& input_stream);
-bool get_line(std::string& output_string, std::istream& input_stream);
+LL_COMMON_API bool get_word(std::string& output_string, std::istream& input_stream);
+LL_COMMON_API bool get_line(std::string& output_string, std::istream& input_stream);
// characters are pulled out of input_stream (up to a max of 'n')
// and appended to output_string
// returns result of input_stream.good() after characters are pulled
-bool get_word(std::string& output_string, std::istream& input_stream, int n);
-bool get_line(std::string& output_string, std::istream& input_stream, int n);
+LL_COMMON_API bool get_word(std::string& output_string, std::istream& input_stream, int n);
+LL_COMMON_API bool get_line(std::string& output_string, std::istream& input_stream, int n);
// unget_line() is disabled -- might tickle corruption bug in windows iostream
//// backs up the input_stream by line_size + 1 characters
@@ -82,28 +82,28 @@ bool get_line(std::string& output_string, std::istream& input_stream, int n);
// removes the last char in 'line' if it matches 'c'
// returns true if removed last char
-bool remove_last_char(char c, std::string& line);
+LL_COMMON_API bool remove_last_char(char c, std::string& line);
// replaces escaped characters with the correct characters from left to right
// "\\" ---> '\\'
// "\n" ---> '\n'
-void unescape_string(std::string& line);
+LL_COMMON_API void unescape_string(std::string& line);
// replaces unescaped characters with expanded equivalents from left to right
// '\\' ---> "\\"
// '\n' ---> "\n"
-void escape_string(std::string& line);
+LL_COMMON_API void escape_string(std::string& line);
// replaces each '\n' character with ' '
-void replace_newlines_with_whitespace(std::string& line);
+LL_COMMON_API void replace_newlines_with_whitespace(std::string& line);
// erases any double-quote characters in line
-void remove_double_quotes(std::string& line);
+LL_COMMON_API void remove_double_quotes(std::string& line);
// the 'keyword' is defined as the first word on a line
// the 'value' is everything after the keyword on the same line
// starting at the first non-whitespace and ending right before the newline
-void get_keyword_and_value(std::string& keyword,
+LL_COMMON_API void get_keyword_and_value(std::string& keyword,
std::string& value,
const std::string& line);
@@ -111,13 +111,13 @@ void get_keyword_and_value(std::string& keyword,
// read anymore or until we hit the count. Some istream
// implimentations have a max that they will read.
// Returns the number of bytes read.
-std::streamsize fullread(
+LL_COMMON_API std::streamsize fullread(
std::istream& istr,
char* buf,
std::streamsize requested);
-std::istream& operator>>(std::istream& str, const char *tocheck);
+LL_COMMON_API std::istream& operator>>(std::istream& str, const char *tocheck);
#endif
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index d0def896cf..181d6fd33f 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -1,1288 +1,1295 @@
-/**
- * @file llstring.h
- * @brief String utility functions and std::string class.
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
- */
-
-#ifndef LL_LLSTRING_H
-#define LL_LLSTRING_H
-
-#include <string>
-#include <locale>
-#include <iomanip>
-#include "llsd.h"
-#include "llfasttimer.h"
-
-#if LL_LINUX || LL_SOLARIS
-#include <wctype.h>
-#include <wchar.h>
-#endif
-
-#include <string.h>
-
-#if LL_SOLARIS
-// stricmp and strnicmp do not exist on Solaris:
-#define stricmp strcasecmp
-#define strnicmp strncasecmp
-#endif
-
-const char LL_UNKNOWN_CHAR = '?';
-
-#if LL_DARWIN || LL_LINUX || LL_SOLARIS
-// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
-#include <cstring>
-
-namespace std
-{
-template<>
-struct char_traits<U16>
-{
- typedef U16 char_type;
- typedef int int_type;
- typedef streampos pos_type;
- typedef streamoff off_type;
- typedef mbstate_t state_type;
-
- static void
- assign(char_type& __c1, const char_type& __c2)
- { __c1 = __c2; }
-
- static bool
- eq(const char_type& __c1, const char_type& __c2)
- { return __c1 == __c2; }
-
- static bool
- lt(const char_type& __c1, const char_type& __c2)
- { return __c1 < __c2; }
-
- static int
- compare(const char_type* __s1, const char_type* __s2, size_t __n)
- { return memcmp(__s1, __s2, __n * sizeof(char_type)); }
-
- static size_t
- length(const char_type* __s)
- {
- const char_type *cur_char = __s;
- while (*cur_char != 0)
- {
- ++cur_char;
- }
- return cur_char - __s;
- }
-
- static const char_type*
- find(const char_type* __s, size_t __n, const char_type& __a)
- { return static_cast<const char_type*>(memchr(__s, __a, __n * sizeof(char_type))); }
-
- static char_type*
- move(char_type* __s1, const char_type* __s2, size_t __n)
- { return static_cast<char_type*>(memmove(__s1, __s2, __n * sizeof(char_type))); }
-
- static char_type*
- copy(char_type* __s1, const char_type* __s2, size_t __n)
- { return static_cast<char_type*>(memcpy(__s1, __s2, __n * sizeof(char_type))); } /* Flawfinder: ignore */
-
- static char_type*
- assign(char_type* __s, size_t __n, char_type __a)
- {
- // This isn't right.
- //return static_cast<char_type*>(memset(__s, __a, __n * sizeof(char_type)));
-
- // I don't think there's a standard 'memset' for 16-bit values.
- // Do this the old-fashioned way.
-
- size_t __i;
- for(__i = 0; __i < __n; __i++)
- {
- __s[__i] = __a;
- }
- return __s;
- }
-
- static char_type
- to_char_type(const int_type& __c)
- { return static_cast<char_type>(__c); }
-
- static int_type
- to_int_type(const char_type& __c)
- { return static_cast<int_type>(__c); }
-
- static bool
- eq_int_type(const int_type& __c1, const int_type& __c2)
- { return __c1 == __c2; }
-
- static int_type
- eof() { return static_cast<int_type>(EOF); }
-
- static int_type
- not_eof(const int_type& __c)
- { return (__c == eof()) ? 0 : __c; }
- };
-};
-#endif
-
-class LLStringOps
-{
-private:
- static long sltOffset;
- static long localTimeOffset;
- static bool daylightSavings;
- static std::map<std::string, std::string> datetimeToCodes;
-
-public:
- static char toUpper(char elem) { return toupper((unsigned char)elem); }
- static llwchar toUpper(llwchar elem) { return towupper(elem); }
-
- static char toLower(char elem) { return tolower((unsigned char)elem); }
- static llwchar toLower(llwchar elem) { return towlower(elem); }
-
- static bool isSpace(char elem) { return isspace((unsigned char)elem) != 0; }
- static bool isSpace(llwchar elem) { return iswspace(elem) != 0; }
-
- static bool isUpper(char elem) { return isupper((unsigned char)elem) != 0; }
- static bool isUpper(llwchar elem) { return iswupper(elem) != 0; }
-
- static bool isLower(char elem) { return islower((unsigned char)elem) != 0; }
- static bool isLower(llwchar elem) { return iswlower(elem) != 0; }
-
- static bool isDigit(char a) { return isdigit((unsigned char)a) != 0; }
- static bool isDigit(llwchar a) { return iswdigit(a) != 0; }
-
- static bool isPunct(char a) { return ispunct((unsigned char)a) != 0; }
- static bool isPunct(llwchar a) { return iswpunct(a) != 0; }
-
- static bool isAlnum(char a) { return isalnum((unsigned char)a) != 0; }
- static bool isAlnum(llwchar a) { return iswalnum(a) != 0; }
-
- static S32 collate(const char* a, const char* b) { return strcoll(a, b); }
- static S32 collate(const llwchar* a, const llwchar* b);
-
- static void setupDatetimeInfo (bool daylight);
- static long getSltOffset (void) {return sltOffset;}
- static long getLocalTimeOffset (void) {return localTimeOffset;}
- static bool getDaylightSavings (void) {return daylightSavings;}
- static std::string getDatetimeCode (std::string key);
-};
-
-/**
- * @brief Return a string constructed from in without crashing if the
- * pointer is NULL.
- */
-std::string ll_safe_string(const char* in);
-std::string ll_safe_string(const char* in, S32 maxlen);
-
-
-// Allowing assignments from non-strings into format_map_t is apparently
-// *really* error-prone, so subclass std::string with just basic c'tors.
-class LLFormatMapString
-{
-public:
- LLFormatMapString() {};
- LLFormatMapString(const char* s) : mString(ll_safe_string(s)) {};
- LLFormatMapString(const std::string& s) : mString(s) {};
- operator std::string() const { return mString; }
- bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; }
- std::size_t length() const { return mString.length(); }
-
-private:
- std::string mString;
-};
-
-template <class T>
-class LLStringUtilBase
-{
-private:
- static std::string sLocale;
-
-public:
- typedef typename std::basic_string<T>::size_type size_type;
-
-public:
- /////////////////////////////////////////////////////////////////////////////////////////
- // Static Utility functions that operate on std::strings
-
- static std::basic_string<T> null;
-
- typedef std::map<LLFormatMapString, LLFormatMapString> format_map_t;
- static void getTokens(const std::basic_string<T>& instr, std::vector<std::basic_string<T> >& tokens, const std::basic_string<T>& delims);
- static void formatNumber(std::basic_string<T>& numStr, std::basic_string<T> decimals);
- static bool formatDatetime(std::basic_string<T>& replacement, std::basic_string<T> token, std::basic_string<T> param, S32 secFromEpoch);
- static S32 format(std::basic_string<T>& s, const format_map_t& substitutions);
- static S32 format(std::basic_string<T>& s, const LLSD& substitutions);
- static bool simpleReplacement(std::basic_string<T>& replacement, std::basic_string<T> token, const format_map_t& substitutions);
- static bool simpleReplacement(std::basic_string<T>& replacement, std::basic_string<T> token, const LLSD& substitutions);
- static void setLocale (std::string inLocale) {sLocale = inLocale;};
- static std::string getLocale (void) {return sLocale;};
-
- static bool isValidIndex(const std::basic_string<T>& string, size_type i)
- {
- return !string.empty() && (0 <= i) && (i <= string.size());
- }
-
- static void trimHead(std::basic_string<T>& string);
- static void trimTail(std::basic_string<T>& string);
- static void trim(std::basic_string<T>& string) { trimHead(string); trimTail(string); }
- static void truncate(std::basic_string<T>& string, size_type count);
-
- static void toUpper(std::basic_string<T>& string);
- static void toLower(std::basic_string<T>& string);
-
- // True if this is the head of s.
- static BOOL isHead( const std::basic_string<T>& string, const T* s );
-
- /**
- * @brief Returns true if string starts with substr
- *
- * If etither string or substr are empty, this method returns false.
- */
- static bool startsWith(
- const std::basic_string<T>& string,
- const std::basic_string<T>& substr);
-
- /**
- * @brief Returns true if string ends in substr
- *
- * If etither string or substr are empty, this method returns false.
- */
- static bool endsWith(
- const std::basic_string<T>& string,
- const std::basic_string<T>& substr);
-
- static void addCRLF(std::basic_string<T>& string);
- static void removeCRLF(std::basic_string<T>& string);
-
- static void replaceTabsWithSpaces( std::basic_string<T>& string, size_type spaces_per_tab );
- static void replaceNonstandardASCII( std::basic_string<T>& string, T replacement );
- static void replaceChar( std::basic_string<T>& string, T target, T replacement );
- static void replaceString( std::basic_string<T>& string, std::basic_string<T> target, std::basic_string<T> replacement );
-
- static BOOL containsNonprintable(const std::basic_string<T>& string);
- static void stripNonprintable(std::basic_string<T>& string);
-
- /**
- * @brief Unsafe way to make ascii characters. You should probably
- * only call this when interacting with the host operating system.
- * The 1 byte std::string does not work correctly.
- * The 2 and 4 byte std::string probably work, so LLWStringUtil::_makeASCII
- * should work.
- */
- static void _makeASCII(std::basic_string<T>& string);
-
- // Conversion to other data types
- static BOOL convertToBOOL(const std::basic_string<T>& string, BOOL& value);
- static BOOL convertToU8(const std::basic_string<T>& string, U8& value);
- static BOOL convertToS8(const std::basic_string<T>& string, S8& value);
- static BOOL convertToS16(const std::basic_string<T>& string, S16& value);
- static BOOL convertToU16(const std::basic_string<T>& string, U16& value);
- static BOOL convertToU32(const std::basic_string<T>& string, U32& value);
- static BOOL convertToS32(const std::basic_string<T>& string, S32& value);
- static BOOL convertToF32(const std::basic_string<T>& string, F32& value);
- static BOOL convertToF64(const std::basic_string<T>& string, F64& value);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // Utility functions for working with char*'s and strings
-
- // Like strcmp but also handles empty strings. Uses
- // current locale.
- static S32 compareStrings(const T* lhs, const T* rhs);
- static S32 compareStrings(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs);
-
- // case insensitive version of above. Uses current locale on
- // Win32, and falls back to a non-locale aware comparison on
- // Linux.
- static S32 compareInsensitive(const T* lhs, const T* rhs);
- static S32 compareInsensitive(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs);
-
- // Case sensitive comparison with good handling of numbers. Does not use current locale.
- // a.k.a. strdictcmp()
- static S32 compareDict(const std::basic_string<T>& a, const std::basic_string<T>& b);
-
- // Case *in*sensitive comparison with good handling of numbers. Does not use current locale.
- // a.k.a. strdictcmp()
- static S32 compareDictInsensitive(const std::basic_string<T>& a, const std::basic_string<T>& b);
-
- // Puts compareDict() in a form appropriate for LL container classes to use for sorting.
- static BOOL precedesDict( const std::basic_string<T>& a, const std::basic_string<T>& b );
-
- // A replacement for strncpy.
- // If the dst buffer is dst_size bytes long or more, ensures that dst is null terminated and holds
- // up to dst_size-1 characters of src.
- static void copy(T* dst, const T* src, size_type dst_size);
-
- // Copies src into dst at a given offset.
- static void copyInto(std::basic_string<T>& dst, const std::basic_string<T>& src, size_type offset);
-
- static bool isPartOfWord(T c) { return (c == (T)'_') || LLStringOps::isAlnum(c); }
-
-
-#ifdef _DEBUG
- static void testHarness();
-#endif
-
-private:
- static size_type getSubstitution(const std::basic_string<T>& instr, size_type& start, std::vector<std::basic_string<T> >& tokens);
-};
-
-template<class T> std::basic_string<T> LLStringUtilBase<T>::null;
-template<class T> std::string LLStringUtilBase<T>::sLocale;
-
-typedef LLStringUtilBase<char> LLStringUtil;
-typedef LLStringUtilBase<llwchar> LLWStringUtil;
-typedef std::basic_string<llwchar> LLWString;
-
-//@ Use this where we want to disallow input in the form of "foo"
-// This is used to catch places where english text is embedded in the code
-// instead of in a translatable XUI file.
-class LLStringExplicit : public std::string
-{
-public:
- explicit LLStringExplicit(const char* s) : std::string(s) {}
- LLStringExplicit(const std::string& s) : std::string(s) {}
- LLStringExplicit(const std::string& s, size_type pos, size_type n = std::string::npos) : std::string(s, pos, n) {}
-};
-
-struct LLDictionaryLess
-{
-public:
- bool operator()(const std::string& a, const std::string& b)
- {
- return (LLStringUtil::precedesDict(a, b) ? true : false);
- }
-};
-
-
-/**
- * Simple support functions
- */
-
-/**
- * @brief chop off the trailing characters in a string.
- *
- * This function works on bytes rather than glyphs, so this will
- * incorrectly truncate non-single byte strings.
- * Use utf8str_truncate() for utf8 strings
- * @return a copy of in string minus the trailing count bytes.
- */
-inline std::string chop_tail_copy(
- const std::string& in,
- std::string::size_type count)
-{
- return std::string(in, 0, in.length() - count);
-}
-
-/**
- * @brief This translates a nybble stored as a hex value from 0-f back
- * to a nybble in the low order bits of the return byte.
- */
-U8 hex_as_nybble(char hex);
-
-/**
- * @brief read the contents of a file into a string.
- *
- * Since this function has no concept of character encoding, most
- * anything you do with this method ill-advised. Please avoid.
- * @param str [out] The string which will have.
- * @param filename The full name of the file to read.
- * @return Returns true on success. If false, str is unmodified.
- */
-bool _read_file_into_string(std::string& str, const std::string& filename);
-bool iswindividual(llwchar elem);
-
-/**
- * Unicode support
- */
-
-// Make the incoming string a utf8 string. Replaces any unknown glyph
-// with the UNKOWN_CHARACTER. Once any unknown glph is found, the rest
-// of the data may not be recovered.
-std::string rawstr_to_utf8(const std::string& raw);
-
-//
-// We should never use UTF16 except when communicating with Win32!
-//
-typedef std::basic_string<U16> llutf16string;
-
-LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len);
-LLWString utf16str_to_wstring(const llutf16string &utf16str);
-
-llutf16string wstring_to_utf16str(const LLWString &utf32str, S32 len);
-llutf16string wstring_to_utf16str(const LLWString &utf32str);
-
-llutf16string utf8str_to_utf16str ( const std::string& utf8str, S32 len);
-llutf16string utf8str_to_utf16str ( const std::string& utf8str );
-
-LLWString utf8str_to_wstring(const std::string &utf8str, S32 len);
-LLWString utf8str_to_wstring(const std::string &utf8str);
-// Same function, better name. JC
-inline LLWString utf8string_to_wstring(const std::string& utf8_string) { return utf8str_to_wstring(utf8_string); }
-
-//
-S32 wchar_to_utf8chars(llwchar inchar, char* outchars);
-
-std::string wstring_to_utf8str(const LLWString &utf32str, S32 len);
-std::string wstring_to_utf8str(const LLWString &utf32str);
-
-std::string utf16str_to_utf8str(const llutf16string &utf16str, S32 len);
-std::string utf16str_to_utf8str(const llutf16string &utf16str);
-
-// Length of this UTF32 string in bytes when transformed to UTF8
-S32 wstring_utf8_length(const LLWString& wstr);
-
-// Length in bytes of this wide char in a UTF8 string
-S32 wchar_utf8_length(const llwchar wc);
-
-std::string utf8str_tolower(const std::string& utf8str);
-
-// Length in llwchar (UTF-32) of the first len units (16 bits) of the given UTF-16 string.
-S32 utf16str_wstring_length(const llutf16string &utf16str, S32 len);
-
-// Length in utf16string (UTF-16) of wlen wchars beginning at woffset.
-S32 wstring_utf16_length(const LLWString & wstr, S32 woffset, S32 wlen);
-
-// Length in wstring (i.e., llwchar count) of a part of a wstring specified by utf16 length (i.e., utf16 units.)
-S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, BOOL *unaligned = NULL);
-
-/**
- * @brief Properly truncate a utf8 string to a maximum byte count.
- *
- * The returned string may be less than max_len if the truncation
- * happens in the middle of a glyph. If max_len is longer than the
- * string passed in, the return value == utf8str.
- * @param utf8str A valid utf8 string to truncate.
- * @param max_len The maximum number of bytes in the return value.
- * @return Returns a valid utf8 string with byte count <= max_len.
- */
-std::string utf8str_truncate(const std::string& utf8str, const S32 max_len);
-
-std::string utf8str_trim(const std::string& utf8str);
-
-S32 utf8str_compare_insensitive(
- const std::string& lhs,
- const std::string& rhs);
-
-/**
- * @brief Replace all occurences of target_char with replace_char
- *
- * @param utf8str A utf8 string to process.
- * @param target_char The wchar to be replaced
- * @param replace_char The wchar which is written on replace
- */
-std::string utf8str_substChar(
- const std::string& utf8str,
- const llwchar target_char,
- const llwchar replace_char);
-
-std::string utf8str_makeASCII(const std::string& utf8str);
-
-// Hack - used for evil notecards.
-std::string mbcsstring_makeASCII(const std::string& str);
-
-std::string utf8str_removeCRLF(const std::string& utf8str);
-
-
-#if LL_WINDOWS
-/* @name Windows string helpers
- */
-//@{
-
-/**
- * @brief Implementation the expected snprintf interface.
- *
- * If the size of the passed in buffer is not large enough to hold the string,
- * two bad things happen:
- * 1. resulting formatted string is NOT null terminated
- * 2. Depending on the platform, the return value could be a) the required
- * size of the buffer to copy the entire formatted string or b) -1.
- * On Windows with VS.Net 2003, it returns -1 e.g.
- *
- * safe_snprintf always adds a NULL terminator so that the caller does not
- * need to check for return value or need to add the NULL terminator.
- * It does not, however change the return value - to let the caller know
- * that the passed in buffer size was not large enough to hold the
- * formatted string.
- *
- */
-int safe_snprintf(char* str, size_t size, const char* format, ...);
-
-/**
- * @brief Convert a wide string to std::string
- *
- * This replaces the unsafe W2A macro from ATL.
- */
-std::string ll_convert_wide_to_string(const wchar_t* in);
-
-//@}
-#endif // LL_WINDOWS
-
-/**
- * Many of the 'strip' and 'replace' methods of LLStringUtilBase need
- * specialization to work with the signed char type.
- * Sadly, it is not possible (AFAIK) to specialize a single method of
- * a template class.
- * That stuff should go here.
- */
-namespace LLStringFn
-{
- /**
- * @brief Replace all non-printable characters with replacement in
- * string.
- * NOTE - this will zap non-ascii
- *
- * @param [in,out] string the to modify. out value is the string
- * with zero non-printable characters.
- * @param The replacement character. use LL_UNKNOWN_CHAR if unsure.
- */
- void replace_nonprintable_in_ascii(
- std::basic_string<char>& string,
- char replacement);
-
-
- /**
- * @brief Replace all non-printable characters and pipe characters
- * with replacement in a string.
- * NOTE - this will zap non-ascii
- *
- * @param [in,out] the string to modify. out value is the string
- * with zero non-printable characters and zero pipe characters.
- * @param The replacement character. use LL_UNKNOWN_CHAR if unsure.
- */
- void replace_nonprintable_and_pipe_in_ascii(std::basic_string<char>& str,
- char replacement);
-
-
- /**
- * @brief Remove all characters that are not allowed in XML 1.0.
- * Returns a copy of the string with those characters removed.
- * Works with US ASCII and UTF-8 encoded strings. JC
- */
- std::string strip_invalid_xml(const std::string& input);
-
-
- /**
- * @brief Replace all control characters (0 <= c < 0x20) with replacement in
- * string. This is safe for utf-8
- *
- * @param [in,out] string the to modify. out value is the string
- * with zero non-printable characters.
- * @param The replacement character. use LL_UNKNOWN_CHAR if unsure.
- */
- void replace_ascii_controlchars(
- std::basic_string<char>& string,
- char replacement);
-}
-
-////////////////////////////////////////////////////////////
-// NOTE: LLStringUtil::format, getTokens, and support functions moved to llstring.cpp.
-// There is no LLWStringUtil::format implementation currently.
-// Calling thse for anything other than LLStringUtil will produce link errors.
-
-////////////////////////////////////////////////////////////
-
-
-// static
-template<class T>
-S32 LLStringUtilBase<T>::compareStrings(const T* lhs, const T* rhs)
-{
- S32 result;
- if( lhs == rhs )
- {
- result = 0;
- }
- else
- if ( !lhs || !lhs[0] )
- {
- result = ((!rhs || !rhs[0]) ? 0 : 1);
- }
- else
- if ( !rhs || !rhs[0])
- {
- result = -1;
- }
- else
- {
- result = LLStringOps::collate(lhs, rhs);
- }
- return result;
-}
-
-//static
-template<class T>
-S32 LLStringUtilBase<T>::compareStrings(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs)
-{
- return LLStringOps::collate(lhs.c_str(), rhs.c_str());
-}
-
-// static
-template<class T>
-S32 LLStringUtilBase<T>::compareInsensitive(const T* lhs, const T* rhs )
-{
- S32 result;
- if( lhs == rhs )
- {
- result = 0;
- }
- else
- if ( !lhs || !lhs[0] )
- {
- result = ((!rhs || !rhs[0]) ? 0 : 1);
- }
- else
- if ( !rhs || !rhs[0] )
- {
- result = -1;
- }
- else
- {
- std::basic_string<T> lhs_string(lhs);
- std::basic_string<T> rhs_string(rhs);
- LLStringUtilBase<T>::toUpper(lhs_string);
- LLStringUtilBase<T>::toUpper(rhs_string);
- result = LLStringOps::collate(lhs_string.c_str(), rhs_string.c_str());
- }
- return result;
-}
-
-//static
-template<class T>
-S32 LLStringUtilBase<T>::compareInsensitive(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs)
-{
- std::basic_string<T> lhs_string(lhs);
- std::basic_string<T> rhs_string(rhs);
- LLStringUtilBase<T>::toUpper(lhs_string);
- LLStringUtilBase<T>::toUpper(rhs_string);
- return LLStringOps::collate(lhs_string.c_str(), rhs_string.c_str());
-}
-
-// Case sensitive comparison with good handling of numbers. Does not use current locale.
-// a.k.a. strdictcmp()
-
-//static
-template<class T>
-S32 LLStringUtilBase<T>::compareDict(const std::basic_string<T>& astr, const std::basic_string<T>& bstr)
-{
- const T* a = astr.c_str();
- const T* b = bstr.c_str();
- T ca, cb;
- S32 ai, bi, cnt = 0;
- S32 bias = 0;
-
- ca = *(a++);
- cb = *(b++);
- while( ca && cb ){
- if( bias==0 ){
- if( LLStringOps::isUpper(ca) ){ ca = LLStringOps::toLower(ca); bias--; }
- if( LLStringOps::isUpper(cb) ){ cb = LLStringOps::toLower(cb); bias++; }
- }else{
- if( LLStringOps::isUpper(ca) ){ ca = LLStringOps::toLower(ca); }
- if( LLStringOps::isUpper(cb) ){ cb = LLStringOps::toLower(cb); }
- }
- if( LLStringOps::isDigit(ca) ){
- if( cnt-->0 ){
- if( cb!=ca ) break;
- }else{
- if( !LLStringOps::isDigit(cb) ) break;
- for(ai=0; LLStringOps::isDigit(a[ai]); ai++);
- for(bi=0; LLStringOps::isDigit(b[bi]); bi++);
- if( ai<bi ){ ca=0; break; }
- if( bi<ai ){ cb=0; break; }
- if( ca!=cb ) break;
- cnt = ai;
- }
- }else if( ca!=cb ){ break;
- }
- ca = *(a++);
- cb = *(b++);
- }
- if( ca==cb ) ca += bias;
- return ca-cb;
-}
-
-// static
-template<class T>
-S32 LLStringUtilBase<T>::compareDictInsensitive(const std::basic_string<T>& astr, const std::basic_string<T>& bstr)
-{
- const T* a = astr.c_str();
- const T* b = bstr.c_str();
- T ca, cb;
- S32 ai, bi, cnt = 0;
-
- ca = *(a++);
- cb = *(b++);
- while( ca && cb ){
- if( LLStringOps::isUpper(ca) ){ ca = LLStringOps::toLower(ca); }
- if( LLStringOps::isUpper(cb) ){ cb = LLStringOps::toLower(cb); }
- if( LLStringOps::isDigit(ca) ){
- if( cnt-->0 ){
- if( cb!=ca ) break;
- }else{
- if( !LLStringOps::isDigit(cb) ) break;
- for(ai=0; LLStringOps::isDigit(a[ai]); ai++);
- for(bi=0; LLStringOps::isDigit(b[bi]); bi++);
- if( ai<bi ){ ca=0; break; }
- if( bi<ai ){ cb=0; break; }
- if( ca!=cb ) break;
- cnt = ai;
- }
- }else if( ca!=cb ){ break;
- }
- ca = *(a++);
- cb = *(b++);
- }
- return ca-cb;
-}
-
-// Puts compareDict() in a form appropriate for LL container classes to use for sorting.
-// static
-template<class T>
-BOOL LLStringUtilBase<T>::precedesDict( const std::basic_string<T>& a, const std::basic_string<T>& b )
-{
- if( a.size() && b.size() )
- {
- return (LLStringUtilBase<T>::compareDict(a.c_str(), b.c_str()) < 0);
- }
- else
- {
- return (!b.empty());
- }
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::toUpper(std::basic_string<T>& string)
-{
- if( !string.empty() )
- {
- std::transform(
- string.begin(),
- string.end(),
- string.begin(),
- (T(*)(T)) &LLStringOps::toUpper);
- }
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::toLower(std::basic_string<T>& string)
-{
- if( !string.empty() )
- {
- std::transform(
- string.begin(),
- string.end(),
- string.begin(),
- (T(*)(T)) &LLStringOps::toLower);
- }
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::trimHead(std::basic_string<T>& string)
-{
- if( !string.empty() )
- {
- size_type i = 0;
- while( i < string.length() && LLStringOps::isSpace( string[i] ) )
- {
- i++;
- }
- string.erase(0, i);
- }
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::trimTail(std::basic_string<T>& string)
-{
- if( string.size() )
- {
- size_type len = string.length();
- size_type i = len;
- while( i > 0 && LLStringOps::isSpace( string[i-1] ) )
- {
- i--;
- }
-
- string.erase( i, len - i );
- }
-}
-
-
-// Replace line feeds with carriage return-line feed pairs.
-//static
-template<class T>
-void LLStringUtilBase<T>::addCRLF(std::basic_string<T>& string)
-{
- const T LF = 10;
- const T CR = 13;
-
- // Count the number of line feeds
- size_type count = 0;
- size_type len = string.size();
- size_type i;
- for( i = 0; i < len; i++ )
- {
- if( string[i] == LF )
- {
- count++;
- }
- }
-
- // Insert a carriage return before each line feed
- if( count )
- {
- size_type size = len + count;
- T *t = new T[size];
- size_type j = 0;
- for( i = 0; i < len; ++i )
- {
- if( string[i] == LF )
- {
- t[j] = CR;
- ++j;
- }
- t[j] = string[i];
- ++j;
- }
-
- string.assign(t, size);
- }
-}
-
-// Remove all carriage returns
-//static
-template<class T>
-void LLStringUtilBase<T>::removeCRLF(std::basic_string<T>& string)
-{
- const T CR = 13;
-
- size_type cr_count = 0;
- size_type len = string.size();
- size_type i;
- for( i = 0; i < len - cr_count; i++ )
- {
- if( string[i+cr_count] == CR )
- {
- cr_count++;
- }
-
- string[i] = string[i+cr_count];
- }
- string.erase(i, cr_count);
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::replaceChar( std::basic_string<T>& string, T target, T replacement )
-{
- size_type found_pos = 0;
- while( (found_pos = string.find(target, found_pos)) != std::basic_string<T>::npos )
- {
- string[found_pos] = replacement;
- found_pos++; // avoid infinite defeat if target == replacement
- }
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::replaceString( std::basic_string<T>& string, std::basic_string<T> target, std::basic_string<T> replacement )
-{
- size_type found_pos = 0;
- while( (found_pos = string.find(target, found_pos)) != std::basic_string<T>::npos )
- {
- string.replace( found_pos, target.length(), replacement );
- found_pos += replacement.length(); // avoid infinite defeat if replacement contains target
- }
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::replaceNonstandardASCII( std::basic_string<T>& string, T replacement )
-{
- const char LF = 10;
- const S8 MIN = 32;
-// const S8 MAX = 127;
-
- size_type len = string.size();
- for( size_type i = 0; i < len; i++ )
- {
- // No need to test MAX < mText[i] because we treat mText[i] as a signed char,
- // which has a max value of 127.
- if( ( S8(string[i]) < MIN ) && (string[i] != LF) )
- {
- string[i] = replacement;
- }
- }
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::replaceTabsWithSpaces( std::basic_string<T>& str, size_type spaces_per_tab )
-{
- const T TAB = '\t';
- const T SPACE = ' ';
-
- std::basic_string<T> out_str;
- // Replace tabs with spaces
- for (size_type i = 0; i < str.length(); i++)
- {
- if (str[i] == TAB)
- {
- for (size_type j = 0; j < spaces_per_tab; j++)
- out_str += SPACE;
- }
- else
- {
- out_str += str[i];
- }
- }
- str = out_str;
-}
-
-//static
-template<class T>
-BOOL LLStringUtilBase<T>::containsNonprintable(const std::basic_string<T>& string)
-{
- const char MIN = 32;
- BOOL rv = FALSE;
- for (size_type i = 0; i < string.size(); i++)
- {
- if(string[i] < MIN)
- {
- rv = TRUE;
- break;
- }
- }
- return rv;
-}
-
-//static
-template<class T>
-void LLStringUtilBase<T>::stripNonprintable(std::basic_string<T>& string)
-{
- const char MIN = 32;
- size_type j = 0;
- if (string.empty())
- {
- return;
- }
- char* c_string = new char[string.size() + 1];
- if(c_string == NULL)
- {
- return;
- }
- strcpy(c_string, string.c_str()); /*Flawfinder: ignore*/
- char* write_head = &c_string[0];
- for (size_type i = 0; i < string.size(); i++)
- {
- char* read_head = &string[i];
- write_head = &c_string[j];
- if(!(*read_head < MIN))
- {
- *write_head = *read_head;
- ++j;
- }
- }
- c_string[j]= '\0';
- string = c_string;
- delete []c_string;
-}
-
-template<class T>
-void LLStringUtilBase<T>::_makeASCII(std::basic_string<T>& string)
-{
- // Replace non-ASCII chars with LL_UNKNOWN_CHAR
- for (size_type i = 0; i < string.length(); i++)
- {
- if (string[i] > 0x7f)
- {
- string[i] = LL_UNKNOWN_CHAR;
- }
- }
-}
-
-// static
-template<class T>
-void LLStringUtilBase<T>::copy( T* dst, const T* src, size_type dst_size )
-{
- if( dst_size > 0 )
- {
- size_type min_len = 0;
- if( src )
- {
- min_len = llmin( dst_size - 1, strlen( src ) ); /* Flawfinder: ignore */
- memcpy(dst, src, min_len * sizeof(T)); /* Flawfinder: ignore */
- }
- dst[min_len] = '\0';
- }
-}
-
-// static
-template<class T>
-void LLStringUtilBase<T>::copyInto(std::basic_string<T>& dst, const std::basic_string<T>& src, size_type offset)
-{
- if ( offset == dst.length() )
- {
- // special case - append to end of string and avoid expensive
- // (when strings are large) string manipulations
- dst += src;
- }
- else
- {
- std::basic_string<T> tail = dst.substr(offset);
-
- dst = dst.substr(0, offset);
- dst += src;
- dst += tail;
- };
-}
-
-// True if this is the head of s.
-//static
-template<class T>
-BOOL LLStringUtilBase<T>::isHead( const std::basic_string<T>& string, const T* s )
-{
- if( string.empty() )
- {
- // Early exit
- return FALSE;
- }
- else
- {
- return (strncmp( s, string.c_str(), string.size() ) == 0);
- }
-}
-
-// static
-template<class T>
-bool LLStringUtilBase<T>::startsWith(
- const std::basic_string<T>& string,
- const std::basic_string<T>& substr)
-{
- if(string.empty() || (substr.empty())) return false;
- if(0 == string.find(substr)) return true;
- return false;
-}
-
-// static
-template<class T>
-bool LLStringUtilBase<T>::endsWith(
- const std::basic_string<T>& string,
- const std::basic_string<T>& substr)
-{
- if(string.empty() || (substr.empty())) return false;
- std::string::size_type idx = string.rfind(substr);
- if(std::string::npos == idx) return false;
- return (idx == (string.size() - substr.size()));
-}
-
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToBOOL(const std::basic_string<T>& string, BOOL& value)
-{
- if( string.empty() )
- {
- return FALSE;
- }
-
- std::basic_string<T> temp( string );
- trim(temp);
- if(
- (temp == "1") ||
- (temp == "T") ||
- (temp == "t") ||
- (temp == "TRUE") ||
- (temp == "true") ||
- (temp == "True") )
- {
- value = TRUE;
- return TRUE;
- }
- else
- if(
- (temp == "0") ||
- (temp == "F") ||
- (temp == "f") ||
- (temp == "FALSE") ||
- (temp == "false") ||
- (temp == "False") )
- {
- value = FALSE;
- return TRUE;
- }
-
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToU8(const std::basic_string<T>& string, U8& value)
-{
- S32 value32 = 0;
- BOOL success = convertToS32(string, value32);
- if( success && (U8_MIN <= value32) && (value32 <= U8_MAX) )
- {
- value = (U8) value32;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToS8(const std::basic_string<T>& string, S8& value)
-{
- S32 value32 = 0;
- BOOL success = convertToS32(string, value32);
- if( success && (S8_MIN <= value32) && (value32 <= S8_MAX) )
- {
- value = (S8) value32;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToS16(const std::basic_string<T>& string, S16& value)
-{
- S32 value32 = 0;
- BOOL success = convertToS32(string, value32);
- if( success && (S16_MIN <= value32) && (value32 <= S16_MAX) )
- {
- value = (S16) value32;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToU16(const std::basic_string<T>& string, U16& value)
-{
- S32 value32 = 0;
- BOOL success = convertToS32(string, value32);
- if( success && (U16_MIN <= value32) && (value32 <= U16_MAX) )
- {
- value = (U16) value32;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToU32(const std::basic_string<T>& string, U32& value)
-{
- if( string.empty() )
- {
- return FALSE;
- }
-
- std::basic_string<T> temp( string );
- trim(temp);
- U32 v;
- std::basic_istringstream<T> i_stream((std::basic_string<T>)temp);
- if(i_stream >> v)
- {
- value = v;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToS32(const std::basic_string<T>& string, S32& value)
-{
- if( string.empty() )
- {
- return FALSE;
- }
-
- std::basic_string<T> temp( string );
- trim(temp);
- S32 v;
- std::basic_istringstream<T> i_stream((std::basic_string<T>)temp);
- if(i_stream >> v)
- {
- //TODO: figure out overflow and underflow reporting here
- //if((LONG_MAX == v) || (LONG_MIN == v))
- //{
- // // Underflow or overflow
- // return FALSE;
- //}
-
- value = v;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToF32(const std::basic_string<T>& string, F32& value)
-{
- F64 value64 = 0.0;
- BOOL success = convertToF64(string, value64);
- if( success && (-F32_MAX <= value64) && (value64 <= F32_MAX) )
- {
- value = (F32) value64;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-BOOL LLStringUtilBase<T>::convertToF64(const std::basic_string<T>& string, F64& value)
-{
- if( string.empty() )
- {
- return FALSE;
- }
-
- std::basic_string<T> temp( string );
- trim(temp);
- F64 v;
- std::basic_istringstream<T> i_stream((std::basic_string<T>)temp);
- if(i_stream >> v)
- {
- //TODO: figure out overflow and underflow reporting here
- //if( ((-HUGE_VAL == v) || (HUGE_VAL == v))) )
- //{
- // // Underflow or overflow
- // return FALSE;
- //}
-
- value = v;
- return TRUE;
- }
- return FALSE;
-}
-
-template<class T>
-void LLStringUtilBase<T>::truncate(std::basic_string<T>& string, size_type count)
-{
- size_type cur_size = string.size();
- string.resize(count < cur_size ? count : cur_size);
-}
-
-#endif // LL_STRING_H
+/**
+ * @file llstring.h
+ * @brief String utility functions and std::string class.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLSTRING_H
+#define LL_LLSTRING_H
+
+#include <string>
+#include <locale>
+#include <iomanip>
+#include "llsd.h"
+#include "llfasttimer.h"
+
+#if LL_LINUX || LL_SOLARIS
+#include <wctype.h>
+#include <wchar.h>
+#endif
+
+#include <string.h>
+
+#if LL_SOLARIS
+// stricmp and strnicmp do not exist on Solaris:
+#define stricmp strcasecmp
+#define strnicmp strncasecmp
+#endif
+
+const char LL_UNKNOWN_CHAR = '?';
+
+#if LL_DARWIN || LL_LINUX || LL_SOLARIS
+// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
+#include <cstring>
+
+namespace std
+{
+template<>
+struct char_traits<U16>
+{
+ typedef U16 char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ { return memcmp(__s1, __s2, __n * sizeof(char_type)); }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ const char_type *cur_char = __s;
+ while (*cur_char != 0)
+ {
+ ++cur_char;
+ }
+ return cur_char - __s;
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ { return static_cast<const char_type*>(memchr(__s, __a, __n * sizeof(char_type))); }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(memmove(__s1, __s2, __n * sizeof(char_type))); }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(memcpy(__s1, __s2, __n * sizeof(char_type))); } /* Flawfinder: ignore */
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ // This isn't right.
+ //return static_cast<char_type*>(memset(__s, __a, __n * sizeof(char_type)));
+
+ // I don't think there's a standard 'memset' for 16-bit values.
+ // Do this the old-fashioned way.
+
+ size_t __i;
+ for(__i = 0; __i < __n; __i++)
+ {
+ __s[__i] = __a;
+ }
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof() { return static_cast<int_type>(EOF); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return (__c == eof()) ? 0 : __c; }
+ };
+};
+#endif
+
+class LL_COMMON_API LLStringOps
+{
+private:
+ static long sltOffset;
+ static long localTimeOffset;
+ static bool daylightSavings;
+ static std::map<std::string, std::string> datetimeToCodes;
+
+public:
+ static char toUpper(char elem) { return toupper((unsigned char)elem); }
+ static llwchar toUpper(llwchar elem) { return towupper(elem); }
+
+ static char toLower(char elem) { return tolower((unsigned char)elem); }
+ static llwchar toLower(llwchar elem) { return towlower(elem); }
+
+ static bool isSpace(char elem) { return isspace((unsigned char)elem) != 0; }
+ static bool isSpace(llwchar elem) { return iswspace(elem) != 0; }
+
+ static bool isUpper(char elem) { return isupper((unsigned char)elem) != 0; }
+ static bool isUpper(llwchar elem) { return iswupper(elem) != 0; }
+
+ static bool isLower(char elem) { return islower((unsigned char)elem) != 0; }
+ static bool isLower(llwchar elem) { return iswlower(elem) != 0; }
+
+ static bool isDigit(char a) { return isdigit((unsigned char)a) != 0; }
+ static bool isDigit(llwchar a) { return iswdigit(a) != 0; }
+
+ static bool isPunct(char a) { return ispunct((unsigned char)a) != 0; }
+ static bool isPunct(llwchar a) { return iswpunct(a) != 0; }
+
+ static bool isAlnum(char a) { return isalnum((unsigned char)a) != 0; }
+ static bool isAlnum(llwchar a) { return iswalnum(a) != 0; }
+
+ static S32 collate(const char* a, const char* b) { return strcoll(a, b); }
+ static S32 collate(const llwchar* a, const llwchar* b);
+
+ static void setupDatetimeInfo (bool daylight);
+ static long getSltOffset (void) {return sltOffset;}
+ static long getLocalTimeOffset (void) {return localTimeOffset;}
+ static bool getDaylightSavings (void) {return daylightSavings;}
+ static std::string getDatetimeCode (std::string key);
+};
+
+/**
+ * @brief Return a string constructed from in without crashing if the
+ * pointer is NULL.
+ */
+LL_COMMON_API std::string ll_safe_string(const char* in);
+LL_COMMON_API std::string ll_safe_string(const char* in, S32 maxlen);
+
+
+// Allowing assignments from non-strings into format_map_t is apparently
+// *really* error-prone, so subclass std::string with just basic c'tors.
+class LLFormatMapString
+{
+public:
+ LLFormatMapString() {};
+ LLFormatMapString(const char* s) : mString(ll_safe_string(s)) {};
+ LLFormatMapString(const std::string& s) : mString(s) {};
+ operator std::string() const { return mString; }
+ bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; }
+ std::size_t length() const { return mString.length(); }
+
+private:
+ std::string mString;
+};
+
+template <class T>
+class LLStringUtilBase
+{
+private:
+ static std::string sLocale;
+
+public:
+ typedef typename std::basic_string<T>::size_type size_type;
+
+public:
+ /////////////////////////////////////////////////////////////////////////////////////////
+ // Static Utility functions that operate on std::strings
+
+ static std::basic_string<T> null;
+
+ typedef std::map<LLFormatMapString, LLFormatMapString> format_map_t;
+ static void getTokens(const std::basic_string<T>& instr, std::vector<std::basic_string<T> >& tokens, const std::basic_string<T>& delims);
+ static void formatNumber(std::basic_string<T>& numStr, std::basic_string<T> decimals);
+ static bool formatDatetime(std::basic_string<T>& replacement, std::basic_string<T> token, std::basic_string<T> param, S32 secFromEpoch);
+ static S32 format(std::basic_string<T>& s, const format_map_t& substitutions);
+ static S32 format(std::basic_string<T>& s, const LLSD& substitutions);
+ static bool simpleReplacement(std::basic_string<T>& replacement, std::basic_string<T> token, const format_map_t& substitutions);
+ static bool simpleReplacement(std::basic_string<T>& replacement, std::basic_string<T> token, const LLSD& substitutions);
+ static void setLocale (std::string inLocale) {sLocale = inLocale;};
+ static std::string getLocale (void) {return sLocale;};
+
+ static bool isValidIndex(const std::basic_string<T>& string, size_type i)
+ {
+ return !string.empty() && (0 <= i) && (i <= string.size());
+ }
+
+ static void trimHead(std::basic_string<T>& string);
+ static void trimTail(std::basic_string<T>& string);
+ static void trim(std::basic_string<T>& string) { trimHead(string); trimTail(string); }
+ static void truncate(std::basic_string<T>& string, size_type count);
+
+ static void toUpper(std::basic_string<T>& string);
+ static void toLower(std::basic_string<T>& string);
+
+ // True if this is the head of s.
+ static BOOL isHead( const std::basic_string<T>& string, const T* s );
+
+ /**
+ * @brief Returns true if string starts with substr
+ *
+ * If etither string or substr are empty, this method returns false.
+ */
+ static bool startsWith(
+ const std::basic_string<T>& string,
+ const std::basic_string<T>& substr);
+
+ /**
+ * @brief Returns true if string ends in substr
+ *
+ * If etither string or substr are empty, this method returns false.
+ */
+ static bool endsWith(
+ const std::basic_string<T>& string,
+ const std::basic_string<T>& substr);
+
+ static void addCRLF(std::basic_string<T>& string);
+ static void removeCRLF(std::basic_string<T>& string);
+
+ static void replaceTabsWithSpaces( std::basic_string<T>& string, size_type spaces_per_tab );
+ static void replaceNonstandardASCII( std::basic_string<T>& string, T replacement );
+ static void replaceChar( std::basic_string<T>& string, T target, T replacement );
+ static void replaceString( std::basic_string<T>& string, std::basic_string<T> target, std::basic_string<T> replacement );
+
+ static BOOL containsNonprintable(const std::basic_string<T>& string);
+ static void stripNonprintable(std::basic_string<T>& string);
+
+ /**
+ * @brief Unsafe way to make ascii characters. You should probably
+ * only call this when interacting with the host operating system.
+ * The 1 byte std::string does not work correctly.
+ * The 2 and 4 byte std::string probably work, so LLWStringUtil::_makeASCII
+ * should work.
+ */
+ static void _makeASCII(std::basic_string<T>& string);
+
+ // Conversion to other data types
+ static BOOL convertToBOOL(const std::basic_string<T>& string, BOOL& value);
+ static BOOL convertToU8(const std::basic_string<T>& string, U8& value);
+ static BOOL convertToS8(const std::basic_string<T>& string, S8& value);
+ static BOOL convertToS16(const std::basic_string<T>& string, S16& value);
+ static BOOL convertToU16(const std::basic_string<T>& string, U16& value);
+ static BOOL convertToU32(const std::basic_string<T>& string, U32& value);
+ static BOOL convertToS32(const std::basic_string<T>& string, S32& value);
+ static BOOL convertToF32(const std::basic_string<T>& string, F32& value);
+ static BOOL convertToF64(const std::basic_string<T>& string, F64& value);
+
+ /////////////////////////////////////////////////////////////////////////////////////////
+ // Utility functions for working with char*'s and strings
+
+ // Like strcmp but also handles empty strings. Uses
+ // current locale.
+ static S32 compareStrings(const T* lhs, const T* rhs);
+ static S32 compareStrings(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs);
+
+ // case insensitive version of above. Uses current locale on
+ // Win32, and falls back to a non-locale aware comparison on
+ // Linux.
+ static S32 compareInsensitive(const T* lhs, const T* rhs);
+ static S32 compareInsensitive(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs);
+
+ // Case sensitive comparison with good handling of numbers. Does not use current locale.
+ // a.k.a. strdictcmp()
+ static S32 compareDict(const std::basic_string<T>& a, const std::basic_string<T>& b);
+
+ // Case *in*sensitive comparison with good handling of numbers. Does not use current locale.
+ // a.k.a. strdictcmp()
+ static S32 compareDictInsensitive(const std::basic_string<T>& a, const std::basic_string<T>& b);
+
+ // Puts compareDict() in a form appropriate for LL container classes to use for sorting.
+ static BOOL precedesDict( const std::basic_string<T>& a, const std::basic_string<T>& b );
+
+ // A replacement for strncpy.
+ // If the dst buffer is dst_size bytes long or more, ensures that dst is null terminated and holds
+ // up to dst_size-1 characters of src.
+ static void copy(T* dst, const T* src, size_type dst_size);
+
+ // Copies src into dst at a given offset.
+ static void copyInto(std::basic_string<T>& dst, const std::basic_string<T>& src, size_type offset);
+
+ static bool isPartOfWord(T c) { return (c == (T)'_') || LLStringOps::isAlnum(c); }
+
+
+#ifdef _DEBUG
+ static void testHarness();
+#endif
+
+private:
+ static size_type getSubstitution(const std::basic_string<T>& instr, size_type& start, std::vector<std::basic_string<T> >& tokens);
+};
+
+template<class T> std::basic_string<T> LLStringUtilBase<T>::null;
+template<class T> std::string LLStringUtilBase<T>::sLocale;
+
+typedef LLStringUtilBase<char> LLStringUtil;
+typedef LLStringUtilBase<llwchar> LLWStringUtil;
+typedef std::basic_string<llwchar> LLWString;
+
+//@ Use this where we want to disallow input in the form of "foo"
+// This is used to catch places where english text is embedded in the code
+// instead of in a translatable XUI file.
+class LLStringExplicit : public std::string
+{
+public:
+ explicit LLStringExplicit(const char* s) : std::string(s) {}
+ LLStringExplicit(const std::string& s) : std::string(s) {}
+ LLStringExplicit(const std::string& s, size_type pos, size_type n = std::string::npos) : std::string(s, pos, n) {}
+};
+
+struct LLDictionaryLess
+{
+public:
+ bool operator()(const std::string& a, const std::string& b)
+ {
+ return (LLStringUtil::precedesDict(a, b) ? true : false);
+ }
+};
+
+
+/**
+ * Simple support functions
+ */
+
+/**
+ * @brief chop off the trailing characters in a string.
+ *
+ * This function works on bytes rather than glyphs, so this will
+ * incorrectly truncate non-single byte strings.
+ * Use utf8str_truncate() for utf8 strings
+ * @return a copy of in string minus the trailing count bytes.
+ */
+inline std::string chop_tail_copy(
+ const std::string& in,
+ std::string::size_type count)
+{
+ return std::string(in, 0, in.length() - count);
+}
+
+/**
+ * @brief This translates a nybble stored as a hex value from 0-f back
+ * to a nybble in the low order bits of the return byte.
+ */
+LL_COMMON_API U8 hex_as_nybble(char hex);
+
+/**
+ * @brief read the contents of a file into a string.
+ *
+ * Since this function has no concept of character encoding, most
+ * anything you do with this method ill-advised. Please avoid.
+ * @param str [out] The string which will have.
+ * @param filename The full name of the file to read.
+ * @return Returns true on success. If false, str is unmodified.
+ */
+LL_COMMON_API bool _read_file_into_string(std::string& str, const std::string& filename);
+LL_COMMON_API bool iswindividual(llwchar elem);
+
+/**
+ * Unicode support
+ */
+
+// Make the incoming string a utf8 string. Replaces any unknown glyph
+// with the UNKOWN_CHARACTER. Once any unknown glph is found, the rest
+// of the data may not be recovered.
+LL_COMMON_API std::string rawstr_to_utf8(const std::string& raw);
+
+//
+// We should never use UTF16 except when communicating with Win32!
+//
+typedef std::basic_string<U16> llutf16string;
+
+LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len);
+LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str);
+
+LL_COMMON_API llutf16string wstring_to_utf16str(const LLWString &utf32str, S32 len);
+LL_COMMON_API llutf16string wstring_to_utf16str(const LLWString &utf32str);
+
+LL_COMMON_API llutf16string utf8str_to_utf16str ( const std::string& utf8str, S32 len);
+LL_COMMON_API llutf16string utf8str_to_utf16str ( const std::string& utf8str );
+
+LL_COMMON_API LLWString utf8str_to_wstring(const std::string &utf8str, S32 len);
+LL_COMMON_API LLWString utf8str_to_wstring(const std::string &utf8str);
+// Same function, better name. JC
+inline LLWString utf8string_to_wstring(const std::string& utf8_string) { return utf8str_to_wstring(utf8_string); }
+
+//
+LL_COMMON_API S32 wchar_to_utf8chars(llwchar inchar, char* outchars);
+
+LL_COMMON_API std::string wstring_to_utf8str(const LLWString &utf32str, S32 len);
+LL_COMMON_API std::string wstring_to_utf8str(const LLWString &utf32str);
+
+LL_COMMON_API std::string utf16str_to_utf8str(const llutf16string &utf16str, S32 len);
+LL_COMMON_API std::string utf16str_to_utf8str(const llutf16string &utf16str);
+
+// Length of this UTF32 string in bytes when transformed to UTF8
+LL_COMMON_API S32 wstring_utf8_length(const LLWString& wstr);
+
+// Length in bytes of this wide char in a UTF8 string
+LL_COMMON_API S32 wchar_utf8_length(const llwchar wc);
+
+LL_COMMON_API std::string utf8str_tolower(const std::string& utf8str);
+
+// Length in llwchar (UTF-32) of the first len units (16 bits) of the given UTF-16 string.
+LL_COMMON_API S32 utf16str_wstring_length(const llutf16string &utf16str, S32 len);
+
+// Length in utf16string (UTF-16) of wlen wchars beginning at woffset.
+LL_COMMON_API S32 wstring_utf16_length(const LLWString & wstr, S32 woffset, S32 wlen);
+
+// Length in wstring (i.e., llwchar count) of a part of a wstring specified by utf16 length (i.e., utf16 units.)
+LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, BOOL *unaligned = NULL);
+
+/**
+ * @brief Properly truncate a utf8 string to a maximum byte count.
+ *
+ * The returned string may be less than max_len if the truncation
+ * happens in the middle of a glyph. If max_len is longer than the
+ * string passed in, the return value == utf8str.
+ * @param utf8str A valid utf8 string to truncate.
+ * @param max_len The maximum number of bytes in the return value.
+ * @return Returns a valid utf8 string with byte count <= max_len.
+ */
+LL_COMMON_API std::string utf8str_truncate(const std::string& utf8str, const S32 max_len);
+
+LL_COMMON_API std::string utf8str_trim(const std::string& utf8str);
+
+LL_COMMON_API S32 utf8str_compare_insensitive(
+ const std::string& lhs,
+ const std::string& rhs);
+
+/**
+ * @brief Replace all occurences of target_char with replace_char
+ *
+ * @param utf8str A utf8 string to process.
+ * @param target_char The wchar to be replaced
+ * @param replace_char The wchar which is written on replace
+ */
+LL_COMMON_API std::string utf8str_substChar(
+ const std::string& utf8str,
+ const llwchar target_char,
+ const llwchar replace_char);
+
+LL_COMMON_API std::string utf8str_makeASCII(const std::string& utf8str);
+
+// Hack - used for evil notecards.
+LL_COMMON_API std::string mbcsstring_makeASCII(const std::string& str);
+
+LL_COMMON_API std::string utf8str_removeCRLF(const std::string& utf8str);
+
+
+#if LL_WINDOWS
+/* @name Windows string helpers
+ */
+//@{
+
+/**
+ * @brief Implementation the expected snprintf interface.
+ *
+ * If the size of the passed in buffer is not large enough to hold the string,
+ * two bad things happen:
+ * 1. resulting formatted string is NOT null terminated
+ * 2. Depending on the platform, the return value could be a) the required
+ * size of the buffer to copy the entire formatted string or b) -1.
+ * On Windows with VS.Net 2003, it returns -1 e.g.
+ *
+ * safe_snprintf always adds a NULL terminator so that the caller does not
+ * need to check for return value or need to add the NULL terminator.
+ * It does not, however change the return value - to let the caller know
+ * that the passed in buffer size was not large enough to hold the
+ * formatted string.
+ *
+ */
+
+// Deal with the differeneces on Windows
+namespace snprintf_hack
+{
+ LL_COMMON_API int snprintf(char *str, size_t size, const char *format, ...);
+}
+
+using snprintf_hack::snprintf;
+
+/**
+ * @brief Convert a wide string to std::string
+ *
+ * This replaces the unsafe W2A macro from ATL.
+ */
+LL_COMMON_API std::string ll_convert_wide_to_string(const wchar_t* in);
+
+//@}
+#endif // LL_WINDOWS
+
+/**
+ * Many of the 'strip' and 'replace' methods of LLStringUtilBase need
+ * specialization to work with the signed char type.
+ * Sadly, it is not possible (AFAIK) to specialize a single method of
+ * a template class.
+ * That stuff should go here.
+ */
+namespace LLStringFn
+{
+ /**
+ * @brief Replace all non-printable characters with replacement in
+ * string.
+ * NOTE - this will zap non-ascii
+ *
+ * @param [in,out] string the to modify. out value is the string
+ * with zero non-printable characters.
+ * @param The replacement character. use LL_UNKNOWN_CHAR if unsure.
+ */
+ LL_COMMON_API void replace_nonprintable_in_ascii(
+ std::basic_string<char>& string,
+ char replacement);
+
+
+ /**
+ * @brief Replace all non-printable characters and pipe characters
+ * with replacement in a string.
+ * NOTE - this will zap non-ascii
+ *
+ * @param [in,out] the string to modify. out value is the string
+ * with zero non-printable characters and zero pipe characters.
+ * @param The replacement character. use LL_UNKNOWN_CHAR if unsure.
+ */
+ LL_COMMON_API void replace_nonprintable_and_pipe_in_ascii(std::basic_string<char>& str,
+ char replacement);
+
+
+ /**
+ * @brief Remove all characters that are not allowed in XML 1.0.
+ * Returns a copy of the string with those characters removed.
+ * Works with US ASCII and UTF-8 encoded strings. JC
+ */
+ LL_COMMON_API std::string strip_invalid_xml(const std::string& input);
+
+
+ /**
+ * @brief Replace all control characters (0 <= c < 0x20) with replacement in
+ * string. This is safe for utf-8
+ *
+ * @param [in,out] string the to modify. out value is the string
+ * with zero non-printable characters.
+ * @param The replacement character. use LL_UNKNOWN_CHAR if unsure.
+ */
+ LL_COMMON_API void replace_ascii_controlchars(
+ std::basic_string<char>& string,
+ char replacement);
+}
+
+////////////////////////////////////////////////////////////
+// NOTE: LLStringUtil::format, getTokens, and support functions moved to llstring.cpp.
+// There is no LLWStringUtil::format implementation currently.
+// Calling thse for anything other than LLStringUtil will produce link errors.
+
+////////////////////////////////////////////////////////////
+
+
+// static
+template<class T>
+S32 LLStringUtilBase<T>::compareStrings(const T* lhs, const T* rhs)
+{
+ S32 result;
+ if( lhs == rhs )
+ {
+ result = 0;
+ }
+ else
+ if ( !lhs || !lhs[0] )
+ {
+ result = ((!rhs || !rhs[0]) ? 0 : 1);
+ }
+ else
+ if ( !rhs || !rhs[0])
+ {
+ result = -1;
+ }
+ else
+ {
+ result = LLStringOps::collate(lhs, rhs);
+ }
+ return result;
+}
+
+//static
+template<class T>
+S32 LLStringUtilBase<T>::compareStrings(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs)
+{
+ return LLStringOps::collate(lhs.c_str(), rhs.c_str());
+}
+
+// static
+template<class T>
+S32 LLStringUtilBase<T>::compareInsensitive(const T* lhs, const T* rhs )
+{
+ S32 result;
+ if( lhs == rhs )
+ {
+ result = 0;
+ }
+ else
+ if ( !lhs || !lhs[0] )
+ {
+ result = ((!rhs || !rhs[0]) ? 0 : 1);
+ }
+ else
+ if ( !rhs || !rhs[0] )
+ {
+ result = -1;
+ }
+ else
+ {
+ std::basic_string<T> lhs_string(lhs);
+ std::basic_string<T> rhs_string(rhs);
+ LLStringUtilBase<T>::toUpper(lhs_string);
+ LLStringUtilBase<T>::toUpper(rhs_string);
+ result = LLStringOps::collate(lhs_string.c_str(), rhs_string.c_str());
+ }
+ return result;
+}
+
+//static
+template<class T>
+S32 LLStringUtilBase<T>::compareInsensitive(const std::basic_string<T>& lhs, const std::basic_string<T>& rhs)
+{
+ std::basic_string<T> lhs_string(lhs);
+ std::basic_string<T> rhs_string(rhs);
+ LLStringUtilBase<T>::toUpper(lhs_string);
+ LLStringUtilBase<T>::toUpper(rhs_string);
+ return LLStringOps::collate(lhs_string.c_str(), rhs_string.c_str());
+}
+
+// Case sensitive comparison with good handling of numbers. Does not use current locale.
+// a.k.a. strdictcmp()
+
+//static
+template<class T>
+S32 LLStringUtilBase<T>::compareDict(const std::basic_string<T>& astr, const std::basic_string<T>& bstr)
+{
+ const T* a = astr.c_str();
+ const T* b = bstr.c_str();
+ T ca, cb;
+ S32 ai, bi, cnt = 0;
+ S32 bias = 0;
+
+ ca = *(a++);
+ cb = *(b++);
+ while( ca && cb ){
+ if( bias==0 ){
+ if( LLStringOps::isUpper(ca) ){ ca = LLStringOps::toLower(ca); bias--; }
+ if( LLStringOps::isUpper(cb) ){ cb = LLStringOps::toLower(cb); bias++; }
+ }else{
+ if( LLStringOps::isUpper(ca) ){ ca = LLStringOps::toLower(ca); }
+ if( LLStringOps::isUpper(cb) ){ cb = LLStringOps::toLower(cb); }
+ }
+ if( LLStringOps::isDigit(ca) ){
+ if( cnt-->0 ){
+ if( cb!=ca ) break;
+ }else{
+ if( !LLStringOps::isDigit(cb) ) break;
+ for(ai=0; LLStringOps::isDigit(a[ai]); ai++);
+ for(bi=0; LLStringOps::isDigit(b[bi]); bi++);
+ if( ai<bi ){ ca=0; break; }
+ if( bi<ai ){ cb=0; break; }
+ if( ca!=cb ) break;
+ cnt = ai;
+ }
+ }else if( ca!=cb ){ break;
+ }
+ ca = *(a++);
+ cb = *(b++);
+ }
+ if( ca==cb ) ca += bias;
+ return ca-cb;
+}
+
+// static
+template<class T>
+S32 LLStringUtilBase<T>::compareDictInsensitive(const std::basic_string<T>& astr, const std::basic_string<T>& bstr)
+{
+ const T* a = astr.c_str();
+ const T* b = bstr.c_str();
+ T ca, cb;
+ S32 ai, bi, cnt = 0;
+
+ ca = *(a++);
+ cb = *(b++);
+ while( ca && cb ){
+ if( LLStringOps::isUpper(ca) ){ ca = LLStringOps::toLower(ca); }
+ if( LLStringOps::isUpper(cb) ){ cb = LLStringOps::toLower(cb); }
+ if( LLStringOps::isDigit(ca) ){
+ if( cnt-->0 ){
+ if( cb!=ca ) break;
+ }else{
+ if( !LLStringOps::isDigit(cb) ) break;
+ for(ai=0; LLStringOps::isDigit(a[ai]); ai++);
+ for(bi=0; LLStringOps::isDigit(b[bi]); bi++);
+ if( ai<bi ){ ca=0; break; }
+ if( bi<ai ){ cb=0; break; }
+ if( ca!=cb ) break;
+ cnt = ai;
+ }
+ }else if( ca!=cb ){ break;
+ }
+ ca = *(a++);
+ cb = *(b++);
+ }
+ return ca-cb;
+}
+
+// Puts compareDict() in a form appropriate for LL container classes to use for sorting.
+// static
+template<class T>
+BOOL LLStringUtilBase<T>::precedesDict( const std::basic_string<T>& a, const std::basic_string<T>& b )
+{
+ if( a.size() && b.size() )
+ {
+ return (LLStringUtilBase<T>::compareDict(a.c_str(), b.c_str()) < 0);
+ }
+ else
+ {
+ return (!b.empty());
+ }
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::toUpper(std::basic_string<T>& string)
+{
+ if( !string.empty() )
+ {
+ std::transform(
+ string.begin(),
+ string.end(),
+ string.begin(),
+ (T(*)(T)) &LLStringOps::toUpper);
+ }
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::toLower(std::basic_string<T>& string)
+{
+ if( !string.empty() )
+ {
+ std::transform(
+ string.begin(),
+ string.end(),
+ string.begin(),
+ (T(*)(T)) &LLStringOps::toLower);
+ }
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::trimHead(std::basic_string<T>& string)
+{
+ if( !string.empty() )
+ {
+ size_type i = 0;
+ while( i < string.length() && LLStringOps::isSpace( string[i] ) )
+ {
+ i++;
+ }
+ string.erase(0, i);
+ }
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::trimTail(std::basic_string<T>& string)
+{
+ if( string.size() )
+ {
+ size_type len = string.length();
+ size_type i = len;
+ while( i > 0 && LLStringOps::isSpace( string[i-1] ) )
+ {
+ i--;
+ }
+
+ string.erase( i, len - i );
+ }
+}
+
+
+// Replace line feeds with carriage return-line feed pairs.
+//static
+template<class T>
+void LLStringUtilBase<T>::addCRLF(std::basic_string<T>& string)
+{
+ const T LF = 10;
+ const T CR = 13;
+
+ // Count the number of line feeds
+ size_type count = 0;
+ size_type len = string.size();
+ size_type i;
+ for( i = 0; i < len; i++ )
+ {
+ if( string[i] == LF )
+ {
+ count++;
+ }
+ }
+
+ // Insert a carriage return before each line feed
+ if( count )
+ {
+ size_type size = len + count;
+ T *t = new T[size];
+ size_type j = 0;
+ for( i = 0; i < len; ++i )
+ {
+ if( string[i] == LF )
+ {
+ t[j] = CR;
+ ++j;
+ }
+ t[j] = string[i];
+ ++j;
+ }
+
+ string.assign(t, size);
+ }
+}
+
+// Remove all carriage returns
+//static
+template<class T>
+void LLStringUtilBase<T>::removeCRLF(std::basic_string<T>& string)
+{
+ const T CR = 13;
+
+ size_type cr_count = 0;
+ size_type len = string.size();
+ size_type i;
+ for( i = 0; i < len - cr_count; i++ )
+ {
+ if( string[i+cr_count] == CR )
+ {
+ cr_count++;
+ }
+
+ string[i] = string[i+cr_count];
+ }
+ string.erase(i, cr_count);
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::replaceChar( std::basic_string<T>& string, T target, T replacement )
+{
+ size_type found_pos = 0;
+ while( (found_pos = string.find(target, found_pos)) != std::basic_string<T>::npos )
+ {
+ string[found_pos] = replacement;
+ found_pos++; // avoid infinite defeat if target == replacement
+ }
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::replaceString( std::basic_string<T>& string, std::basic_string<T> target, std::basic_string<T> replacement )
+{
+ size_type found_pos = 0;
+ while( (found_pos = string.find(target, found_pos)) != std::basic_string<T>::npos )
+ {
+ string.replace( found_pos, target.length(), replacement );
+ found_pos += replacement.length(); // avoid infinite defeat if replacement contains target
+ }
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::replaceNonstandardASCII( std::basic_string<T>& string, T replacement )
+{
+ const char LF = 10;
+ const S8 MIN = 32;
+// const S8 MAX = 127;
+
+ size_type len = string.size();
+ for( size_type i = 0; i < len; i++ )
+ {
+ // No need to test MAX < mText[i] because we treat mText[i] as a signed char,
+ // which has a max value of 127.
+ if( ( S8(string[i]) < MIN ) && (string[i] != LF) )
+ {
+ string[i] = replacement;
+ }
+ }
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::replaceTabsWithSpaces( std::basic_string<T>& str, size_type spaces_per_tab )
+{
+ const T TAB = '\t';
+ const T SPACE = ' ';
+
+ std::basic_string<T> out_str;
+ // Replace tabs with spaces
+ for (size_type i = 0; i < str.length(); i++)
+ {
+ if (str[i] == TAB)
+ {
+ for (size_type j = 0; j < spaces_per_tab; j++)
+ out_str += SPACE;
+ }
+ else
+ {
+ out_str += str[i];
+ }
+ }
+ str = out_str;
+}
+
+//static
+template<class T>
+BOOL LLStringUtilBase<T>::containsNonprintable(const std::basic_string<T>& string)
+{
+ const char MIN = 32;
+ BOOL rv = FALSE;
+ for (size_type i = 0; i < string.size(); i++)
+ {
+ if(string[i] < MIN)
+ {
+ rv = TRUE;
+ break;
+ }
+ }
+ return rv;
+}
+
+//static
+template<class T>
+void LLStringUtilBase<T>::stripNonprintable(std::basic_string<T>& string)
+{
+ const char MIN = 32;
+ size_type j = 0;
+ if (string.empty())
+ {
+ return;
+ }
+ char* c_string = new char[string.size() + 1];
+ if(c_string == NULL)
+ {
+ return;
+ }
+ strcpy(c_string, string.c_str()); /*Flawfinder: ignore*/
+ char* write_head = &c_string[0];
+ for (size_type i = 0; i < string.size(); i++)
+ {
+ char* read_head = &string[i];
+ write_head = &c_string[j];
+ if(!(*read_head < MIN))
+ {
+ *write_head = *read_head;
+ ++j;
+ }
+ }
+ c_string[j]= '\0';
+ string = c_string;
+ delete []c_string;
+}
+
+template<class T>
+void LLStringUtilBase<T>::_makeASCII(std::basic_string<T>& string)
+{
+ // Replace non-ASCII chars with LL_UNKNOWN_CHAR
+ for (size_type i = 0; i < string.length(); i++)
+ {
+ if (string[i] > 0x7f)
+ {
+ string[i] = LL_UNKNOWN_CHAR;
+ }
+ }
+}
+
+// static
+template<class T>
+void LLStringUtilBase<T>::copy( T* dst, const T* src, size_type dst_size )
+{
+ if( dst_size > 0 )
+ {
+ size_type min_len = 0;
+ if( src )
+ {
+ min_len = llmin( dst_size - 1, strlen( src ) ); /* Flawfinder: ignore */
+ memcpy(dst, src, min_len * sizeof(T)); /* Flawfinder: ignore */
+ }
+ dst[min_len] = '\0';
+ }
+}
+
+// static
+template<class T>
+void LLStringUtilBase<T>::copyInto(std::basic_string<T>& dst, const std::basic_string<T>& src, size_type offset)
+{
+ if ( offset == dst.length() )
+ {
+ // special case - append to end of string and avoid expensive
+ // (when strings are large) string manipulations
+ dst += src;
+ }
+ else
+ {
+ std::basic_string<T> tail = dst.substr(offset);
+
+ dst = dst.substr(0, offset);
+ dst += src;
+ dst += tail;
+ };
+}
+
+// True if this is the head of s.
+//static
+template<class T>
+BOOL LLStringUtilBase<T>::isHead( const std::basic_string<T>& string, const T* s )
+{
+ if( string.empty() )
+ {
+ // Early exit
+ return FALSE;
+ }
+ else
+ {
+ return (strncmp( s, string.c_str(), string.size() ) == 0);
+ }
+}
+
+// static
+template<class T>
+bool LLStringUtilBase<T>::startsWith(
+ const std::basic_string<T>& string,
+ const std::basic_string<T>& substr)
+{
+ if(string.empty() || (substr.empty())) return false;
+ if(0 == string.find(substr)) return true;
+ return false;
+}
+
+// static
+template<class T>
+bool LLStringUtilBase<T>::endsWith(
+ const std::basic_string<T>& string,
+ const std::basic_string<T>& substr)
+{
+ if(string.empty() || (substr.empty())) return false;
+ std::string::size_type idx = string.rfind(substr);
+ if(std::string::npos == idx) return false;
+ return (idx == (string.size() - substr.size()));
+}
+
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToBOOL(const std::basic_string<T>& string, BOOL& value)
+{
+ if( string.empty() )
+ {
+ return FALSE;
+ }
+
+ std::basic_string<T> temp( string );
+ trim(temp);
+ if(
+ (temp == "1") ||
+ (temp == "T") ||
+ (temp == "t") ||
+ (temp == "TRUE") ||
+ (temp == "true") ||
+ (temp == "True") )
+ {
+ value = TRUE;
+ return TRUE;
+ }
+ else
+ if(
+ (temp == "0") ||
+ (temp == "F") ||
+ (temp == "f") ||
+ (temp == "FALSE") ||
+ (temp == "false") ||
+ (temp == "False") )
+ {
+ value = FALSE;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToU8(const std::basic_string<T>& string, U8& value)
+{
+ S32 value32 = 0;
+ BOOL success = convertToS32(string, value32);
+ if( success && (U8_MIN <= value32) && (value32 <= U8_MAX) )
+ {
+ value = (U8) value32;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToS8(const std::basic_string<T>& string, S8& value)
+{
+ S32 value32 = 0;
+ BOOL success = convertToS32(string, value32);
+ if( success && (S8_MIN <= value32) && (value32 <= S8_MAX) )
+ {
+ value = (S8) value32;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToS16(const std::basic_string<T>& string, S16& value)
+{
+ S32 value32 = 0;
+ BOOL success = convertToS32(string, value32);
+ if( success && (S16_MIN <= value32) && (value32 <= S16_MAX) )
+ {
+ value = (S16) value32;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToU16(const std::basic_string<T>& string, U16& value)
+{
+ S32 value32 = 0;
+ BOOL success = convertToS32(string, value32);
+ if( success && (U16_MIN <= value32) && (value32 <= U16_MAX) )
+ {
+ value = (U16) value32;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToU32(const std::basic_string<T>& string, U32& value)
+{
+ if( string.empty() )
+ {
+ return FALSE;
+ }
+
+ std::basic_string<T> temp( string );
+ trim(temp);
+ U32 v;
+ std::basic_istringstream<T> i_stream((std::basic_string<T>)temp);
+ if(i_stream >> v)
+ {
+ value = v;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToS32(const std::basic_string<T>& string, S32& value)
+{
+ if( string.empty() )
+ {
+ return FALSE;
+ }
+
+ std::basic_string<T> temp( string );
+ trim(temp);
+ S32 v;
+ std::basic_istringstream<T> i_stream((std::basic_string<T>)temp);
+ if(i_stream >> v)
+ {
+ //TODO: figure out overflow and underflow reporting here
+ //if((LONG_MAX == v) || (LONG_MIN == v))
+ //{
+ // // Underflow or overflow
+ // return FALSE;
+ //}
+
+ value = v;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToF32(const std::basic_string<T>& string, F32& value)
+{
+ F64 value64 = 0.0;
+ BOOL success = convertToF64(string, value64);
+ if( success && (-F32_MAX <= value64) && (value64 <= F32_MAX) )
+ {
+ value = (F32) value64;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+BOOL LLStringUtilBase<T>::convertToF64(const std::basic_string<T>& string, F64& value)
+{
+ if( string.empty() )
+ {
+ return FALSE;
+ }
+
+ std::basic_string<T> temp( string );
+ trim(temp);
+ F64 v;
+ std::basic_istringstream<T> i_stream((std::basic_string<T>)temp);
+ if(i_stream >> v)
+ {
+ //TODO: figure out overflow and underflow reporting here
+ //if( ((-HUGE_VAL == v) || (HUGE_VAL == v))) )
+ //{
+ // // Underflow or overflow
+ // return FALSE;
+ //}
+
+ value = v;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+template<class T>
+void LLStringUtilBase<T>::truncate(std::basic_string<T>& string, size_type count)
+{
+ size_type cur_size = string.size();
+ string.resize(count < cur_size ? count : cur_size);
+}
+
+#endif // LL_STRING_H
diff --git a/indra/llcommon/llstringtable.h b/indra/llcommon/llstringtable.h
index 4492063275..b13b016396 100644
--- a/indra/llcommon/llstringtable.h
+++ b/indra/llcommon/llstringtable.h
@@ -56,7 +56,7 @@
const U32 MAX_STRINGS_LENGTH = 256;
-class LLStringTableEntry
+class LL_COMMON_API LLStringTableEntry
{
public:
LLStringTableEntry(const char *str)
@@ -81,7 +81,7 @@ public:
S32 mCount;
};
-class LLStringTable
+class LL_COMMON_API LLStringTable
{
public:
LLStringTable(int tablesize);
@@ -115,7 +115,7 @@ public:
#endif
};
-extern LLStringTable gStringTable;
+extern LL_COMMON_API LLStringTable gStringTable;
//============================================================================
@@ -125,7 +125,7 @@ extern LLStringTable gStringTable;
typedef const std::string* LLStdStringHandle;
-class LLStdStringTable
+class LL_COMMON_API LLStdStringTable
{
public:
LLStdStringTable(S32 tablesize = 0)
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 4d03c4d40d..127baa737d 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -128,8 +128,16 @@ LLOSInfo::LLOSInfo() :
mOSStringSimple = "Microsoft Windows Vista ";
else mOSStringSimple = "Microsoft Windows Vista Server ";
}
+ else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
+ {
+ if(osvi.wProductType == VER_NT_WORKSTATION)
+ mOSStringSimple = "Microsoft Windows 7 ";
+ else mOSStringSimple = "Microsoft Windows 7 Server ";
+ }
else // Use the registry on early versions of Windows NT.
{
+ mOSStringSimple = "Microsoft Windows (unrecognized) ";
+
HKEY hKey;
WCHAR szProductType[80];
DWORD dwBufLen;
diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h
index 03f48ca018..c2c45bec9a 100644
--- a/indra/llcommon/llsys.h
+++ b/indra/llcommon/llsys.h
@@ -45,7 +45,7 @@
#include <iosfwd>
#include <string>
-class LLOSInfo
+class LL_COMMON_API LLOSInfo
{
public:
LLOSInfo();
@@ -70,7 +70,7 @@ private:
};
-class LLCPUInfo
+class LL_COMMON_API LLCPUInfo
{
public:
LLCPUInfo();
@@ -99,7 +99,7 @@ private:
//
// CLASS LLMemoryInfo
-class LLMemoryInfo
+class LL_COMMON_API LLMemoryInfo
/*! @brief Class to query the memory subsystem
@@ -123,15 +123,15 @@ public:
};
-std::ostream& operator<<(std::ostream& s, const LLOSInfo& info);
-std::ostream& operator<<(std::ostream& s, const LLCPUInfo& info);
-std::ostream& operator<<(std::ostream& s, const LLMemoryInfo& info);
+LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLOSInfo& info);
+LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCPUInfo& info);
+LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLMemoryInfo& info);
// gunzip srcfile into dstfile. Returns FALSE on error.
-BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile);
+BOOL LL_COMMON_API gunzip_file(const std::string& srcfile, const std::string& dstfile);
// gzip srcfile into dstfile. Returns FALSE on error.
-BOOL gzip_file(const std::string& srcfile, const std::string& dstfile);
+BOOL LL_COMMON_API gzip_file(const std::string& srcfile, const std::string& dstfile);
-extern LLCPUInfo gSysCPU;
+extern LL_COMMON_API LLCPUInfo gSysCPU;
#endif // LL_LLSYS_H
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index f25339f48d..c3d7650bd9 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -42,7 +42,7 @@ class LLThread;
class LLMutex;
class LLCondition;
-class LLThread
+class LL_COMMON_API LLThread
{
public:
typedef enum e_thread_status
@@ -130,7 +130,7 @@ protected:
//============================================================================
-class LLMutex
+class LL_COMMON_API LLMutex
{
public:
LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex
@@ -147,7 +147,7 @@ protected:
};
// Actually a condition/mutex pair (since each condition needs to be associated with a mutex).
-class LLCondition : public LLMutex
+class LL_COMMON_API LLCondition : public LLMutex
{
public:
LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well.
@@ -194,7 +194,7 @@ void LLThread::unlockData()
// see llmemory.h for LLPointer<> definition
-class LLThreadSafeRefCount
+class LL_COMMON_API LLThreadSafeRefCount
{
public:
static void initThreadSafeRefCount(); // creates sMutex
@@ -246,7 +246,7 @@ private:
// Simple responder for self destructing callbacks
// Pure virtual class
-class LLResponder : public LLThreadSafeRefCount
+class LL_COMMON_API LLResponder : public LLThreadSafeRefCount
{
protected:
virtual ~LLResponder();
diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h
index 0319bec45b..d009c0f5f7 100644
--- a/indra/llcommon/lltimer.h
+++ b/indra/llcommon/lltimer.h
@@ -55,7 +55,7 @@ const U32 USEC_PER_HOUR = USEC_PER_MIN * MIN_PER_HOUR;
const U32 SEC_PER_HOUR = SEC_PER_MIN * MIN_PER_HOUR;
const F64 SEC_PER_USEC = 1.0 / (F64) USEC_PER_SEC;
-class LLTimer
+class LL_COMMON_API LLTimer
{
public:
static LLTimer *sTimer; // global timer
@@ -114,17 +114,17 @@ public:
//
// Various functions for initializing/accessing clock and timing stuff. Don't use these without REALLY knowing how they work.
//
-U64 get_clock_count();
-F64 calc_clock_frequency(U32 msecs);
-void update_clock_frequencies();
+LL_COMMON_API U64 get_clock_count();
+LL_COMMON_API F64 calc_clock_frequency(U32 msecs);
+LL_COMMON_API void update_clock_frequencies();
// Sleep for milliseconds
-void ms_sleep(U32 ms);
-U32 micro_sleep(U64 us, U32 max_yields = 0xFFFFFFFF);
+LL_COMMON_API void ms_sleep(U32 ms);
+LL_COMMON_API U32 micro_sleep(U64 us, U32 max_yields = 0xFFFFFFFF);
// Returns the correct UTC time in seconds, like time(NULL).
// Useful on the viewer, which may have its local clock set wrong.
-time_t time_corrected();
+LL_COMMON_API time_t time_corrected();
static inline time_t time_min()
{
@@ -155,24 +155,24 @@ static inline time_t time_max()
}
// Correction factor used by time_corrected() above.
-extern S32 gUTCOffset;
+extern LL_COMMON_API S32 gUTCOffset;
// Is the current computer (in its current time zone)
// observing daylight savings time?
-BOOL is_daylight_savings();
+LL_COMMON_API BOOL is_daylight_savings();
// Converts internal "struct tm" time buffer to Pacific Standard/Daylight Time
// Usage:
// S32 utc_time;
// utc_time = time_corrected();
// struct tm* internal_time = utc_to_pacific_time(utc_time, gDaylight);
-struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time);
+LL_COMMON_API struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time);
-void microsecondsToTimecodeString(U64 current_time, std::string& tcstring);
-void secondsToTimecodeString(F32 current_time, std::string& tcstring);
+LL_COMMON_API void microsecondsToTimecodeString(U64 current_time, std::string& tcstring);
+LL_COMMON_API void secondsToTimecodeString(F32 current_time, std::string& tcstring);
// class for scheduling a function to be called at a given frequency (approximate, inprecise)
-class LLEventTimer : protected LLInstanceTracker<LLEventTimer>
+class LL_COMMON_API LLEventTimer : protected LLInstanceTracker<LLEventTimer>
{
public:
LLEventTimer(F32 period); // period is the amount of time between each call to tick() in seconds
@@ -190,4 +190,6 @@ protected:
F32 mPeriod;
};
+U64 LL_COMMON_API totalTime(); // Returns current system time in microseconds
+
#endif
diff --git a/indra/llcommon/lluri.h b/indra/llcommon/lluri.h
index 8e46e2e89e..8e69e8558a 100644
--- a/indra/llcommon/lluri.h
+++ b/indra/llcommon/lluri.h
@@ -47,7 +47,7 @@ class LLApp;
* See: http://www.ietf.org/rfc/rfc3986.txt
*
*/
-class LLURI
+class LL_COMMON_API LLURI
{
public:
LLURI();
@@ -178,6 +178,6 @@ private:
};
// this operator required for tut
-bool operator!=(const LLURI& first, const LLURI& second);
+LL_COMMON_API bool operator!=(const LLURI& first, const LLURI& second);
#endif // LL_LLURI_H
diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h
index 4b32138a06..c78fb12018 100644
--- a/indra/llcommon/lluuid.h
+++ b/indra/llcommon/lluuid.h
@@ -35,6 +35,7 @@
#include <iostream>
#include <set>
#include "stdtypes.h"
+#include "llpreprocessor.h"
const S32 UUID_BYTES = 16;
const S32 UUID_WORDS = 4;
@@ -47,7 +48,7 @@ struct uuid_time_t {
U32 low;
};
-class LLUUID
+class LL_COMMON_API LLUUID
{
public:
//
@@ -106,8 +107,8 @@ public:
LLUUID combine(const LLUUID& other) const;
void combine(const LLUUID& other, LLUUID& result) const;
- friend std::ostream& operator<<(std::ostream& s, const LLUUID &uuid);
- friend std::istream& operator>>(std::istream& s, LLUUID &uuid);
+ friend LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLUUID &uuid);
+ friend LL_COMMON_API std::istream& operator>>(std::istream& s, LLUUID &uuid);
void toString(char *out) const; // Does not allocate memory, needs 36 characters (including \0)
void toString(std::string& out) const;
@@ -323,7 +324,7 @@ typedef std::set<LLUUID, lluuid_less> uuid_list_t;
*/
typedef LLUUID LLAssetID;
-class LLTransactionID : public LLUUID
+class LL_COMMON_API LLTransactionID : public LLUUID
{
public:
LLTransactionID() : LLUUID() { }
diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h
index 19407f4463..a12bd52a64 100644
--- a/indra/llcommon/llworkerthread.h
+++ b/indra/llcommon/llworkerthread.h
@@ -50,7 +50,7 @@ class LLWorkerClass;
// Note: ~LLWorkerThread is O(N) N=# of worker threads, assumed to be small
// It is assumed that LLWorkerThreads are rarely created/destroyed.
-class LLWorkerThread : public LLQueuedThread
+class LL_COMMON_API LLWorkerThread : public LLQueuedThread
{
public:
class WorkRequest : public LLQueuedThread::QueuedRequest
@@ -113,7 +113,7 @@ public:
// Only one background task can be active at a time (per instance).
// i.e. don't call addWork() if haveWork() returns true
-class LLWorkerClass
+class LL_COMMON_API LLWorkerClass
{
friend class LLWorkerThread;
friend class LLWorkerThread::WorkRequest;
diff --git a/indra/llcommon/metaclass.h b/indra/llcommon/metaclass.h
index cc10f1675f..f38bcd2d57 100644
--- a/indra/llcommon/metaclass.h
+++ b/indra/llcommon/metaclass.h
@@ -43,7 +43,7 @@
class LLReflective;
class LLMetaProperty;
class LLMetaMethod;
-class LLMetaClass
+class LL_COMMON_API LLMetaClass
{
public:
diff --git a/indra/llcommon/metaproperty.h b/indra/llcommon/metaproperty.h
index e5ac35907c..6c016c56dd 100644
--- a/indra/llcommon/metaproperty.h
+++ b/indra/llcommon/metaproperty.h
@@ -41,7 +41,7 @@
class LLMetaClass;
class LLReflective;
-class LLMetaProperty
+class LL_COMMON_API LLMetaProperty
{
public:
LLMetaProperty(const std::string& name, const LLMetaClass& object_class);
diff --git a/indra/llcommon/reflective.h b/indra/llcommon/reflective.h
index e2c18ebc6d..a13537681d 100644
--- a/indra/llcommon/reflective.h
+++ b/indra/llcommon/reflective.h
@@ -36,7 +36,7 @@
#define LL_REFLECTIVE_H
class LLMetaClass;
-class LLReflective
+class LL_COMMON_API LLReflective
{
public:
LLReflective();
diff --git a/indra/llcommon/stringize.h b/indra/llcommon/stringize.h
index 1b2958020f..6399547f5e 100644
--- a/indra/llcommon/stringize.h
+++ b/indra/llcommon/stringize.h
@@ -13,6 +13,7 @@
#define LL_STRINGIZE_H
#include <sstream>
+#include <boost/lambda/lambda.hpp>
/**
* stringize(item) encapsulates an idiom we use constantly, using
@@ -28,6 +29,17 @@ std::string stringize(const T& item)
}
/**
+ * stringize_f(functor)
+ */
+template <typename Functor>
+std::string stringize_f(Functor const & f)
+{
+ std::ostringstream out;
+ f(out);
+ return out.str();
+}
+
+/**
* STRINGIZE(item1 << item2 << item3 ...) effectively expands to the
* following:
* @code
@@ -36,40 +48,43 @@ std::string stringize(const T& item)
* return out.str();
* @endcode
*/
-#define STRINGIZE(EXPRESSION) (static_cast<std::ostringstream&>(Stringize() << EXPRESSION).str())
+#define STRINGIZE(EXPRESSION) (stringize_f(boost::lambda::_1 << EXPRESSION))
+
/**
- * Helper class for STRINGIZE() macro. Ideally the body of
- * STRINGIZE(EXPRESSION) would look something like this:
+ * destringize(str)
+ * defined for symmetry with stringize
+ * *NOTE - this has distinct behavior from boost::lexical_cast<T> regarding
+ * leading/trailing whitespace and handling of bad_lexical_cast exceptions
+ */
+template <typename T>
+T destringize(std::string const & str)
+{
+ T val;
+ std::istringstream in(str);
+ in >> val;
+ return val;
+}
+
+/**
+ * destringize_f(str, functor)
+ */
+template <typename Functor>
+void destringize_f(std::string const & str, Functor const & f)
+{
+ std::istringstream in(str);
+ f(in);
+}
+
+/**
+ * DESTRINGIZE(str, item1 >> item2 >> item3 ...) effectively expands to the
+ * following:
* @code
- * (std::ostringstream() << EXPRESSION).str()
+ * std::istringstream in(str);
+ * in >> item1 >> item2 >> item3 ... ;
* @endcode
- * That doesn't work because each of the relevant operator<<() functions
- * accepts a non-const std::ostream&, to which you can't pass a temp instance
- * of std::ostringstream. Stringize plays the necessary const tricks to make
- * the whole thing work.
*/
-class Stringize
-{
-public:
- /**
- * This is the essence of Stringize. The leftmost << operator (the one
- * coded in the STRINGIZE() macro) engages this operator<<() const method
- * on the temp Stringize instance. Every other << operator (ones embedded
- * in EXPRESSION) simply sees the std::ostream& returned by the first one.
- *
- * Finally, the STRINGIZE() macro downcasts that std::ostream& to
- * std::ostringstream&.
- */
- template <typename T>
- std::ostream& operator<<(const T& item) const
- {
- mOut << item;
- return mOut;
- }
+#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::lambda::_1 >> EXPRESSION)))
-private:
- mutable std::ostringstream mOut;
-};
#endif /* ! defined(LL_STRINGIZE_H) */
diff --git a/indra/llcommon/tests/listener.h b/indra/llcommon/tests/listener.h
new file mode 100644
index 0000000000..fa12f944ef
--- /dev/null
+++ b/indra/llcommon/tests/listener.h
@@ -0,0 +1,139 @@
+/**
+ * @file listener.h
+ * @author Nat Goodspeed
+ * @date 2009-03-06
+ * @brief Useful for tests of the LLEventPump family of classes
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LISTENER_H)
+#define LL_LISTENER_H
+
+#include "llsd.h"
+#include <iostream>
+
+/*****************************************************************************
+* test listener class
+*****************************************************************************/
+class Listener;
+std::ostream& operator<<(std::ostream&, const Listener&);
+
+/// Bear in mind that this is strictly for testing
+class Listener
+{
+public:
+ /// Every Listener is instantiated with a name
+ Listener(const std::string& name):
+ mName(name)
+ {
+// std::cout << *this << ": ctor\n";
+ }
+/*==========================================================================*|
+ // These methods are only useful when trying to track Listener instance
+ // lifespan
+ Listener(const Listener& that):
+ mName(that.mName),
+ mLastEvent(that.mLastEvent)
+ {
+ std::cout << *this << ": copy\n";
+ }
+ virtual ~Listener()
+ {
+ std::cout << *this << ": dtor\n";
+ }
+|*==========================================================================*/
+ /// You can request the name
+ std::string getName() const { return mName; }
+ /// This is a typical listener method that returns 'false' when done,
+ /// allowing subsequent listeners on the LLEventPump to process the
+ /// incoming event.
+ bool call(const LLSD& event)
+ {
+// std::cout << *this << "::call(" << event << ")\n";
+ mLastEvent = event;
+ return false;
+ }
+ /// This is an alternate listener that returns 'true' when done, which
+ /// stops processing of the incoming event.
+ bool callstop(const LLSD& event)
+ {
+// std::cout << *this << "::callstop(" << event << ")\n";
+ mLastEvent = event;
+ return true;
+ }
+ /// ListenMethod can represent either call() or callstop().
+ typedef bool (Listener::*ListenMethod)(const LLSD&);
+ /**
+ * This helper method is only because our test code makes so many
+ * repetitive listen() calls to ListenerMethods. In real code, you should
+ * call LLEventPump::listen() directly so it can examine the specific
+ * object you pass to boost::bind().
+ */
+ LLBoundListener listenTo(LLEventPump& pump,
+ ListenMethod method=&Listener::call,
+ const LLEventPump::NameList& after=LLEventPump::empty,
+ const LLEventPump::NameList& before=LLEventPump::empty)
+ {
+ return pump.listen(getName(), boost::bind(method, this, _1), after, before);
+ }
+ /// Both call() and callstop() set mLastEvent. Retrieve it.
+ LLSD getLastEvent() const
+ {
+// std::cout << *this << "::getLastEvent() -> " << mLastEvent << "\n";
+ return mLastEvent;
+ }
+ /// Reset mLastEvent to a known state.
+ void reset(const LLSD& to = LLSD())
+ {
+// std::cout << *this << "::reset(" << to << ")\n";
+ mLastEvent = to;
+ }
+
+private:
+ std::string mName;
+ LLSD mLastEvent;
+};
+
+std::ostream& operator<<(std::ostream& out, const Listener& listener)
+{
+ out << "Listener(" << listener.getName() /* << "@" << &listener */ << ')';
+ return out;
+}
+
+/**
+ * This class tests the relative order in which various listeners on a given
+ * LLEventPump are called. Each listen() call binds a particular string, which
+ * we collect for later examination. The actual event is ignored.
+ */
+struct Collect
+{
+ bool add(const std::string& bound, const LLSD& event)
+ {
+ result.push_back(bound);
+ return false;
+ }
+ void clear() { result.clear(); }
+ typedef std::vector<std::string> StringList;
+ StringList result;
+};
+
+std::ostream& operator<<(std::ostream& out, const Collect::StringList& strings)
+{
+ out << '(';
+ Collect::StringList::const_iterator begin(strings.begin()), end(strings.end());
+ if (begin != end)
+ {
+ out << '"' << *begin << '"';
+ while (++begin != end)
+ {
+ out << ", \"" << *begin << '"';
+ }
+ }
+ out << ')';
+ return out;
+}
+
+#endif /* ! defined(LL_LISTENER_H) */
diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp
new file mode 100644
index 0000000000..3a2cda7735
--- /dev/null
+++ b/indra/llcommon/tests/lleventcoro_test.cpp
@@ -0,0 +1,782 @@
+/**
+ * @file coroutine_test.cpp
+ * @author Nat Goodspeed
+ * @date 2009-04-22
+ * @brief Test for coroutine.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+/*****************************************************************************/
+// test<1>() is cloned from a Boost.Coroutine example program whose copyright
+// info is reproduced here:
+/*---------------------------------------------------------------------------*/
+// Copyright (c) 2006, Giovanni P. Deretta
+//
+// This code may be used under either of the following two licences:
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE. OF SUCH DAMAGE.
+//
+// Or:
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+/*****************************************************************************/
+
+// On some platforms, Boost.Coroutine must #define magic symbols before
+// #including platform-API headers. Naturally, that's ineffective unless the
+// Boost.Coroutine #include is the *first* #include of the platform header.
+// That means that client code must generally #include Boost.Coroutine headers
+// before anything else.
+#include <boost/coroutine/coroutine.hpp>
+// Normally, lleventcoro.h obviates future.hpp. We only include this because
+// we implement a "by hand" test of future functionality.
+#include <boost/coroutine/future.hpp>
+#include <boost/bind.hpp>
+#include <boost/range.hpp>
+
+#include "linden_common.h"
+
+#include <iostream>
+#include <string>
+
+#include "../test/lltut.h"
+#include "llsd.h"
+#include "llevents.h"
+#include "tests/wrapllerrs.h"
+#include "stringize.h"
+#include "lleventcoro.h"
+#include "../test/debug.h"
+
+/*****************************************************************************
+* from the banana.cpp example program borrowed for test<1>()
+*****************************************************************************/
+namespace coroutines = boost::coroutines;
+using coroutines::coroutine;
+
+template<typename Iter>
+bool match(Iter first, Iter last, std::string match) {
+ std::string::iterator i = match.begin();
+ i != match.end();
+ for(; (first != last) && (i != match.end()); ++i) {
+ if (*first != *i)
+ return false;
+ ++first;
+ }
+ return i == match.end();
+}
+
+template<typename BidirectionalIterator>
+BidirectionalIterator
+match_substring(BidirectionalIterator begin,
+ BidirectionalIterator end,
+ std::string xmatch,
+ BOOST_DEDUCED_TYPENAME coroutine<BidirectionalIterator(void)>::self& self) {
+ BidirectionalIterator begin_ = begin;
+ for(; begin != end; ++begin)
+ if(match(begin, end, xmatch)) {
+ self.yield(begin);
+ }
+ return end;
+}
+
+typedef coroutine<std::string::iterator(void)> match_coroutine_type;
+
+/*****************************************************************************
+* Test helpers
+*****************************************************************************/
+// I suspect this will be typical of coroutines used in Linden software
+typedef boost::coroutines::coroutine<void()> coroutine_type;
+
+/// Simulate an event API whose response is immediate: sent on receipt of the
+/// initial request, rather than after some delay. This is the case that
+/// distinguishes postAndWait() from calling post(), then calling
+/// waitForEventOn().
+class ImmediateAPI
+{
+public:
+ ImmediateAPI():
+ mPump("immediate", true)
+ {
+ mPump.listen("API", boost::bind(&ImmediateAPI::operator(), this, _1));
+ }
+
+ LLEventPump& getPump() { return mPump; }
+
+ // Invoke this with an LLSD map containing:
+ // ["value"]: Integer value. We will reply with ["value"] + 1.
+ // ["reply"]: Name of LLEventPump on which to send success response.
+ // ["error"]: Name of LLEventPump on which to send error response.
+ // ["fail"]: Presence of this key selects ["error"], else ["success"] as
+ // the name of the pump on which to send the response.
+ bool operator()(const LLSD& event) const
+ {
+ LLSD::Integer value(event["value"]);
+ LLSD::String replyPumpName(event.has("fail")? "error" : "reply");
+ LLEventPumps::instance().obtain(event[replyPumpName]).post(value + 1);
+ return false;
+ }
+
+private:
+ LLEventStream mPump;
+};
+
+/*****************************************************************************
+* TUT
+*****************************************************************************/
+namespace tut
+{
+ struct coroutine_data
+ {
+ // Define coroutine bodies as methods here so they can use ensure*()
+
+ void explicit_wait(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ // ... do whatever preliminary stuff must happen ...
+
+ // declare the future
+ boost::coroutines::future<LLSD> future(self);
+ // tell the future what to wait for
+ LLTempBoundListener connection(
+ LLEventPumps::instance().obtain("source").listen("coro", voidlistener(boost::coroutines::make_callback(future))));
+ ensure("Not yet", ! future);
+ // attempting to dereference ("resolve") the future causes the calling
+ // coroutine to wait for it
+ debug("about to wait");
+ result = *future;
+ ensure("Got it", future);
+ }
+ END
+ }
+
+ void waitForEventOn1(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ result = waitForEventOn(self, "source");
+ }
+ END
+ }
+
+ void waitForEventOn2(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLEventWithID pair = waitForEventOn(self, "reply", "error");
+ result = pair.first;
+ which = pair.second;
+ debug(STRINGIZE("result = " << result << ", which = " << which));
+ }
+ END
+ }
+
+ void postAndWait1(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ result = postAndWait(self,
+ LLSD().insert("value", 17), // request event
+ immediateAPI.getPump(), // requestPump
+ "reply1", // replyPump
+ "reply"); // request["reply"] = name
+ }
+ END
+ }
+
+ void postAndWait2(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLEventWithID pair = ::postAndWait2(self,
+ LLSD().insert("value", 18),
+ immediateAPI.getPump(),
+ "reply2",
+ "error2",
+ "reply",
+ "error");
+ result = pair.first;
+ which = pair.second;
+ debug(STRINGIZE("result = " << result << ", which = " << which));
+ }
+ END
+ }
+
+ void postAndWait2_1(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLEventWithID pair = ::postAndWait2(self,
+ LLSD().insert("value", 18).insert("fail", LLSD()),
+ immediateAPI.getPump(),
+ "reply2",
+ "error2",
+ "reply",
+ "error");
+ result = pair.first;
+ which = pair.second;
+ debug(STRINGIZE("result = " << result << ", which = " << which));
+ }
+ END
+ }
+
+ void coroPump(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPump waiter;
+ replyName = waiter.getName();
+ result = waiter.wait(self);
+ }
+ END
+ }
+
+ void coroPumpPost(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPump waiter;
+ result = waiter.postAndWait(self, LLSD().insert("value", 17),
+ immediateAPI.getPump(), "reply");
+ }
+ END
+ }
+
+ void coroPumps(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ replyName = waiter.getName0();
+ errorName = waiter.getName1();
+ LLEventWithID pair(waiter.wait(self));
+ result = pair.first;
+ which = pair.second;
+ }
+ END
+ }
+
+ void coroPumpsNoEx(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ replyName = waiter.getName0();
+ errorName = waiter.getName1();
+ result = waiter.waitWithException(self);
+ }
+ END
+ }
+
+ void coroPumpsEx(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ replyName = waiter.getName0();
+ errorName = waiter.getName1();
+ try
+ {
+ result = waiter.waitWithException(self);
+ debug("no exception");
+ }
+ catch (const LLErrorEvent& e)
+ {
+ debug(STRINGIZE("exception " << e.what()));
+ errordata = e.getData();
+ }
+ }
+ END
+ }
+
+ void coroPumpsNoLog(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ replyName = waiter.getName0();
+ errorName = waiter.getName1();
+ result = waiter.waitWithLog(self);
+ }
+ END
+ }
+
+ void coroPumpsLog(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ replyName = waiter.getName0();
+ errorName = waiter.getName1();
+ WrapLL_ERRS capture;
+ try
+ {
+ result = waiter.waitWithLog(self);
+ debug("no exception");
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ debug(STRINGIZE("exception " << e.what()));
+ threw = e.what();
+ }
+ }
+ END
+ }
+
+ void coroPumpsPost(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ LLEventWithID pair(waiter.postAndWait(self, LLSD().insert("value", 23),
+ immediateAPI.getPump(), "reply", "error"));
+ result = pair.first;
+ which = pair.second;
+ }
+ END
+ }
+
+ void coroPumpsPost_1(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ LLEventWithID pair(
+ waiter.postAndWait(self, LLSD().insert("value", 23).insert("fail", LLSD()),
+ immediateAPI.getPump(), "reply", "error"));
+ result = pair.first;
+ which = pair.second;
+ }
+ END
+ }
+
+ void coroPumpsPostNoEx(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ result = waiter.postAndWaitWithException(self, LLSD().insert("value", 8),
+ immediateAPI.getPump(), "reply", "error");
+ }
+ END
+ }
+
+ void coroPumpsPostEx(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ try
+ {
+ result = waiter.postAndWaitWithException(self,
+ LLSD().insert("value", 9).insert("fail", LLSD()),
+ immediateAPI.getPump(), "reply", "error");
+ debug("no exception");
+ }
+ catch (const LLErrorEvent& e)
+ {
+ debug(STRINGIZE("exception " << e.what()));
+ errordata = e.getData();
+ }
+ }
+ END
+ }
+
+ void coroPumpsPostNoLog(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ result = waiter.postAndWaitWithLog(self, LLSD().insert("value", 30),
+ immediateAPI.getPump(), "reply", "error");
+ }
+ END
+ }
+
+ void coroPumpsPostLog(coroutine_type::self& self)
+ {
+ BEGIN
+ {
+ LLCoroEventPumps waiter;
+ WrapLL_ERRS capture;
+ try
+ {
+ result = waiter.postAndWaitWithLog(self,
+ LLSD().insert("value", 31).insert("fail", LLSD()),
+ immediateAPI.getPump(), "reply", "error");
+ debug("no exception");
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ debug(STRINGIZE("exception " << e.what()));
+ threw = e.what();
+ }
+ }
+ END
+ }
+
+ void ensure_done(coroutine_type& coro)
+ {
+ ensure("coroutine complete", ! coro);
+ }
+
+ ImmediateAPI immediateAPI;
+ std::string replyName, errorName, threw;
+ LLSD result, errordata;
+ int which;
+ };
+ typedef test_group<coroutine_data> coroutine_group;
+ typedef coroutine_group::object object;
+ coroutine_group coroutinegrp("coroutine");
+
+ template<> template<>
+ void object::test<1>()
+ {
+ set_test_name("From banana.cpp example program in Boost.Coroutine distro");
+ std::string buffer = "banananana";
+ std::string match = "nana";
+ std::string::iterator begin = buffer.begin();
+ std::string::iterator end = buffer.end();
+
+#if defined(BOOST_CORO_POSIX_IMPL)
+// std::cout << "Using Boost.Coroutine " << BOOST_CORO_POSIX_IMPL << '\n';
+#else
+// std::cout << "Using non-Posix Boost.Coroutine implementation" << std::endl;
+#endif
+
+ typedef std::string::iterator signature(std::string::iterator,
+ std::string::iterator,
+ std::string,
+ match_coroutine_type::self&);
+
+ coroutine<std::string::iterator(void)> matcher
+ (boost::bind(static_cast<signature*>(match_substring),
+ begin,
+ end,
+ match,
+ _1));
+
+ std::string::iterator i = matcher();
+/*==========================================================================*|
+ while(matcher && i != buffer.end()) {
+ std::cout <<"Match at: "<< std::distance(buffer.begin(), i)<<'\n';
+ i = matcher();
+ }
+|*==========================================================================*/
+ size_t matches[] = { 2, 4, 6 };
+ for (size_t *mi(boost::begin(matches)), *mend(boost::end(matches));
+ mi != mend; ++mi, i = matcher())
+ {
+ ensure("more", matcher);
+ ensure("found", i != buffer.end());
+ ensure_equals("value", std::distance(buffer.begin(), i), *mi);
+ }
+ ensure("done", ! matcher);
+ }
+
+ template<> template<>
+ void object::test<2>()
+ {
+ set_test_name("explicit_wait");
+ DEBUG;
+
+ // Construct the coroutine instance that will run explicit_wait.
+ // Pass the ctor a callable that accepts the coroutine_type::self
+ // param passed by the library.
+ coroutine_type coro(boost::bind(&coroutine_data::explicit_wait, this, _1));
+ // Start the coroutine
+ coro(std::nothrow);
+ // When the coroutine waits for the event pump, it returns here.
+ debug("about to send");
+ // Satisfy the wait.
+ LLEventPumps::instance().obtain("source").post("received");
+ // Now wait for the coroutine to complete.
+ ensure_done(coro);
+ // ensure the coroutine ran and woke up again with the intended result
+ ensure_equals(result.asString(), "received");
+ }
+
+ template<> template<>
+ void object::test<3>()
+ {
+ set_test_name("waitForEventOn1");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::waitForEventOn1, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain("source").post("received");
+ debug("back from send");
+ ensure_done(coro);
+ ensure_equals(result.asString(), "received");
+ }
+
+ template<> template<>
+ void object::test<4>()
+ {
+ set_test_name("waitForEventOn2 reply");
+ {
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::waitForEventOn2, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain("reply").post("received");
+ debug("back from send");
+ ensure_done(coro);
+ }
+ ensure_equals(result.asString(), "received");
+ ensure_equals("which pump", which, 0);
+ }
+
+ template<> template<>
+ void object::test<5>()
+ {
+ set_test_name("waitForEventOn2 error");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::waitForEventOn2, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain("error").post("badness");
+ debug("back from send");
+ ensure_done(coro);
+ ensure_equals(result.asString(), "badness");
+ ensure_equals("which pump", which, 1);
+ }
+
+ template<> template<>
+ void object::test<6>()
+ {
+ set_test_name("coroPump");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPump, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain(replyName).post("received");
+ debug("back from send");
+ ensure_done(coro);
+ ensure_equals(result.asString(), "received");
+ }
+
+ template<> template<>
+ void object::test<7>()
+ {
+ set_test_name("coroPumps reply");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumps, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain(replyName).post("received");
+ debug("back from send");
+ ensure_done(coro);
+ ensure_equals(result.asString(), "received");
+ ensure_equals("which pump", which, 0);
+ }
+
+ template<> template<>
+ void object::test<8>()
+ {
+ set_test_name("coroPumps error");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumps, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain(errorName).post("badness");
+ debug("back from send");
+ ensure_done(coro);
+ ensure_equals(result.asString(), "badness");
+ ensure_equals("which pump", which, 1);
+ }
+
+ template<> template<>
+ void object::test<9>()
+ {
+ set_test_name("coroPumpsNoEx");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsNoEx, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain(replyName).post("received");
+ debug("back from send");
+ ensure_done(coro);
+ ensure_equals(result.asString(), "received");
+ }
+
+ template<> template<>
+ void object::test<10>()
+ {
+ set_test_name("coroPumpsEx");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsEx, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain(errorName).post("badness");
+ debug("back from send");
+ ensure_done(coro);
+ ensure("no result", result.isUndefined());
+ ensure_equals("got error", errordata.asString(), "badness");
+ }
+
+ template<> template<>
+ void object::test<11>()
+ {
+ set_test_name("coroPumpsNoLog");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsNoLog, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain(replyName).post("received");
+ debug("back from send");
+ ensure_done(coro);
+ ensure_equals(result.asString(), "received");
+ }
+
+ template<> template<>
+ void object::test<12>()
+ {
+ set_test_name("coroPumpsLog");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsLog, this, _1));
+ coro(std::nothrow);
+ debug("about to send");
+ LLEventPumps::instance().obtain(errorName).post("badness");
+ debug("back from send");
+ ensure_done(coro);
+ ensure("no result", result.isUndefined());
+ ensure_contains("got error", threw, "badness");
+ }
+
+ template<> template<>
+ void object::test<13>()
+ {
+ set_test_name("postAndWait1");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::postAndWait1, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 18);
+ }
+
+ template<> template<>
+ void object::test<14>()
+ {
+ set_test_name("postAndWait2");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::postAndWait2, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 19);
+ ensure_equals(which, 0);
+ }
+
+ template<> template<>
+ void object::test<15>()
+ {
+ set_test_name("postAndWait2_1");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::postAndWait2_1, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 19);
+ ensure_equals(which, 1);
+ }
+
+ template<> template<>
+ void object::test<16>()
+ {
+ set_test_name("coroPumpPost");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpPost, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 18);
+ }
+
+ template<> template<>
+ void object::test<17>()
+ {
+ set_test_name("coroPumpsPost reply");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsPost, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 24);
+ ensure_equals("which pump", which, 0);
+ }
+
+ template<> template<>
+ void object::test<18>()
+ {
+ set_test_name("coroPumpsPost error");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsPost_1, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 24);
+ ensure_equals("which pump", which, 1);
+ }
+
+ template<> template<>
+ void object::test<19>()
+ {
+ set_test_name("coroPumpsPostNoEx");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsPostNoEx, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 9);
+ }
+
+ template<> template<>
+ void object::test<20>()
+ {
+ set_test_name("coroPumpsPostEx");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsPostEx, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure("no result", result.isUndefined());
+ ensure_equals("got error", errordata.asInteger(), 10);
+ }
+
+ template<> template<>
+ void object::test<21>()
+ {
+ set_test_name("coroPumpsPostNoLog");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsPostNoLog, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure_equals(result.asInteger(), 31);
+ }
+
+ template<> template<>
+ void object::test<22>()
+ {
+ set_test_name("coroPumpsPostLog");
+ DEBUG;
+ coroutine_type coro(boost::bind(&coroutine_data::coroPumpsPostLog, this, _1));
+ coro(std::nothrow);
+ ensure_done(coro);
+ ensure("no result", result.isUndefined());
+ ensure_contains("got error", threw, "32");
+ }
+} // namespace tut
diff --git a/indra/llcommon/tests/lleventfilter_test.cpp b/indra/llcommon/tests/lleventfilter_test.cpp
new file mode 100644
index 0000000000..28b909298e
--- /dev/null
+++ b/indra/llcommon/tests/lleventfilter_test.cpp
@@ -0,0 +1,276 @@
+/**
+ * @file lleventfilter_test.cpp
+ * @author Nat Goodspeed
+ * @date 2009-03-06
+ * @brief Test for lleventfilter.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "lleventfilter.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+#include "../test/lltut.h"
+#include "stringize.h"
+#include "listener.h"
+#include "tests/wrapllerrs.h"
+
+/*****************************************************************************
+* Test classes
+*****************************************************************************/
+// Strictly speaking, we're testing LLEventTimeoutBase rather than the
+// production LLEventTimeout (using LLTimer) because we don't want every test
+// run to pause for some number of seconds until we reach a real timeout. But
+// as we've carefully put all functionality except actual LLTimer calls into
+// LLEventTimeoutBase, that should suffice. We're not not not trying to test
+// LLTimer here.
+class TestEventTimeout: public LLEventTimeoutBase
+{
+public:
+ TestEventTimeout():
+ mElapsed(true)
+ {}
+ TestEventTimeout(LLEventPump& source):
+ LLEventTimeoutBase(source),
+ mElapsed(true)
+ {}
+
+ // test hook
+ void forceTimeout(bool timeout=true) { mElapsed = timeout; }
+
+protected:
+ virtual void setCountdown(F32 seconds) { mElapsed = false; }
+ virtual bool countdownElapsed() const { return mElapsed; }
+
+private:
+ bool mElapsed;
+};
+
+/*****************************************************************************
+* TUT
+*****************************************************************************/
+namespace tut
+{
+ struct filter_data
+ {
+ // The resemblance between this test data and that in llevents_tut.cpp
+ // is not coincidental.
+ filter_data():
+ pumps(LLEventPumps::instance()),
+ mainloop(pumps.obtain("mainloop")),
+ listener0("first"),
+ listener1("second")
+ {}
+ LLEventPumps& pumps;
+ LLEventPump& mainloop;
+ Listener listener0;
+ Listener listener1;
+
+ void check_listener(const std::string& desc, const Listener& listener, const LLSD& got)
+ {
+ ensure_equals(STRINGIZE(listener << ' ' << desc),
+ listener.getLastEvent(), got);
+ }
+ };
+ typedef test_group<filter_data> filter_group;
+ typedef filter_group::object filter_object;
+ filter_group filtergrp("lleventfilter");
+
+ template<> template<>
+ void filter_object::test<1>()
+ {
+ set_test_name("LLEventMatching");
+ LLEventPump& driver(pumps.obtain("driver"));
+ listener0.reset(0);
+ // Listener isn't derived from LLEventTrackable specifically to test
+ // various connection-management mechanisms. But that means we have a
+ // couple of transient Listener objects, one of which is listening to
+ // a persistent LLEventPump. Capture those connections in local
+ // LLTempBoundListener instances so they'll disconnect
+ // on destruction.
+ LLTempBoundListener temp1(
+ listener0.listenTo(driver));
+ // Construct a pattern LLSD: desired Event must have a key "foo"
+ // containing string "bar"
+ LLEventMatching filter(driver, LLSD().insert("foo", "bar"));
+ listener1.reset(0);
+ LLTempBoundListener temp2(
+ listener1.listenTo(filter));
+ driver.post(1);
+ check_listener("direct", listener0, LLSD(1));
+ check_listener("filtered", listener1, LLSD(0));
+ // Okay, construct an LLSD map matching the pattern
+ LLSD data;
+ data["foo"] = "bar";
+ data["random"] = 17;
+ driver.post(data);
+ check_listener("direct", listener0, data);
+ check_listener("filtered", listener1, data);
+ }
+
+ template<> template<>
+ void filter_object::test<2>()
+ {
+ set_test_name("LLEventTimeout::actionAfter()");
+ LLEventPump& driver(pumps.obtain("driver"));
+ TestEventTimeout filter(driver);
+ listener0.reset(0);
+ LLTempBoundListener temp1(
+ listener0.listenTo(filter));
+ // Use listener1.call() as the Action for actionAfter(), since it
+ // already provides a way to sense the call
+ listener1.reset(0);
+ // driver --> filter --> listener0
+ filter.actionAfter(20,
+ boost::bind(&Listener::call, boost::ref(listener1), LLSD("timeout")));
+ // Okay, (fake) timer is ticking. 'filter' can only sense the timer
+ // when we pump mainloop. Do that right now to take the logic path
+ // before either the anticipated event arrives or the timer expires.
+ mainloop.post(17);
+ check_listener("no timeout 1", listener1, LLSD(0));
+ // Expected event arrives...
+ driver.post(1);
+ check_listener("event passed thru", listener0, LLSD(1));
+ // Should have canceled the timer. Verify that by asserting that the
+ // time has expired, then pumping mainloop again.
+ filter.forceTimeout();
+ mainloop.post(17);
+ check_listener("no timeout 2", listener1, LLSD(0));
+ // Verify chained actionAfter() calls, that is, that a second
+ // actionAfter() resets the timer established by the first
+ // actionAfter().
+ filter.actionAfter(20,
+ boost::bind(&Listener::call, boost::ref(listener1), LLSD("timeout")));
+ // Since our TestEventTimeout class isn't actually manipulating time
+ // (quantities of seconds), only a bool "elapsed" flag, sense that by
+ // forcing the flag between actionAfter() calls.
+ filter.forceTimeout();
+ // Pumping mainloop here would result in a timeout (as we'll verify
+ // below). This state simulates a ticking timer that has not yet timed
+ // out. But now, before a mainloop event lets 'filter' recognize
+ // timeout on the previous actionAfter() call, pretend we're pushing
+ // that timeout farther into the future.
+ filter.actionAfter(20,
+ boost::bind(&Listener::call, boost::ref(listener1), LLSD("timeout")));
+ // Look ma, no timeout!
+ mainloop.post(17);
+ check_listener("no timeout 3", listener1, LLSD(0));
+ // Now let the updated actionAfter() timer expire.
+ filter.forceTimeout();
+ // Notice the timeout.
+ mainloop.post(17);
+ check_listener("timeout", listener1, LLSD("timeout"));
+ // Timing out cancels the timer. Verify that.
+ listener1.reset(0);
+ filter.forceTimeout();
+ mainloop.post(17);
+ check_listener("no timeout 4", listener1, LLSD(0));
+ // Reset the timer and then cancel() it.
+ filter.actionAfter(20,
+ boost::bind(&Listener::call, boost::ref(listener1), LLSD("timeout")));
+ // neither expired nor satisified
+ mainloop.post(17);
+ check_listener("no timeout 5", listener1, LLSD(0));
+ // cancel
+ filter.cancel();
+ // timeout!
+ filter.forceTimeout();
+ mainloop.post(17);
+ check_listener("no timeout 6", listener1, LLSD(0));
+ }
+
+ template<> template<>
+ void filter_object::test<3>()
+ {
+ set_test_name("LLEventTimeout::eventAfter()");
+ LLEventPump& driver(pumps.obtain("driver"));
+ TestEventTimeout filter(driver);
+ listener0.reset(0);
+ LLTempBoundListener temp1(
+ listener0.listenTo(filter));
+ filter.eventAfter(20, LLSD("timeout"));
+ // Okay, (fake) timer is ticking. 'filter' can only sense the timer
+ // when we pump mainloop. Do that right now to take the logic path
+ // before either the anticipated event arrives or the timer expires.
+ mainloop.post(17);
+ check_listener("no timeout 1", listener0, LLSD(0));
+ // Expected event arrives...
+ driver.post(1);
+ check_listener("event passed thru", listener0, LLSD(1));
+ // Should have canceled the timer. Verify that by asserting that the
+ // time has expired, then pumping mainloop again.
+ filter.forceTimeout();
+ mainloop.post(17);
+ check_listener("no timeout 2", listener0, LLSD(1));
+ // Set timer again.
+ filter.eventAfter(20, LLSD("timeout"));
+ // Now let the timer expire.
+ filter.forceTimeout();
+ // Notice the timeout.
+ mainloop.post(17);
+ check_listener("timeout", listener0, LLSD("timeout"));
+ // Timing out cancels the timer. Verify that.
+ listener0.reset(0);
+ filter.forceTimeout();
+ mainloop.post(17);
+ check_listener("no timeout 3", listener0, LLSD(0));
+ }
+
+ template<> template<>
+ void filter_object::test<4>()
+ {
+ set_test_name("LLEventTimeout::errorAfter()");
+ WrapLL_ERRS capture;
+ LLEventPump& driver(pumps.obtain("driver"));
+ TestEventTimeout filter(driver);
+ listener0.reset(0);
+ LLTempBoundListener temp1(
+ listener0.listenTo(filter));
+ filter.errorAfter(20, "timeout");
+ // Okay, (fake) timer is ticking. 'filter' can only sense the timer
+ // when we pump mainloop. Do that right now to take the logic path
+ // before either the anticipated event arrives or the timer expires.
+ mainloop.post(17);
+ check_listener("no timeout 1", listener0, LLSD(0));
+ // Expected event arrives...
+ driver.post(1);
+ check_listener("event passed thru", listener0, LLSD(1));
+ // Should have canceled the timer. Verify that by asserting that the
+ // time has expired, then pumping mainloop again.
+ filter.forceTimeout();
+ mainloop.post(17);
+ check_listener("no timeout 2", listener0, LLSD(1));
+ // Set timer again.
+ filter.errorAfter(20, "timeout");
+ // Now let the timer expire.
+ filter.forceTimeout();
+ // Notice the timeout.
+ std::string threw;
+ try
+ {
+ mainloop.post(17);
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ threw = e.what();
+ }
+ ensure_contains("errorAfter() timeout exception", threw, "timeout");
+ // Timing out cancels the timer. Verify that.
+ listener0.reset(0);
+ filter.forceTimeout();
+ mainloop.post(17);
+ check_listener("no timeout 3", listener0, LLSD(0));
+ }
+} // namespace tut
+
+/*****************************************************************************
+* Link dependencies
+*****************************************************************************/
+#include "llsdutil.cpp"
diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h
new file mode 100644
index 0000000000..1001ebc466
--- /dev/null
+++ b/indra/llcommon/tests/wrapllerrs.h
@@ -0,0 +1,56 @@
+/**
+ * @file wrapllerrs.h
+ * @author Nat Goodspeed
+ * @date 2009-03-11
+ * @brief Define a class useful for unit tests that engage llerrs (LL_ERRS) functionality
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_WRAPLLERRS_H)
+#define LL_WRAPLLERRS_H
+
+#include "llerrorcontrol.h"
+
+struct WrapLL_ERRS
+{
+ WrapLL_ERRS():
+ // Resetting Settings discards the default Recorder that writes to
+ // stderr. Otherwise, expected llerrs (LL_ERRS) messages clutter the
+ // console output of successful tests, potentially confusing things.
+ mPriorErrorSettings(LLError::saveAndResetSettings()),
+ // Save shutdown function called by LL_ERRS
+ mPriorFatal(LLError::getFatalFunction())
+ {
+ // Make LL_ERRS call our own operator() method
+ LLError::setFatalFunction(boost::bind(&WrapLL_ERRS::operator(), this, _1));
+ }
+
+ ~WrapLL_ERRS()
+ {
+ LLError::setFatalFunction(mPriorFatal);
+ LLError::restoreSettings(mPriorErrorSettings);
+ }
+
+ struct FatalException: public std::runtime_error
+ {
+ FatalException(const std::string& what): std::runtime_error(what) {}
+ };
+
+ void operator()(const std::string& message)
+ {
+ // Save message for later in case consumer wants to sense the result directly
+ error = message;
+ // Also throw an appropriate exception since calling code is likely to
+ // assume that control won't continue beyond LL_ERRS.
+ throw FatalException(message);
+ }
+
+ std::string error;
+ LLError::Settings* mPriorErrorSettings;
+ LLError::FatalFunction mPriorFatal;
+};
+
+#endif /* ! defined(LL_WRAPLLERRS_H) */
diff --git a/indra/llcommon/timing.h b/indra/llcommon/timing.h
index 2b9f60adad..140ce1fcaa 100644
--- a/indra/llcommon/timing.h
+++ b/indra/llcommon/timing.h
@@ -43,7 +43,6 @@ const F32 SEC_TO_MICROSEC = 1000000.f;
const U64 SEC_TO_MICROSEC_U64 = 1000000;
const U32 SEC_PER_DAY = 86400;
-// This is just a stub, implementation in lltimer.cpp. This file will be deprecated in the future.
-U64 totalTime(); // Returns current system time in microseconds
+// functionality has been moved lltimer.{cpp,h}. This file will be deprecated in the future.
#endif
diff --git a/indra/llcommon/u64.h b/indra/llcommon/u64.h
index 09a6b3e18d..eb51131e94 100644
--- a/indra/llcommon/u64.h
+++ b/indra/llcommon/u64.h
@@ -39,14 +39,14 @@
* @param str The string to parse.
* @return Returns the first U64 value found in the string or 0 on failure.
*/
-U64 str_to_U64(const std::string& str);
+LL_COMMON_API U64 str_to_U64(const std::string& str);
/**
* @brief Given a U64 value, return a printable representation.
* @param value The U64 to turn into a printable character array.
* @return Returns the result string.
*/
-std::string U64_to_str(U64 value);
+LL_COMMON_API std::string U64_to_str(U64 value);
/**
* @brief Given a U64 value, return a printable representation.
@@ -65,16 +65,16 @@ std::string U64_to_str(U64 value);
* @param result_size The size of the buffer allocated. Use U64_BUF.
* @return Returns the result pointer.
*/
-char* U64_to_str(U64 value, char* result, S32 result_size);
+LL_COMMON_API char* U64_to_str(U64 value, char* result, S32 result_size);
/**
* @brief Convert a U64 to the closest F64 value.
*/
-F64 U64_to_F64(const U64 value);
+LL_COMMON_API F64 U64_to_F64(const U64 value);
/**
* @brief Helper function to wrap strtoull() which is not available on windows.
*/
-U64 llstrtou64(const char* str, char** end, S32 base);
+LL_COMMON_API U64 llstrtou64(const char* str, char** end, S32 base);
#endif
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index e48690908e..2808effdc6 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -43,7 +43,7 @@
#include "llsdutil.h"
#include "lltransactiontypes.h"
#include "lltransactionflags.h"
-#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "message.h"
#include "u64.h"
diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt
index 2bb3800144..d27a1467ea 100644
--- a/indra/llmath/CMakeLists.txt
+++ b/indra/llmath/CMakeLists.txt
@@ -62,6 +62,7 @@ set(llmath_HEADER_FILES
llv4vector3.h
llvolume.h
llvolumemgr.h
+ llsdutil_math.h
m3math.h
m4math.h
raytrace.h
diff --git a/indra/llmath/llbbox.cpp b/indra/llmath/llbbox.cpp
index acf93a2a38..914cbfdc12 100644
--- a/indra/llmath/llbbox.cpp
+++ b/indra/llmath/llbbox.cpp
@@ -30,6 +30,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
// self include
#include "llbbox.h"
diff --git a/indra/llmath/llsdutil_math.cpp b/indra/llmath/llsdutil_math.cpp
index c5176681ce..1bd12ae513 100644
--- a/indra/llmath/llsdutil_math.cpp
+++ b/indra/llmath/llsdutil_math.cpp
@@ -34,7 +34,7 @@
#include "linden_common.h"
-#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "v3math.h"
#include "v4math.h"
diff --git a/indra/llmath/llsdutil_math.h b/indra/llmath/llsdutil_math.h
new file mode 100644
index 0000000000..121f4b746a
--- /dev/null
+++ b/indra/llmath/llsdutil_math.h
@@ -0,0 +1,70 @@
+/**
+ * @file llsdutil_math.h
+ * @author Brad
+ * @date 2009-05-19
+ * @brief Utility classes, functions, etc, for using structured data with math classes.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
+ * Copyright (c) 2009-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLSDUTIL_MATH_H
+#define LL_LLSDUTIL_MATH_H
+
+class LL_COMMON_API LLSD;
+
+// vector3
+class LLVector3;
+LLSD ll_sd_from_vector3(const LLVector3& vec);
+LLVector3 ll_vector3_from_sd(const LLSD& sd, S32 start_index = 0);
+
+// vector4
+class LLVector4;
+LLSD ll_sd_from_vector4(const LLVector4& vec);
+LLVector4 ll_vector4_from_sd(const LLSD& sd, S32 start_index = 0);
+
+// vector3d (double)
+class LLVector3d;
+LLSD ll_sd_from_vector3d(const LLVector3d& vec);
+LLVector3d ll_vector3d_from_sd(const LLSD& sd, S32 start_index = 0);
+
+// vector2
+class LLVector2;
+LLSD ll_sd_from_vector2(const LLVector2& vec);
+LLVector2 ll_vector2_from_sd(const LLSD& sd);
+
+// Quaternion
+class LLQuaternion;
+LLSD ll_sd_from_quaternion(const LLQuaternion& quat);
+LLQuaternion ll_quaternion_from_sd(const LLSD& sd);
+
+// color4
+class LLColor4;
+LLSD ll_sd_from_color4(const LLColor4& c);
+LLColor4 ll_color4_from_sd(const LLSD& sd);
+
+#endif // LL_LLSDUTIL_MATH_H
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt
index 453286b83d..3eceda7901 100644
--- a/indra/llmessage/CMakeLists.txt
+++ b/indra/llmessage/CMakeLists.txt
@@ -23,6 +23,7 @@ include_directories(
set(llmessage_SOURCE_FILES
llares.cpp
+ llareslistener.cpp
llassetstorage.cpp
llblowfishcipher.cpp
llbuffer.cpp
@@ -105,6 +106,7 @@ set(llmessage_HEADER_FILES
CMakeLists.txt
llares.h
+ llareslistener.h
llassetstorage.h
llblowfishcipher.h
llbuffer.h
@@ -224,6 +226,7 @@ IF (NOT LINUX AND VIEWER)
lltemplatemessagedispatcher.cpp
llregionpresenceverifier.cpp
)
+
# set(TEST_DEBUG on)
set(test_libs
${LLMESSAGE_LIBRARIES}
diff --git a/indra/llmessage/llares.cpp b/indra/llmessage/llares.cpp
index fe37fe8142..acbf51d75c 100644
--- a/indra/llmessage/llares.cpp
+++ b/indra/llmessage/llares.cpp
@@ -33,6 +33,7 @@
*/
#include "linden_common.h"
+#include "llares.h"
#include <ares_dns.h>
#include <ares_version.h>
@@ -42,9 +43,10 @@
#include "apr_poll.h"
#include "llapr.h"
-#include "llares.h"
+#include "llareslistener.h"
#if defined(LL_WINDOWS)
+#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
# define ns_c_in 1
# define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
# define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
@@ -102,7 +104,9 @@ void LLAres::QueryResponder::queryError(int code)
}
LLAres::LLAres() :
-chan_(NULL), mInitSuccess(false)
+ chan_(NULL),
+ mInitSuccess(false),
+ mListener(new LLAresListener("LLAres", this))
{
if (ares_init(&chan_) != ARES_SUCCESS)
{
diff --git a/indra/llmessage/llares.h b/indra/llmessage/llares.h
index c709a08499..78febcd560 100644
--- a/indra/llmessage/llares.h
+++ b/indra/llmessage/llares.h
@@ -36,7 +36,13 @@
#define LL_LLARES_H
#ifdef LL_WINDOWS
+// ares.h is broken on windows in that it depends on types defined in ws2tcpip.h
+// we need to include them first to work around it, but the headers issue warnings
+# pragma warning(push)
+# pragma warning(disable:4996)
+# include <winsock2.h>
# include <ws2tcpip.h>
+# pragma warning(pop)
#endif
#ifdef LL_STANDALONE
@@ -49,7 +55,10 @@
#include "llrefcount.h"
#include "lluri.h"
+#include <boost/shared_ptr.hpp>
+
class LLQueryResponder;
+class LLAresListener;
/**
* @brief Supported DNS RR types.
@@ -444,6 +453,9 @@ public:
protected:
ares_channel chan_;
bool mInitSuccess;
+ // boost::scoped_ptr would actually fit the requirement better, but it
+ // can't handle incomplete types as boost::shared_ptr can.
+ boost::shared_ptr<LLAresListener> mListener;
};
/**
diff --git a/indra/llmessage/llareslistener.cpp b/indra/llmessage/llareslistener.cpp
new file mode 100644
index 0000000000..a8beb8cbde
--- /dev/null
+++ b/indra/llmessage/llareslistener.cpp
@@ -0,0 +1,75 @@
+/**
+ * @file llareslistener.cpp
+ * @author Nat Goodspeed
+ * @date 2009-03-18
+ * @brief Implementation for llareslistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "llareslistener.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+#include "llares.h"
+#include "llerror.h"
+#include "llevents.h"
+#include "llsdutil.h"
+
+LLAresListener::LLAresListener(const std::string& pumpname, LLAres* llares):
+ LLDispatchListener(pumpname, "op"),
+ mAres(llares)
+{
+ // add() every method we want to be able to invoke via this event API.
+ // Optional third parameter validates expected LLSD request structure.
+ add("rewriteURI", &LLAresListener::rewriteURI,
+ LLSD().insert("uri", LLSD()).insert("reply", LLSD()));
+}
+
+/// This UriRewriteResponder subclass packages returned URIs as an LLSD
+/// array to send back to the requester.
+class UriRewriteResponder: public LLAres::UriRewriteResponder
+{
+public:
+ /**
+ * Specify the request, containing the event pump name on which to send
+ * the reply.
+ */
+ UriRewriteResponder(const LLSD& request):
+ mReqID(request),
+ mPumpName(request["reply"])
+ {}
+
+ /// Called by base class with results. This is called in both the
+ /// success and error cases. On error, the calling logic passes the
+ /// original URI.
+ virtual void rewriteResult(const std::vector<std::string>& uris)
+ {
+ LLSD result;
+ for (std::vector<std::string>::const_iterator ui(uris.begin()), uend(uris.end());
+ ui != uend; ++ui)
+ {
+ result.append(*ui);
+ }
+ // This call knows enough to avoid trying to insert a map key into an
+ // LLSD array. It's there so that if, for any reason, we ever decide
+ // to change the response from array to map, it will Just Start Working.
+ mReqID.stamp(result);
+ LLEventPumps::instance().obtain(mPumpName).post(result);
+ }
+
+private:
+ LLReqID mReqID;
+ const std::string mPumpName;
+};
+
+void LLAresListener::rewriteURI(const LLSD& data)
+{
+ mAres->rewriteURI(data["uri"], new UriRewriteResponder(data));
+}
diff --git a/indra/llmessage/llareslistener.h b/indra/llmessage/llareslistener.h
new file mode 100644
index 0000000000..bf093b3d3d
--- /dev/null
+++ b/indra/llmessage/llareslistener.h
@@ -0,0 +1,37 @@
+/**
+ * @file llareslistener.h
+ * @author Nat Goodspeed
+ * @date 2009-03-18
+ * @brief LLEventPump API for LLAres. This header doesn't actually define the
+ * API; the API is defined by the pump name on which this class
+ * listens, and by the expected content of LLSD it receives.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLARESLISTENER_H)
+#define LL_LLARESLISTENER_H
+
+#include "lleventdispatcher.h"
+
+class LLAres;
+class LLSD;
+
+/// Listen on an LLEventPump with specified name for LLAres request events.
+class LLAresListener: public LLDispatchListener
+{
+public:
+ /// Specify the pump name on which to listen, and bind the LLAres instance
+ /// to use (e.g. gAres)
+ LLAresListener(const std::string& pumpname, LLAres* llares);
+
+private:
+ /// command["op"] == "rewriteURI"
+ void rewriteURI(const LLSD& data);
+
+ LLAres* mAres;
+};
+
+#endif /* ! defined(LL_LLARESLISTENER_H) */
diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h
index c044b3d80d..8641437d86 100644
--- a/indra/llmessage/llcachename.h
+++ b/indra/llmessage/llcachename.h
@@ -42,9 +42,9 @@ class LLUUID;
typedef boost::signals2::signal<void (const LLUUID& id,
- const std::string& first_name,
- const std::string& last_name,
- BOOL is_group)> LLCacheNameSignal;
+ const std::string& first_name,
+ const std::string& last_name,
+ BOOL is_group)> LLCacheNameSignal;
typedef LLCacheNameSignal::slot_type LLCacheNameCallback;
// Old callback with user data for compatability
diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp
index 7c63625004..3da41939fa 100644
--- a/indra/llmessage/llinstantmessage.cpp
+++ b/indra/llmessage/llinstantmessage.cpp
@@ -40,7 +40,7 @@
#include "lluuid.h"
#include "llsd.h"
#include "llsdserialize.h"
-#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "llpointer.h"
#include "message.h"
diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp
index 485bc6aa44..9376cde7b5 100644
--- a/indra/llmessage/llpartdata.cpp
+++ b/indra/llmessage/llpartdata.cpp
@@ -39,6 +39,8 @@
#include "v4coloru.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
+
const S32 PS_PART_DATA_BLOCK_SIZE = 4 + 2 + 4 + 4 + 2 + 2; // 18
diff --git a/indra/llmessage/llregionpresenceverifier.cpp b/indra/llmessage/llregionpresenceverifier.cpp
index e02c735ce7..b1868e6a00 100644
--- a/indra/llmessage/llregionpresenceverifier.cpp
+++ b/indra/llmessage/llregionpresenceverifier.cpp
@@ -30,6 +30,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "llregionpresenceverifier.h"
#include "llhttpclientinterface.h"
#include <sstream>
diff --git a/indra/llmessage/llsdmessage.cpp b/indra/llmessage/llsdmessage.cpp
index 9967a6197f..2cb742e261 100644
--- a/indra/llmessage/llsdmessage.cpp
+++ b/indra/llmessage/llsdmessage.cpp
@@ -68,6 +68,7 @@ bool LLSDMessage::httpListener(const LLSD& request)
}
LLHTTPClient::post(url, payload,
new LLSDMessage::EventResponder(LLEventPumps::instance(),
+ request,
url, "POST", reply, error),
LLSD(), // headers
timeout);
@@ -81,7 +82,9 @@ void LLSDMessage::EventResponder::result(const LLSD& data)
// to the pump whose name is "".
if (! mReplyPump.empty())
{
- mPumps.obtain(mReplyPump).post(data);
+ LLSD response(data);
+ mReqID.stamp(response);
+ mPumps.obtain(mReplyPump).post(response);
}
else // default success handling
{
@@ -98,7 +101,7 @@ void LLSDMessage::EventResponder::errorWithContent(U32 status, const std::string
// explicit pump name.
if (! mErrorPump.empty())
{
- LLSD info;
+ LLSD info(mReqID.makeResponse());
info["target"] = mTarget;
info["message"] = mMessage;
info["status"] = LLSD::Integer(status);
diff --git a/indra/llmessage/llsdmessage.h b/indra/llmessage/llsdmessage.h
index 65503756a8..6ee00fd41d 100644
--- a/indra/llmessage/llsdmessage.h
+++ b/indra/llmessage/llsdmessage.h
@@ -121,9 +121,11 @@ private:
* (e.g. "POST") as @a message.
*/
EventResponder(LLEventPumps& pumps,
+ const LLSD& request,
const std::string& target, const std::string& message,
const std::string& replyPump, const std::string& errorPump):
mPumps(pumps),
+ mReqID(request),
mTarget(target),
mMessage(message),
mReplyPump(replyPump),
@@ -135,6 +137,7 @@ private:
private:
LLEventPumps& mPumps;
+ LLReqID mReqID;
const std::string mTarget, mMessage, mReplyPump, mErrorPump;
};
diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp
index 21937f022f..6e41b03895 100755
--- a/indra/llmessage/llsdmessagebuilder.cpp
+++ b/indra/llmessage/llsdmessagebuilder.cpp
@@ -37,6 +37,7 @@
#include "llmessagetemplate.h"
#include "llquaternion.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "llsdserialize.h"
#include "u64.h"
#include "v3dmath.h"
diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index e699ec9e28..845a12d23b 100755
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -38,6 +38,7 @@
#include "llsdmessagebuilder.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "v3math.h"
#include "v4math.h"
#include "v3dmath.h"
diff --git a/indra/llmessage/tests/llareslistener_test.cpp b/indra/llmessage/tests/llareslistener_test.cpp
new file mode 100644
index 0000000000..ac4886ccf4
--- /dev/null
+++ b/indra/llmessage/tests/llareslistener_test.cpp
@@ -0,0 +1,200 @@
+/**
+ * @file llareslistener_test.cpp
+ * @author Mark Palange
+ * @date 2009-02-26
+ * @brief Tests of llareslistener.h.
+ *
+ * $LicenseInfo:firstyear=2009&license=internal$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if LL_WINDOWS
+#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
+#endif
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "../llareslistener.h"
+// STL headers
+#include <iostream>
+// std headers
+// external library headers
+#include <boost/bind.hpp>
+
+// other Linden headers
+#include "llsd.h"
+#include "llares.h"
+#include "../test/lltut.h"
+#include "llevents.h"
+#include "tests/wrapllerrs.h"
+
+/*****************************************************************************
+* Dummy stuff
+*****************************************************************************/
+LLAres::LLAres():
+ // Simulate this much of the real LLAres constructor: we need an
+ // LLAresListener instance.
+ mListener(new LLAresListener("LLAres", this))
+{}
+LLAres::~LLAres() {}
+void LLAres::rewriteURI(const std::string &uri,
+ LLAres::UriRewriteResponder *resp)
+{
+ // This is the only LLAres method I chose to implement.
+ // The effect is that LLAres returns immediately with
+ // a result that is equal to the input uri.
+ std::vector<std::string> result;
+ result.push_back(uri);
+ resp->rewriteResult(result);
+}
+
+LLAres::QueryResponder::~QueryResponder() {}
+void LLAres::QueryResponder::queryError(int) {}
+void LLAres::QueryResponder::queryResult(char const*, size_t) {}
+LLQueryResponder::LLQueryResponder() {}
+void LLQueryResponder::queryResult(char const*, size_t) {}
+void LLQueryResponder::querySuccess() {}
+void LLAres::UriRewriteResponder::queryError(int) {}
+void LLAres::UriRewriteResponder::querySuccess() {}
+void LLAres::UriRewriteResponder::rewriteResult(const std::vector<std::string>& uris) {}
+
+/*****************************************************************************
+* TUT
+*****************************************************************************/
+namespace tut
+{
+ struct data
+ {
+ LLAres dummyAres;
+ };
+ typedef test_group<data> llareslistener_group;
+ typedef llareslistener_group::object object;
+ llareslistener_group llareslistenergrp("llareslistener");
+
+ struct ResponseCallback
+ {
+ std::vector<std::string> mURIs;
+ bool operator()(const LLSD& response)
+ {
+ mURIs.clear();
+ for (LLSD::array_const_iterator ri(response.beginArray()), rend(response.endArray());
+ ri != rend; ++ri)
+ {
+ mURIs.push_back(*ri);
+ }
+ return false;
+ }
+ };
+
+ template<> template<>
+ void object::test<1>()
+ {
+ set_test_name("test event");
+ // Tests the success and failure cases, since they both use
+ // the same code paths in the LLAres responder.
+ ResponseCallback response;
+ std::string pumpname("trigger");
+ // Since we're asking LLEventPumps to obtain() the pump by the desired
+ // name, it will persist beyond the current scope, so ensure we
+ // disconnect from it when 'response' goes away.
+ LLTempBoundListener temp(
+ LLEventPumps::instance().obtain(pumpname).listen("rewriteURIresponse",
+ boost::bind(&ResponseCallback::operator(), &response, _1)));
+ // Now build an LLSD request that will direct its response events to
+ // that pump.
+ const std::string testURI("login.bar.com");
+ LLSD request;
+ request["op"] = "rewriteURI";
+ request["uri"] = testURI;
+ request["reply"] = pumpname;
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ ensure_equals(response.mURIs.size(), 1);
+ ensure_equals(response.mURIs.front(), testURI);
+ }
+
+ template<> template<>
+ void object::test<2>()
+ {
+ set_test_name("bad op");
+ WrapLL_ERRS capture;
+ LLSD request;
+ request["op"] = "foo";
+ std::string threw;
+ try
+ {
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ threw = e.what();
+ }
+ ensure_contains("LLAresListener bad op", threw, "bad");
+ }
+
+ template<> template<>
+ void object::test<3>()
+ {
+ set_test_name("bad rewriteURI request");
+ WrapLL_ERRS capture;
+ LLSD request;
+ request["op"] = "rewriteURI";
+ std::string threw;
+ try
+ {
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ threw = e.what();
+ }
+ ensure_contains("LLAresListener bad req", threw, "missing");
+ ensure_contains("LLAresListener bad req", threw, "reply");
+ ensure_contains("LLAresListener bad req", threw, "uri");
+ }
+
+ template<> template<>
+ void object::test<4>()
+ {
+ set_test_name("bad rewriteURI request");
+ WrapLL_ERRS capture;
+ LLSD request;
+ request["op"] = "rewriteURI";
+ request["reply"] = "nonexistent";
+ std::string threw;
+ try
+ {
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ threw = e.what();
+ }
+ ensure_contains("LLAresListener bad req", threw, "missing");
+ ensure_contains("LLAresListener bad req", threw, "uri");
+ ensure_does_not_contain("LLAresListener bad req", threw, "reply");
+ }
+
+ template<> template<>
+ void object::test<5>()
+ {
+ set_test_name("bad rewriteURI request");
+ WrapLL_ERRS capture;
+ LLSD request;
+ request["op"] = "rewriteURI";
+ request["uri"] = "foo.bar.com";
+ std::string threw;
+ try
+ {
+ LLEventPumps::instance().obtain("LLAres").post(request);
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ threw = e.what();
+ }
+ ensure_contains("LLAresListener bad req", threw, "missing");
+ ensure_contains("LLAresListener bad req", threw, "reply");
+ ensure_does_not_contain("LLAresListener bad req", threw, "uri");
+ }
+}
diff --git a/indra/llmessage/tests/llregionpresenceverifier_test.cpp b/indra/llmessage/tests/llregionpresenceverifier_test.cpp
index b7602ef15c..c86126406e 100644
--- a/indra/llmessage/tests/llregionpresenceverifier_test.cpp
+++ b/indra/llmessage/tests/llregionpresenceverifier_test.cpp
@@ -29,6 +29,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "../test/lltut.h"
#include "llregionpresenceverifier.h"
#include "llcurl_stub.cpp"
diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py
index e62f20912b..86d5761b1b 100644
--- a/indra/llmessage/tests/test_llsdmessage_peer.py
+++ b/indra/llmessage/tests/test_llsdmessage_peer.py
@@ -16,16 +16,12 @@ import os
import sys
from threading import Thread
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
+
mydir = os.path.dirname(__file__) # expected to be .../indra/llmessage/tests/
sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "lib", "python"))
from indra.util.fastest_elementtree import parse as xml_parse
from indra.base import llsd
-
-def debug(*args):
- sys.stdout.writelines(args)
- sys.stdout.flush()
-# comment out the line below to enable debug output
-debug = lambda *args: None
+from testrunner import run, debug
class TestHTTPRequestHandler(BaseHTTPRequestHandler):
"""This subclass of BaseHTTPRequestHandler is to receive and echo
@@ -106,25 +102,5 @@ class TestHTTPServer(Thread):
debug("Starting HTTP server...\n")
httpd.serve_forever()
-def main(*args):
- # Start HTTP server thread. Note that this and all other comm server
- # threads should be daemon threads: we'll let them run "forever,"
- # confident that the whole process will terminate when the main thread
- # terminates, which will be when the test executable child process
- # terminates.
- httpThread = TestHTTPServer(name="httpd")
- httpThread.setDaemon(True)
- httpThread.start()
- # choice of os.spawnv():
- # - [v vs. l] pass a list of args vs. individual arguments,
- # - [no p] don't use the PATH because we specifically want to invoke the
- # executable passed as our first arg,
- # - [no e] child should inherit this process's environment.
- debug("Running %s...\n" % (" ".join(args)))
- sys.stdout.flush()
- rc = os.spawnv(os.P_WAIT, args[0], args)
- debug("%s returned %s\n" % (args[0], rc))
- return rc
-
if __name__ == "__main__":
- sys.exit(main(*sys.argv[1:]))
+ sys.exit(run(server=TestHTTPServer(name="httpd"), *sys.argv[1:]))
diff --git a/indra/llmessage/tests/testrunner.py b/indra/llmessage/tests/testrunner.py
new file mode 100644
index 0000000000..3b9c3a7a19
--- /dev/null
+++ b/indra/llmessage/tests/testrunner.py
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+"""\
+@file testrunner.py
+@author Nat Goodspeed
+@date 2009-03-20
+@brief Utilities for writing wrapper scripts for ADD_COMM_BUILD_TEST unit tests
+
+$LicenseInfo:firstyear=2009&license=viewergpl$
+Copyright (c) 2009, Linden Research, Inc.
+$/LicenseInfo$
+"""
+
+import os
+import sys
+
+def debug(*args):
+ sys.stdout.writelines(args)
+ sys.stdout.flush()
+# comment out the line below to enable debug output
+debug = lambda *args: None
+
+def run(*args, **kwds):
+ """All positional arguments collectively form a command line, executed as
+ a synchronous child process.
+ In addition, pass server=new_thread_instance as an explicit keyword (to
+ differentiate it from an additional command-line argument).
+ new_thread_instance should be an instantiated but not yet started Thread
+ subclass instance, e.g.:
+ run("python", "-c", 'print "Hello, world!"', server=TestHTTPServer(name="httpd"))
+ """
+ # If there's no server= keyword arg, don't start a server thread: simply
+ # run a child process.
+ try:
+ thread = kwds.pop("server")
+ except KeyError:
+ pass
+ else:
+ # Start server thread. Note that this and all other comm server
+ # threads should be daemon threads: we'll let them run "forever,"
+ # confident that the whole process will terminate when the main thread
+ # terminates, which will be when the child process terminates.
+ thread.setDaemon(True)
+ thread.start()
+ # choice of os.spawnv():
+ # - [v vs. l] pass a list of args vs. individual arguments,
+ # - [no p] don't use the PATH because we specifically want to invoke the
+ # executable passed as our first arg,
+ # - [no e] child should inherit this process's environment.
+ debug("Running %s...\n" % (" ".join(args)))
+ sys.stdout.flush()
+ rc = os.spawnv(os.P_WAIT, args[0], args)
+ debug("%s returned %s\n" % (args[0], rc))
+ return rc
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index dcfb5cfae6..9d84d3706b 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -43,7 +43,7 @@
#include "llvolumemgr.h"
#include "llstring.h"
#include "lldatapacker.h"
-#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "llprimtexturelist.h"
/**
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 3bcd831142..2736d54cc8 100644
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -33,7 +33,7 @@
#include "linden_common.h"
#include "lltextureentry.h"
-#include "llsdutil.h"
+#include "llsdutil_math.h"
const U8 DEFAULT_BUMP_CODE = 0; // no bump or shininess
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 7e1df0e565..69675e322a 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -590,8 +590,6 @@ void LLGLManager::shutdownGL()
// these are used to turn software blending on. They appear in the Debug/Avatar menu
// presence of vertex skinning/blending or vertex programs will set these to FALSE by default.
-extern LLCPUInfo gSysCPU;
-
void LLGLManager::initExtensions()
{
#if LL_MESA_HEADLESS
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index fce6b759a4..65ccb655dd 100644
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -1,222 +1,226 @@
-# -*- cmake -*-
-
-project(llui)
-
-include(00-Common)
-include(LLCommon)
-include(LLImage)
-include(LLMath)
-include(LLMessage)
-include(LLRender)
-include(LLWindow)
-include(LLVFS)
-include(LLXML)
-include(LLXUIXML)
-
-include_directories(
- ${LLCOMMON_INCLUDE_DIRS}
- ${LLIMAGE_INCLUDE_DIRS}
- ${LLMATH_INCLUDE_DIRS}
- ${LLMESSAGE_INCLUDE_DIRS}
- ${LLRENDER_INCLUDE_DIRS}
- ${LLWINDOW_INCLUDE_DIRS}
- ${LLVFS_INCLUDE_DIRS}
- ${LLXML_INCLUDE_DIRS}
- ${LLXUIXML_INCLUDE_DIRS}
- )
-
-set(llui_SOURCE_FILES
- llalertdialog.cpp
- llbutton.cpp
- llcheckboxctrl.cpp
- llclipboard.cpp
- llcombobox.cpp
- llconsole.cpp
- llcontainerview.cpp
- llctrlselectioninterface.cpp
- lldockablefloater.cpp
- lldockcontrol.cpp
- lldraghandle.cpp
- lleditmenuhandler.cpp
- llf32uictrl.cpp
- llfiltereditor.cpp
- llflatlistview.cpp
- llfloater.cpp
- llfloaterreg.cpp
- llflyoutbutton.cpp
- llfocusmgr.cpp
- llfunctorregistry.cpp
- lliconctrl.cpp
- llkeywords.cpp
- lllayoutstack.cpp
- lllineeditor.cpp
- lllistctrl.cpp
- lllocalcliprect.cpp
- llmenugl.cpp
- llmodaldialog.cpp
- llmultifloater.cpp
- llmultislider.cpp
- llmultisliderctrl.cpp
- llnotifications.cpp
- llpanel.cpp
- llprogressbar.cpp
- llradiogroup.cpp
- llresizebar.cpp
- llresizehandle.cpp
- llresmgr.cpp
- llrngwriter.cpp
- llscrollbar.cpp
- llscrollcontainer.cpp
- llscrollingpanellist.cpp
- llscrolllistcell.cpp
- llscrolllistcolumn.cpp
- llscrolllistctrl.cpp
- llscrolllistitem.cpp
- llsdparam.cpp
- llsearcheditor.cpp
- llslider.cpp
- llsliderctrl.cpp
- llspinctrl.cpp
- llstatbar.cpp
- llstatgraph.cpp
- llstatview.cpp
- llstyle.cpp
- lltabcontainer.cpp
- lltextbase.cpp
- lltextbox.cpp
- lltexteditor.cpp
- lltextparser.cpp
- lltransutil.cpp
- lltooltip.cpp
- llui.cpp
- lluicolortable.cpp
- lluictrl.cpp
- lluictrlfactory.cpp
- lluiimage.cpp
- lluistring.cpp
- llundo.cpp
- llurlaction.cpp
- llurlentry.cpp
- llurlmatch.cpp
- llurlregistry.cpp
- llviewborder.cpp
- llviewmodel.cpp
- llview.cpp
- llviewquery.cpp
- )
-
-set(llui_HEADER_FILES
- CMakeLists.txt
-
- llalertdialog.h
- llbutton.h
- llcallbackmap.h
- llcheckboxctrl.h
- llclipboard.h
- llcombobox.h
- llconsole.h
- llcontainerview.h
- llctrlselectioninterface.h
- lldraghandle.h
- lldockablefloater.h
- lldockcontrol.h
- lleditmenuhandler.h
- llf32uictrl.h
- llfiltereditor.h
- llflatlistview.h
- llfloater.h
- llfloaterreg.h
- llflyoutbutton.h
- llfocusmgr.h
- llfunctorregistry.h
- llhandle.h
- llhtmlhelp.h
- lliconctrl.h
- llkeywords.h
- lllayoutstack.h
- lllazyvalue.h
- lllineeditor.h
- lllistctrl.h
- lllocalcliprect.h
- llmenugl.h
- llmodaldialog.h
- llmultifloater.h
- llmultisliderctrl.h
- llmultislider.h
- llnotifications.h
- llpanel.h
- llprogressbar.h
- llradiogroup.h
- llresizebar.h
- llresizehandle.h
- llresmgr.h
- llrngwriter.h
- llsearcheditor.h
- llscrollbar.h
- llscrollcontainer.h
- llscrollingpanellist.h
- llscrolllistcell.h
- llscrolllistcolumn.h
- llscrolllistctrl.h
- llscrolllistitem.h
- llsdparam.h
- llsliderctrl.h
- llslider.h
- llspinctrl.h
- llstatbar.h
- llstatgraph.h
- llstatview.h
- llstyle.h
- lltabcontainer.h
- lltextbase.h
- lltextbox.h
- lltexteditor.h
- lltextparser.h
- lltooltip.h
- lltransutil.h
- lluicolortable.h
- lluiconstants.h
- lluictrlfactory.h
- lluictrl.h
- lluifwd.h
- llui.h
- lluiimage.h
- lluistring.h
- llundo.h
- llurlaction.h
- llurlentry.h
- llurlmatch.h
- llurlregistry.h
- llviewborder.h
- llviewmodel.h
- llview.h
- llviewquery.h
- )
-
-set_source_files_properties(${llui_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
-
-list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES})
-
-add_library (llui ${llui_SOURCE_FILES})
-# Libraries on which this library depends, needed for Linux builds
-# Sort by high-level to low-level
-target_link_libraries(llui
- ${LLMESSAGE_LIBRARIES}
- ${LLRENDER_LIBRARIES}
- ${LLWINDOW_LIBRARIES}
- ${LLIMAGE_LIBRARIES}
- ${LLVFS_LIBRARIES} # ugh, just for LLDir
- ${LLXUIXML_LIBRARIES}
- ${LLXML_LIBRARIES}
- ${LLMATH_LIBRARIES}
- ${LLCOMMON_LIBRARIES} # must be after llimage, llwindow, llrender
- )
-
-# Add tests
-include(LLAddBuildTest)
-SET(llui_TEST_SOURCE_FILES
- llurlmatch.cpp
- llurlentry.cpp
- )
-LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}")
+# -*- cmake -*-
+
+project(llui)
+
+include(00-Common)
+include(LLCommon)
+include(LLImage)
+include(LLMath)
+include(LLMessage)
+include(LLRender)
+include(LLWindow)
+include(LLVFS)
+include(LLXML)
+include(LLXUIXML)
+
+include_directories(
+ ${LLCOMMON_INCLUDE_DIRS}
+ ${LLIMAGE_INCLUDE_DIRS}
+ ${LLMATH_INCLUDE_DIRS}
+ ${LLMESSAGE_INCLUDE_DIRS}
+ ${LLRENDER_INCLUDE_DIRS}
+ ${LLWINDOW_INCLUDE_DIRS}
+ ${LLVFS_INCLUDE_DIRS}
+ ${LLXML_INCLUDE_DIRS}
+ ${LLXUIXML_INCLUDE_DIRS}
+ )
+
+set(llui_SOURCE_FILES
+ llalertdialog.cpp
+ llbutton.cpp
+ llcheckboxctrl.cpp
+ llclipboard.cpp
+ llcombobox.cpp
+ llconsole.cpp
+ llcontainerview.cpp
+ llctrlselectioninterface.cpp
+ lldockablefloater.cpp
+ lldockcontrol.cpp
+ lldraghandle.cpp
+ lleditmenuhandler.cpp
+ llf32uictrl.cpp
+ llfiltereditor.cpp
+ llflatlistview.cpp
+ llfloater.cpp
+ llfloaterreg.cpp
+ llfloaterreglistener.cpp
+ llflyoutbutton.cpp
+ llfocusmgr.cpp
+ llfunctorregistry.cpp
+ lliconctrl.cpp
+ llkeywords.cpp
+ lllayoutstack.cpp
+ lllineeditor.cpp
+ lllistctrl.cpp
+ lllocalcliprect.cpp
+ llmenugl.cpp
+ llmodaldialog.cpp
+ llmultifloater.cpp
+ llmultislider.cpp
+ llmultisliderctrl.cpp
+ llnotifications.cpp
+ llnotificationslistener.cpp
+ llpanel.cpp
+ llprogressbar.cpp
+ llradiogroup.cpp
+ llresizebar.cpp
+ llresizehandle.cpp
+ llresmgr.cpp
+ llrngwriter.cpp
+ llscrollbar.cpp
+ llscrollcontainer.cpp
+ llscrollingpanellist.cpp
+ llscrolllistcell.cpp
+ llscrolllistcolumn.cpp
+ llscrolllistctrl.cpp
+ llscrolllistitem.cpp
+ llsdparam.cpp
+ llsearcheditor.cpp
+ llslider.cpp
+ llsliderctrl.cpp
+ llspinctrl.cpp
+ llstatbar.cpp
+ llstatgraph.cpp
+ llstatview.cpp
+ llstyle.cpp
+ lltabcontainer.cpp
+ lltextbase.cpp
+ lltextbox.cpp
+ lltexteditor.cpp
+ lltextparser.cpp
+ lltransutil.cpp
+ lltooltip.cpp
+ llui.cpp
+ lluicolortable.cpp
+ lluictrl.cpp
+ lluictrlfactory.cpp
+ lluiimage.cpp
+ lluistring.cpp
+ llundo.cpp
+ llurlaction.cpp
+ llurlentry.cpp
+ llurlmatch.cpp
+ llurlregistry.cpp
+ llviewborder.cpp
+ llviewmodel.cpp
+ llview.cpp
+ llviewquery.cpp
+ )
+
+set(llui_HEADER_FILES
+ CMakeLists.txt
+
+ llalertdialog.h
+ llbutton.h
+ llcallbackmap.h
+ llcheckboxctrl.h
+ llclipboard.h
+ llcombobox.h
+ llconsole.h
+ llcontainerview.h
+ llctrlselectioninterface.h
+ lldraghandle.h
+ lldockablefloater.h
+ lldockcontrol.h
+ lleditmenuhandler.h
+ llf32uictrl.h
+ llfiltereditor.h
+ llflatlistview.h
+ llfloater.h
+ llfloaterreg.h
+ llfloaterreglistener.h
+ llflyoutbutton.h
+ llfocusmgr.h
+ llfunctorregistry.h
+ llhandle.h
+ llhtmlhelp.h
+ lliconctrl.h
+ llkeywords.h
+ lllayoutstack.h
+ lllazyvalue.h
+ lllineeditor.h
+ lllistctrl.h
+ lllocalcliprect.h
+ llmenugl.h
+ llmodaldialog.h
+ llmultifloater.h
+ llmultisliderctrl.h
+ llmultislider.h
+ llnotifications.h
+ llnotificationslistener.h
+ llpanel.h
+ llprogressbar.h
+ llradiogroup.h
+ llresizebar.h
+ llresizehandle.h
+ llresmgr.h
+ llrngwriter.h
+ llsearcheditor.h
+ llscrollbar.h
+ llscrollcontainer.h
+ llscrollingpanellist.h
+ llscrolllistcell.h
+ llscrolllistcolumn.h
+ llscrolllistctrl.h
+ llscrolllistitem.h
+ llsdparam.h
+ llsliderctrl.h
+ llslider.h
+ llspinctrl.h
+ llstatbar.h
+ llstatgraph.h
+ llstatview.h
+ llstyle.h
+ lltabcontainer.h
+ lltextbase.h
+ lltextbox.h
+ lltexteditor.h
+ lltextparser.h
+ lltooltip.h
+ lltransutil.h
+ lluicolortable.h
+ lluiconstants.h
+ lluictrlfactory.h
+ lluictrl.h
+ lluifwd.h
+ llui.h
+ lluiimage.h
+ lluistring.h
+ llundo.h
+ llurlaction.h
+ llurlentry.h
+ llurlmatch.h
+ llurlregistry.h
+ llviewborder.h
+ llviewmodel.h
+ llview.h
+ llviewquery.h
+ )
+
+set_source_files_properties(${llui_HEADER_FILES}
+ PROPERTIES HEADER_FILE_ONLY TRUE)
+
+list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES})
+
+add_library (llui ${llui_SOURCE_FILES})
+# Libraries on which this library depends, needed for Linux builds
+# Sort by high-level to low-level
+target_link_libraries(llui
+ ${LLMESSAGE_LIBRARIES}
+ ${LLRENDER_LIBRARIES}
+ ${LLWINDOW_LIBRARIES}
+ ${LLIMAGE_LIBRARIES}
+ ${LLVFS_LIBRARIES} # ugh, just for LLDir
+ ${LLXUIXML_LIBRARIES}
+ ${LLXML_LIBRARIES}
+ ${LLMATH_LIBRARIES}
+ ${LLCOMMON_LIBRARIES} # must be after llimage, llwindow, llrender
+ )
+
+# Add tests
+include(LLAddBuildTest)
+SET(llui_TEST_SOURCE_FILES
+ llurlmatch.cpp
+ llurlentry.cpp
+ )
+LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}")
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 228e23b67e..4690c54c15 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -60,6 +60,7 @@
#include "v2math.h"
#include "lltrans.h"
#include "llmultifloater.h"
+#include "llsdutil.h"
// use this to control "jumping" behavior when Ctrl-Tabbing
const S32 TABBED_FLOATER_OFFSET = 0;
@@ -145,6 +146,16 @@ LLFloater::handle_map_t LLFloater::sFloaterMap;
LLFloaterView* gFloaterView = NULL;
+/*==========================================================================*|
+// DEV-38598: The fundamental problem with this operation is that it can only
+// support a subset of LLSD values. While it's plausible to compare two arrays
+// lexicographically, what strict ordering can you impose on maps?
+// (LLFloaterTOS's current key is an LLSD map.)
+
+// Of course something like this is necessary if you want to build a std::set
+// or std::map with LLSD keys. Fortunately we're getting by with other
+// container types for now.
+
//static
bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b)
{
@@ -172,32 +183,11 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b)
else
return false; // no valid operation for Binary
}
+|*==========================================================================*/
bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b)
{
- if (a.type() != b.type())
- {
- //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl;
- return false;
- }
- else if (a.isUndefined())
- return true;
- else if (a.isInteger())
- return a.asInteger() == b.asInteger();
- else if (a.isReal())
- return a.asReal() == b.asReal();
- else if (a.isString())
- return a.asString() == b.asString();
- else if (a.isUUID())
- return a.asUUID() == b.asUUID();
- else if (a.isDate())
- return a.asDate() == b.asDate();
- else if (a.isURI())
- return a.asString() == b.asString(); // compare URIs as strings
- else if (a.isBoolean())
- return a.asBoolean() == b.asBoolean();
- else
- return false; // no valid operation for Binary
+ return llsd_equals(a, b);
}
//************************************
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 513f6a6918..6208d52135 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -87,12 +87,14 @@ friend class LLMultiFloater;
public:
struct KeyCompare
{
- static bool compare(const LLSD& a, const LLSD& b);
+// static bool compare(const LLSD& a, const LLSD& b);
static bool equate(const LLSD& a, const LLSD& b);
+/*==========================================================================*|
bool operator()(const LLSD& a, const LLSD& b) const
{
return compare(a, b);
}
+|*==========================================================================*/
};
enum EFloaterButtons
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index a63b1b085c..8617ba940e 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -36,6 +36,7 @@
#include "llfloater.h"
#include "llmultifloater.h"
+#include "llfloaterreglistener.h"
//*******************************************************
@@ -45,6 +46,8 @@ LLFloaterReg::instance_map_t LLFloaterReg::sInstanceMap;
LLFloaterReg::build_map_t LLFloaterReg::sBuildMap;
std::map<std::string,std::string> LLFloaterReg::sGroupMap;
+static LLFloaterRegListener sFloaterRegListener("LLFloaterReg");
+
//*******************************************************
//static
diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h
index 7edac43c96..451bd1dbe3 100644
--- a/indra/llui/llfloaterreg.h
+++ b/indra/llui/llfloaterreg.h
@@ -70,6 +70,7 @@ public:
typedef std::map<std::string, BuildData> build_map_t;
private:
+ friend class LLFloaterRegListener;
static instance_list_t sNullInstanceList;
static instance_map_t sInstanceMap;
static build_map_t sBuildMap;
diff --git a/indra/llui/llfloaterreglistener.cpp b/indra/llui/llfloaterreglistener.cpp
new file mode 100644
index 0000000000..cb8fa6dfda
--- /dev/null
+++ b/indra/llui/llfloaterreglistener.cpp
@@ -0,0 +1,66 @@
+/**
+ * @file llfloaterreglistener.cpp
+ * @author Nat Goodspeed
+ * @date 2009-08-12
+ * @brief Implementation for llfloaterreglistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "llfloaterreglistener.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+#include "llfloaterreg.h"
+
+LLFloaterRegListener::LLFloaterRegListener(const std::string& pumpName):
+ LLDispatchListener(pumpName, "op")
+{
+ add("getBuildMap", &LLFloaterRegListener::getBuildMap, LLSD().insert("reply", LLSD()));
+ LLSD requiredName;
+ requiredName["name"] = LLSD();
+ add("showInstance", &LLFloaterRegListener::showInstance, requiredName);
+ add("hideInstance", &LLFloaterRegListener::hideInstance, requiredName);
+ add("toggleInstance", &LLFloaterRegListener::toggleInstance, requiredName);
+}
+
+void LLFloaterRegListener::getBuildMap(const LLSD& event) const
+{
+ // Honor the "reqid" convention by echoing event["reqid"] in our reply packet.
+ LLReqID reqID(event);
+ LLSD reply(reqID.makeResponse());
+ // Build an LLSD map that mirrors sBuildMap. Since we have no good way to
+ // represent a C++ callable in LLSD, the only part of BuildData we can
+ // store is the filename. For each LLSD map entry, it would be more
+ // extensible to store a nested LLSD map containing a single key "file" --
+ // but we don't bother, simply storing the string filename instead.
+ for (LLFloaterReg::build_map_t::const_iterator mi(LLFloaterReg::sBuildMap.begin()),
+ mend(LLFloaterReg::sBuildMap.end());
+ mi != mend; ++mi)
+ {
+ reply[mi->first] = mi->second.mFile;
+ }
+ // Send the reply to the LLEventPump named in event["reply"].
+ LLEventPumps::instance().obtain(event["reply"]).post(reply);
+}
+
+void LLFloaterRegListener::showInstance(const LLSD& event) const
+{
+ LLFloaterReg::showInstance(event["name"], event["key"], event["focus"]);
+}
+
+void LLFloaterRegListener::hideInstance(const LLSD& event) const
+{
+ LLFloaterReg::hideInstance(event["name"], event["key"]);
+}
+
+void LLFloaterRegListener::toggleInstance(const LLSD& event) const
+{
+ LLFloaterReg::toggleInstance(event["name"], event["key"]);
+}
diff --git a/indra/llui/llfloaterreglistener.h b/indra/llui/llfloaterreglistener.h
new file mode 100644
index 0000000000..58d2c07936
--- /dev/null
+++ b/indra/llui/llfloaterreglistener.h
@@ -0,0 +1,35 @@
+/**
+ * @file llfloaterreglistener.h
+ * @author Nat Goodspeed
+ * @date 2009-08-12
+ * @brief Wrap (subset of) LLFloaterReg API with an event API
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLFLOATERREGLISTENER_H)
+#define LL_LLFLOATERREGLISTENER_H
+
+#include "lleventdispatcher.h"
+#include <string>
+
+class LLSD;
+
+/// Event API wrapper for LLFloaterReg
+class LLFloaterRegListener: public LLDispatchListener
+{
+public:
+ /// As all public LLFloaterReg methods are static, there's no point in
+ /// binding an LLFloaterReg instance.
+ LLFloaterRegListener(const std::string& pumpName);
+
+private:
+ void getBuildMap(const LLSD& event) const;
+ void showInstance(const LLSD& event) const;
+ void hideInstance(const LLSD& event) const;
+ void toggleInstance(const LLSD& event) const;
+};
+
+#endif /* ! defined(LL_LLFLOATERREGLISTENER_H) */
diff --git a/indra/llui/llfunctorregistry.cpp b/indra/llui/llfunctorregistry.cpp
index 0c5b1655b1..5f9644f258 100644
--- a/indra/llui/llfunctorregistry.cpp
+++ b/indra/llui/llfunctorregistry.cpp
@@ -31,6 +31,7 @@
* $/LicenseInfo$
**/
+#include "linden_common.h"
#include "llfunctorregistry.h"
// This is a default functor always resident in the system.
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 9845b7e2ce..2b4aad5e83 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1,1513 +1,1516 @@
-/**
-* @file llnotifications.cpp
-* @brief Non-UI queue manager for keeping a prioritized list of notifications
-*
-* $LicenseInfo:firstyear=2008&license=viewergpl$
-*
-* Copyright (c) 2008-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llnotifications.h"
-
-#include "lluictrl.h"
-#include "lluictrlfactory.h"
-#include "lldir.h"
-#include "llsdserialize.h"
-#include "lltrans.h"
-
-#include <algorithm>
-#include <boost/regex.hpp>
-
-
-const std::string NOTIFICATION_PERSIST_VERSION = "0.93";
-
-// local channel for notification history
-class LLNotificationHistoryChannel : public LLNotificationChannel
-{
- LOG_CLASS(LLNotificationHistoryChannel);
-public:
- LLNotificationHistoryChannel(const std::string& filename) :
- LLNotificationChannel("History", "Visible", &historyFilter, LLNotificationComparators::orderByUUID()),
- mFileName(filename)
- {
- connectChanged(boost::bind(&LLNotificationHistoryChannel::historyHandler, this, _1));
- loadPersistentNotifications();
- }
-
-private:
- bool historyHandler(const LLSD& payload)
- {
- // we ignore "load" messages, but rewrite the persistence file on any other
- std::string sigtype = payload["sigtype"];
- if (sigtype != "load")
- {
- savePersistentNotifications();
- }
- return false;
- }
-
- // The history channel gets all notifications except those that have been cancelled
- static bool historyFilter(LLNotificationPtr pNotification)
- {
- return !pNotification->isCancelled();
- }
-
- void savePersistentNotifications()
- {
- llinfos << "Saving open notifications to " << mFileName << llendl;
-
- llofstream notify_file(mFileName.c_str());
- if (!notify_file.is_open())
- {
- llwarns << "Failed to open " << mFileName << llendl;
- return;
- }
-
- LLSD output;
- output["version"] = NOTIFICATION_PERSIST_VERSION;
- LLSD& data = output["data"];
-
- for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
- {
- if (!LLNotifications::instance().templateExists((*it)->getName())) continue;
-
- // only store notifications flagged as persisting
- LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate((*it)->getName());
- if (!templatep->mPersist) continue;
-
- data.append((*it)->asLLSD());
- }
-
- LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
- formatter->format(output, notify_file, LLSDFormatter::OPTIONS_PRETTY);
- }
-
- void loadPersistentNotifications()
- {
- llinfos << "Loading open notifications from " << mFileName << llendl;
-
- llifstream notify_file(mFileName.c_str());
- if (!notify_file.is_open())
- {
- llwarns << "Failed to open " << mFileName << llendl;
- return;
- }
-
- LLSD input;
- LLPointer<LLSDParser> parser = new LLSDXMLParser();
- if (parser->parse(notify_file, input, LLSDSerialize::SIZE_UNLIMITED) < 0)
- {
- llwarns << "Failed to parse open notifications" << llendl;
- return;
- }
-
- if (input.isUndefined()) return;
- std::string version = input["version"];
- if (version != NOTIFICATION_PERSIST_VERSION)
- {
- llwarns << "Bad open notifications version: " << version << llendl;
- return;
- }
- LLSD& data = input["data"];
- if (data.isUndefined()) return;
-
- LLNotifications& instance = LLNotifications::instance();
- for (LLSD::array_const_iterator notification_it = data.beginArray();
- notification_it != data.endArray();
- ++notification_it)
- {
- instance.add(LLNotificationPtr(new LLNotification(*notification_it)));
- }
- }
-
- //virtual
- void onDelete(LLNotificationPtr pNotification)
- {
- // we want to keep deleted notifications in our log
- mItems.insert(pNotification);
-
- return;
- }
-
-private:
- std::string mFileName;
-};
-
-bool filterIgnoredNotifications(LLNotificationPtr notification)
-{
- // filter everything if we are to ignore ALL
- if(LLNotifications::instance().getIgnoreAllNotifications())
- {
- return false;
- }
-
- LLNotificationFormPtr form = notification->getForm();
- // Check to see if the user wants to ignore this alert
- if (form->getIgnoreType() != LLNotificationForm::IGNORE_NO)
- {
- return LLUI::sSettingGroups["ignores"]->getBOOL(notification->getName());
- }
-
- return true;
-}
-
-bool handleIgnoredNotification(const LLSD& payload)
-{
- if (payload["sigtype"].asString() == "add")
- {
- LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
- if (!pNotif) return false;
-
- LLNotificationFormPtr form = pNotif->getForm();
- LLSD response;
- switch(form->getIgnoreType())
- {
- case LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE:
- response = pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON);
- break;
- case LLNotificationForm::IGNORE_WITH_LAST_RESPONSE:
- response = LLUI::sSettingGroups["ignores"]->getLLSD("Default" + pNotif->getName());
- break;
- case LLNotificationForm::IGNORE_SHOW_AGAIN:
- break;
- default:
- return false;
- }
- pNotif->setIgnored(true);
- pNotif->respond(response);
- return true; // don't process this item any further
- }
- return false;
-}
-
-namespace LLNotificationFilters
-{
- // a sample filter
- bool includeEverything(LLNotificationPtr p)
- {
- return true;
- }
-};
-
-LLNotificationForm::LLNotificationForm()
-: mFormData(LLSD::emptyArray()),
- mIgnore(IGNORE_NO)
-{
-}
-
-
-LLNotificationForm::LLNotificationForm(const std::string& name, const LLXMLNodePtr xml_node)
-: mFormData(LLSD::emptyArray()),
- mIgnore(IGNORE_NO)
-{
- if (!xml_node->hasName("form"))
- {
- llwarns << "Bad xml node for form: " << xml_node->getName() << llendl;
- }
- LLXMLNodePtr child = xml_node->getFirstChild();
- while(child)
- {
- child = LLNotifications::instance().checkForXMLTemplate(child);
-
- LLSD item_entry;
- std::string element_name = child->getName()->mString;
-
- if (element_name == "ignore" )
- {
- bool save_option = false;
- child->getAttribute_bool("save_option", save_option);
- if (!save_option)
- {
- mIgnore = IGNORE_WITH_DEFAULT_RESPONSE;
- }
- else
- {
- // remember last option chosen by user and automatically respond with that in the future
- mIgnore = IGNORE_WITH_LAST_RESPONSE;
- LLUI::sSettingGroups["ignores"]->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name));
- }
- child->getAttributeString("text", mIgnoreMsg);
- BOOL show_notification = TRUE;
- LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Ignore notification with this name", TRUE);
- }
- else
- {
- // flatten xml form entry into single LLSD map with type==name
- item_entry["type"] = element_name;
- const LLXMLAttribList::iterator attrib_end = child->mAttributes.end();
- for(LLXMLAttribList::iterator attrib_it = child->mAttributes.begin();
- attrib_it != attrib_end;
- ++attrib_it)
- {
- item_entry[std::string(attrib_it->second->getName()->mString)] = attrib_it->second->getValue();
- }
- item_entry["value"] = child->getTextContents();
- mFormData.append(item_entry);
- }
-
- child = child->getNextSibling();
- }
-}
-
-LLNotificationForm::LLNotificationForm(const LLSD& sd)
-{
- if (sd.isArray())
- {
- mFormData = sd;
- }
- else
- {
- llwarns << "Invalid form data " << sd << llendl;
- mFormData = LLSD::emptyArray();
- }
-}
-
-LLSD LLNotificationForm::asLLSD() const
-{
- return mFormData;
-}
-
-LLSD LLNotificationForm::getElement(const std::string& element_name)
-{
- for (LLSD::array_const_iterator it = mFormData.beginArray();
- it != mFormData.endArray();
- ++it)
- {
- if ((*it)["name"].asString() == element_name) return (*it);
- }
- return LLSD();
-}
-
-
-bool LLNotificationForm::hasElement(const std::string& element_name)
-{
- for (LLSD::array_const_iterator it = mFormData.beginArray();
- it != mFormData.endArray();
- ++it)
- {
- if ((*it)["name"].asString() == element_name) return true;
- }
- return false;
-}
-
-void LLNotificationForm::addElement(const std::string& type, const std::string& name, const LLSD& value)
-{
- LLSD element;
- element["type"] = type;
- element["name"] = name;
- element["text"] = name;
- element["value"] = value;
- element["index"] = mFormData.size();
- mFormData.append(element);
-}
-
-void LLNotificationForm::append(const LLSD& sub_form)
-{
- if (sub_form.isArray())
- {
- for (LLSD::array_const_iterator it = sub_form.beginArray();
- it != sub_form.endArray();
- ++it)
- {
- mFormData.append(*it);
- }
- }
-}
-
-void LLNotificationForm::formatElements(const LLSD& substitutions)
-{
- for (LLSD::array_iterator it = mFormData.beginArray();
- it != mFormData.endArray();
- ++it)
- {
- // format "text" component of each form element
- if ((*it).has("text"))
- {
- std::string text = (*it)["text"].asString();
- LLStringUtil::format(text, substitutions);
- (*it)["text"] = text;
- }
- if ((*it)["type"].asString() == "text" && (*it).has("value"))
- {
- std::string value = (*it)["value"].asString();
- LLStringUtil::format(value, substitutions);
- (*it)["value"] = value;
- }
- }
-}
-
-std::string LLNotificationForm::getDefaultOption()
-{
- for (LLSD::array_const_iterator it = mFormData.beginArray();
- it != mFormData.endArray();
- ++it)
- {
- if ((*it)["default"]) return (*it)["name"].asString();
- }
- return "";
-}
-
-LLNotificationTemplate::LLNotificationTemplate() :
- mExpireSeconds(0),
- mExpireOption(-1),
- mURLOption(-1),
- mURLOpenExternally(-1),
- mUnique(false),
- mPriority(NOTIFICATION_PRIORITY_NORMAL)
-{
- mForm = LLNotificationFormPtr(new LLNotificationForm());
-}
-
-LLNotification::LLNotification(const LLNotification::Params& p) :
- mTimestamp(p.time_stamp),
- mSubstitutions(p.substitutions),
- mPayload(p.payload),
- mExpiresAt(0),
- mTemporaryResponder(false),
- mRespondedTo(false),
- mPriority(p.priority),
- mCancelled(false),
- mIgnored(false)
-{
- if (p.functor.name.isChosen())
- {
- mResponseFunctorName = p.functor.name;
- }
- else if (p.functor.function.isChosen())
- {
- mResponseFunctorName = LLUUID::generateNewID().asString();
- LLNotificationFunctorRegistry::instance().registerFunctor(mResponseFunctorName, p.functor.function());
-
- mTemporaryResponder = true;
- }
-
- mId.generate();
- init(p.name, p.form_elements);
-}
-
-
-LLNotification::LLNotification(const LLSD& sd) :
- mTemporaryResponder(false),
- mRespondedTo(false),
- mCancelled(false),
- mIgnored(false)
-{
- mId.generate();
- mSubstitutions = sd["substitutions"];
- mPayload = sd["payload"];
- mTimestamp = sd["time"];
- mExpiresAt = sd["expiry"];
- mPriority = (ENotificationPriority)sd["priority"].asInteger();
- mResponseFunctorName = sd["responseFunctor"].asString();
- std::string templatename = sd["name"].asString();
- init(templatename, LLSD());
- // replace form with serialized version
- mForm = LLNotificationFormPtr(new LLNotificationForm(sd["form"]));
-}
-
-
-LLSD LLNotification::asLLSD()
-{
- LLSD output;
- output["name"] = mTemplatep->mName;
- output["form"] = getForm()->asLLSD();
- output["substitutions"] = mSubstitutions;
- output["payload"] = mPayload;
- output["time"] = mTimestamp;
- output["expiry"] = mExpiresAt;
- output["priority"] = (S32)mPriority;
- output["responseFunctor"] = mResponseFunctorName;
- return output;
-}
-
-void LLNotification::update()
-{
- LLNotifications::instance().update(shared_from_this());
-}
-
-void LLNotification::updateFrom(LLNotificationPtr other)
-{
- // can only update from the same notification type
- if (mTemplatep != other->mTemplatep) return;
-
- // NOTE: do NOT change the ID, since it is the key to
- // this given instance, just update all the metadata
- //mId = other->mId;
-
- mPayload = other->mPayload;
- mSubstitutions = other->mSubstitutions;
- mTimestamp = other->mTimestamp;
- mExpiresAt = other->mExpiresAt;
- mCancelled = other->mCancelled;
- mIgnored = other->mIgnored;
- mPriority = other->mPriority;
- mForm = other->mForm;
- mResponseFunctorName = other->mResponseFunctorName;
- mRespondedTo = other->mRespondedTo;
- mTemporaryResponder = other->mTemporaryResponder;
-
- update();
-}
-
-const LLNotificationFormPtr LLNotification::getForm()
-{
- return mForm;
-}
-
-void LLNotification::cancel()
-{
- mCancelled = true;
-}
-
-LLSD LLNotification::getResponseTemplate(EResponseTemplateType type)
-{
- LLSD response = LLSD::emptyMap();
- for (S32 element_idx = 0;
- element_idx < mForm->getNumElements();
- ++element_idx)
- {
- LLSD element = mForm->getElement(element_idx);
- if (element.has("name"))
- {
- response[element["name"].asString()] = element["value"];
- }
-
- if ((type == WITH_DEFAULT_BUTTON)
- && element["default"].asBoolean())
- {
- response[element["name"].asString()] = true;
- }
- }
- return response;
-}
-
-//static
-S32 LLNotification::getSelectedOption(const LLSD& notification, const LLSD& response)
-{
- LLNotificationForm form(notification["form"]);
-
- for (S32 element_idx = 0;
- element_idx < form.getNumElements();
- ++element_idx)
- {
- LLSD element = form.getElement(element_idx);
-
- // only look at buttons
- if (element["type"].asString() == "button"
- && response[element["name"].asString()].asBoolean())
- {
- return element["index"].asInteger();
- }
- }
-
- return -1;
-}
-
-//static
-std::string LLNotification::getSelectedOptionName(const LLSD& response)
-{
- for (LLSD::map_const_iterator response_it = response.beginMap();
- response_it != response.endMap();
- ++response_it)
- {
- if (response_it->second.isBoolean() && response_it->second.asBoolean())
- {
- return response_it->first;
- }
- }
- return "";
-}
-
-
-void LLNotification::respond(const LLSD& response)
-{
- mRespondedTo = true;
- // look up the functor
- LLNotificationFunctorRegistry::ResponseFunctor functor =
- LLNotificationFunctorRegistry::instance().getFunctor(mResponseFunctorName);
- // and then call it
- functor(asLLSD(), response);
-
- if (mTemporaryResponder)
- {
- LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName);
- mResponseFunctorName = "";
- mTemporaryResponder = false;
- }
-
- if (mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO)
- {
- BOOL show_notification = mIgnored ? FALSE : TRUE;
- LLUI::sSettingGroups["ignores"]->setBOOL(getName(), show_notification);
- if (mIgnored && mForm->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
- {
- LLUI::sSettingGroups["ignores"]->setLLSD("Default" + getName(), response);
- }
- }
-
- update();
-}
-
-void LLNotification::setIgnored(bool ignore)
-{
- mIgnored = ignore;
-}
-
-void LLNotification::setResponseFunctor(std::string const &responseFunctorName)
-{
- if (mTemporaryResponder)
- // get rid of the old one
- LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName);
- mResponseFunctorName = responseFunctorName;
- mTemporaryResponder = false;
-}
-
-bool LLNotification::payloadContainsAll(const std::vector<std::string>& required_fields) const
-{
- for(std::vector<std::string>::const_iterator required_fields_it = required_fields.begin();
- required_fields_it != required_fields.end();
- required_fields_it++)
- {
- std::string required_field_name = *required_fields_it;
- if( ! getPayload().has(required_field_name))
- {
- return false; // a required field was not found
- }
- }
- return true; // all required fields were found
-}
-
-bool LLNotification::isEquivalentTo(LLNotificationPtr that) const
-{
- if (this->mTemplatep->mName != that->mTemplatep->mName)
- {
- return false; // must have the same template name or forget it
- }
- if (this->mTemplatep->mUnique)
- {
- // highlander bit sez there can only be one of these
- return
- this->payloadContainsAll(that->mTemplatep->mUniqueContext) &&
- that->payloadContainsAll(this->mTemplatep->mUniqueContext);
- }
- return false;
-}
-
-void LLNotification::init(const std::string& template_name, const LLSD& form_elements)
-{
- mTemplatep = LLNotifications::instance().getTemplate(template_name);
- if (!mTemplatep) return;
-
- // add default substitutions
- const LLStringUtil::format_map_t& default_args = LLTrans::getDefaultArgs();
- for (LLStringUtil::format_map_t::const_iterator iter = default_args.begin();
- iter != default_args.end(); ++iter)
- {
- mSubstitutions[iter->first] = iter->second;
- }
- mSubstitutions["_URL"] = getURL();
- mSubstitutions["_NAME"] = template_name;
- // TODO: something like this so that a missing alert is sensible:
- //mSubstitutions["_ARGS"] = get_all_arguments_as_text(mSubstitutions);
-
- mForm = LLNotificationFormPtr(new LLNotificationForm(*mTemplatep->mForm));
- mForm->append(form_elements);
-
- // apply substitution to form labels
- mForm->formatElements(mSubstitutions);
-
- LLDate rightnow = LLDate::now();
- if (mTemplatep->mExpireSeconds)
- {
- mExpiresAt = LLDate(rightnow.secondsSinceEpoch() + mTemplatep->mExpireSeconds);
- }
-
- if (mPriority == NOTIFICATION_PRIORITY_UNSPECIFIED)
- {
- mPriority = mTemplatep->mPriority;
- }
-}
-
-std::string LLNotification::summarize() const
-{
- std::string s = "Notification(";
- s += getName();
- s += ") : ";
- s += mTemplatep ? mTemplatep->mMessage : "";
- // should also include timestamp and expiration time (but probably not payload)
- return s;
-}
-
-std::string LLNotification::getMessage() const
-{
- // all our callers cache this result, so it gives us more flexibility
- // to do the substitution at call time rather than attempting to
- // cache it in the notification
- if (!mTemplatep)
- return std::string();
-
- std::string message = mTemplatep->mMessage;
- LLStringUtil::format(message, mSubstitutions);
- return message;
-}
-
-std::string LLNotification::getLabel() const
-{
- std::string label = mTemplatep->mLabel;
- LLStringUtil::format(label, mSubstitutions);
- return (mTemplatep ? label : "");
-}
-
-std::string LLNotification::getURL() const
-{
- if (!mTemplatep)
- return std::string();
- std::string url = mTemplatep->mURL;
- LLStringUtil::format(url, mSubstitutions);
- return (mTemplatep ? url : "");
-}
-
-// =========================================================
-// LLNotificationChannel implementation
-// ---
-LLBoundListener LLNotificationChannelBase::connectChangedImpl(const LLEventListener& slot)
-{
- // when someone wants to connect to a channel, we first throw them
- // all of the notifications that are already in the channel
- // we use a special signal called "load" in case the channel wants to care
- // only about new notifications
- for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
- {
- slot(LLSD().insert("sigtype", "load").insert("id", (*it)->id()));
- }
- // and then connect the signal so that all future notifications will also be
- // forwarded.
- return mChanged.connect(slot);
-}
-
-LLBoundListener LLNotificationChannelBase::connectAtFrontChangedImpl(const LLEventListener& slot)
-{
- for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
- {
- slot(LLSD().insert("sigtype", "load").insert("id", (*it)->id()));
- }
- return mChanged.connect(slot, boost::signals2::at_front);
-}
-
-LLBoundListener LLNotificationChannelBase::connectPassedFilterImpl(const LLEventListener& slot)
-{
- // these two filters only fire for notifications added after the current one, because
- // they don't participate in the hierarchy.
- return mPassedFilter.connect(slot);
-}
-
-LLBoundListener LLNotificationChannelBase::connectFailedFilterImpl(const LLEventListener& slot)
-{
- return mFailedFilter.connect(slot);
-}
-
-// external call, conforms to our standard signature
-bool LLNotificationChannelBase::updateItem(const LLSD& payload)
-{
- // first check to see if it's in the master list
- LLNotificationPtr pNotification = LLNotifications::instance().find(payload["id"]);
- if (!pNotification)
- return false; // not found
-
- return updateItem(payload, pNotification);
-}
-
-
-//FIX QUIT NOT WORKING
-
-
-// internal call, for use in avoiding lookup
-bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPtr pNotification)
-{
- std::string cmd = payload["sigtype"];
- LLNotificationSet::iterator foundItem = mItems.find(pNotification);
- bool wasFound = (foundItem != mItems.end());
- bool passesFilter = mFilter(pNotification);
-
- // first, we offer the result of the filter test to the simple
- // signals for pass/fail. One of these is guaranteed to be called.
- // If either signal returns true, the change processing is NOT performed
- // (so don't return true unless you know what you're doing!)
- bool abortProcessing = false;
- if (passesFilter)
- {
- abortProcessing = mPassedFilter(payload);
- }
- else
- {
- abortProcessing = mFailedFilter(payload);
- }
-
- if (abortProcessing)
- {
- return true;
- }
-
- if (cmd == "load")
- {
- // should be no reason we'd ever get a load if we already have it
- // if passes filter send a load message, else do nothing
- assert(!wasFound);
- if (passesFilter)
- {
- // not in our list, add it and say so
- mItems.insert(pNotification);
- abortProcessing = mChanged(payload);
- onLoad(pNotification);
- }
- }
- else if (cmd == "change")
- {
- // if it passes filter now and was found, we just send a change message
- // if it passes filter now and wasn't found, we have to add it
- // if it doesn't pass filter and wasn't found, we do nothing
- // if it doesn't pass filter and was found, we need to delete it
- if (passesFilter)
- {
- if (wasFound)
- {
- // it already existed, so this is a change
- // since it changed in place, all we have to do is resend the signal
- abortProcessing = mChanged(payload);
- onChange(pNotification);
- }
- else
- {
- // not in our list, add it and say so
- mItems.insert(pNotification);
- // our payload is const, so make a copy before changing it
- LLSD newpayload = payload;
- newpayload["sigtype"] = "add";
- abortProcessing = mChanged(newpayload);
- onChange(pNotification);
- }
- }
- else
- {
- if (wasFound)
- {
- // it already existed, so this is a delete
- mItems.erase(pNotification);
- // our payload is const, so make a copy before changing it
- LLSD newpayload = payload;
- newpayload["sigtype"] = "delete";
- abortProcessing = mChanged(newpayload);
- onChange(pNotification);
- }
- // didn't pass, not on our list, do nothing
- }
- }
- else if (cmd == "add")
- {
- // should be no reason we'd ever get an add if we already have it
- // if passes filter send an add message, else do nothing
- assert(!wasFound);
- if (passesFilter)
- {
- // not in our list, add it and say so
- mItems.insert(pNotification);
- abortProcessing = mChanged(payload);
- onAdd(pNotification);
- }
- }
- else if (cmd == "delete")
- {
- // if we have it in our list, pass on the delete, then delete it, else do nothing
- if (wasFound)
- {
- abortProcessing = mChanged(payload);
- mItems.erase(pNotification);
- onDelete(pNotification);
- }
- }
- return abortProcessing;
-}
-
-/* static */
-LLNotificationChannelPtr LLNotificationChannel::buildChannel(const std::string& name,
- const std::string& parent,
- LLNotificationFilter filter,
- LLNotificationComparator comparator)
-{
- // note: this is not a leak; notifications are self-registering.
- // This factory helps to prevent excess deletions by making sure all smart
- // pointers to notification channels come from the same source
- new LLNotificationChannel(name, parent, filter, comparator);
- return LLNotifications::instance().getChannel(name);
-}
-
-
-LLNotificationChannel::LLNotificationChannel(const std::string& name,
- const std::string& parent,
- LLNotificationFilter filter,
- LLNotificationComparator comparator) :
-LLNotificationChannelBase(filter, comparator),
-mName(name),
-mParent(parent)
-{
- // store myself in the channel map
- LLNotifications::instance().addChannel(LLNotificationChannelPtr(this));
- // bind to notification broadcast
- if (parent.empty())
- {
- LLNotifications::instance().connectChanged(
- boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
- }
- else
- {
- LLNotificationChannelPtr p = LLNotifications::instance().getChannel(parent);
- p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
- }
-}
-
-
-void LLNotificationChannel::setComparator(LLNotificationComparator comparator)
-{
- mComparator = comparator;
- LLNotificationSet s2(mComparator);
- s2.insert(mItems.begin(), mItems.end());
- mItems.swap(s2);
-
- // notify clients that we've been resorted
- mChanged(LLSD().insert("sigtype", "sort"));
-}
-
-bool LLNotificationChannel::isEmpty() const
-{
- return mItems.empty();
-}
-
-LLNotificationChannel::Iterator LLNotificationChannel::begin()
-{
- return mItems.begin();
-}
-
-LLNotificationChannel::Iterator LLNotificationChannel::end()
-{
- return mItems.end();
-}
-
-std::string LLNotificationChannel::summarize()
-{
- std::string s("Channel '");
- s += mName;
- s += "'\n ";
- for (LLNotificationChannel::Iterator it = begin(); it != end(); ++it)
- {
- s += (*it)->summarize();
- s += "\n ";
- }
- return s;
-}
-
-
-// ---
-// END OF LLNotificationChannel implementation
-// =========================================================
-
-
-// =========================================================
-// LLNotifications implementation
-// ---
-LLNotifications::LLNotifications() : LLNotificationChannelBase(LLNotificationFilters::includeEverything,
- LLNotificationComparators::orderByUUID()),
- mIgnoreAllNotifications(false)
-{
- LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2));
-}
-
-
-// The expiration channel gets all notifications that are cancelled
-bool LLNotifications::expirationFilter(LLNotificationPtr pNotification)
-{
- return pNotification->isCancelled() || pNotification->isRespondedTo();
-}
-
-bool LLNotifications::expirationHandler(const LLSD& payload)
-{
- if (payload["sigtype"].asString() != "delete")
- {
- // anything added to this channel actually should be deleted from the master
- cancel(find(payload["id"]));
- return true; // don't process this item any further
- }
- return false;
-}
-
-bool LLNotifications::uniqueFilter(LLNotificationPtr pNotif)
-{
- if (!pNotif->hasUniquenessConstraints())
- {
- return true;
- }
-
- // checks against existing unique notifications
- for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName());
- existing_it != mUniqueNotifications.end();
- ++existing_it)
- {
- LLNotificationPtr existing_notification = existing_it->second;
- if (pNotif != existing_notification
- && pNotif->isEquivalentTo(existing_notification))
- {
- return false;
- }
- }
-
- return true;
-}
-
-bool LLNotifications::uniqueHandler(const LLSD& payload)
-{
- LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
- if (pNotif && pNotif->hasUniquenessConstraints())
- {
- if (payload["sigtype"].asString() == "add")
- {
- // not a duplicate according to uniqueness criteria, so we keep it
- // and store it for future uniqueness checks
- mUniqueNotifications.insert(std::make_pair(pNotif->getName(), pNotif));
- }
- else if (payload["sigtype"].asString() == "delete")
- {
- mUniqueNotifications.erase(pNotif->getName());
- }
- }
-
- return false;
-}
-
-bool LLNotifications::failedUniquenessTest(const LLSD& payload)
-{
- LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
-
- if (!pNotif || !pNotif->hasUniquenessConstraints())
- {
- return false;
- }
-
- // checks against existing unique notifications
- for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName());
- existing_it != mUniqueNotifications.end();
- ++existing_it)
- {
- LLNotificationPtr existing_notification = existing_it->second;
- if (pNotif != existing_notification
- && pNotif->isEquivalentTo(existing_notification))
- {
- // copy notification instance data over to oldest instance
- // of this unique notification and update it
- existing_notification->updateFrom(pNotif);
- // then delete the new one
- pNotif->cancel();
- }
- }
-
- return false;
-}
-
-
-void LLNotifications::addChannel(LLNotificationChannelPtr pChan)
-{
- mChannels[pChan->getName()] = pChan;
-}
-
-LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelName)
-{
- ChannelMap::iterator p = mChannels.find(channelName);
- if(p == mChannels.end())
- {
- llerrs << "Did not find channel named " << channelName << llendl;
- }
- return p->second;
-}
-
-
-// this function is called once at construction time, after the object is constructed.
-void LLNotifications::initSingleton()
-{
- loadTemplates();
- createDefaultChannels();
-}
-
-void LLNotifications::createDefaultChannels()
-{
- // now construct the various channels AFTER loading the notifications,
- // because the history channel is going to rewrite the stored notifications file
- LLNotificationChannel::buildChannel("Expiration", "",
- boost::bind(&LLNotifications::expirationFilter, this, _1));
- LLNotificationChannel::buildChannel("Unexpired", "",
- !boost::bind(&LLNotifications::expirationFilter, this, _1)); // use negated bind
- LLNotificationChannel::buildChannel("Unique", "Unexpired",
- boost::bind(&LLNotifications::uniqueFilter, this, _1));
- LLNotificationChannel::buildChannel("Ignore", "Unique",
- filterIgnoredNotifications);
- LLNotificationChannel::buildChannel("Visible", "Ignore",
- &LLNotificationFilters::includeEverything);
-
- // create special history channel
- //std::string notifications_log_file = gDirUtilp->getExpandedFilename ( LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml" );
- // use ^^^ when done debugging notifications serialization
- std::string notifications_log_file = gDirUtilp->getExpandedFilename ( LL_PATH_USER_SETTINGS, "open_notifications.xml" );
- // this isn't a leak, don't worry about the empty "new"
- new LLNotificationHistoryChannel(notifications_log_file);
-
- // connect action methods to these channels
- LLNotifications::instance().getChannel("Expiration")->
- connectChanged(boost::bind(&LLNotifications::expirationHandler, this, _1));
- // uniqueHandler slot should be added as first slot of the signal due to
- // usage LLStopWhenHandled combiner in LLStandardSignal
- LLNotifications::instance().getChannel("Unique")->
- connectAtFrontChanged(boost::bind(&LLNotifications::uniqueHandler, this, _1));
-// failedUniquenessTest slot isn't necessary
-// LLNotifications::instance().getChannel("Unique")->
-// connectFailedFilter(boost::bind(&LLNotifications::failedUniquenessTest, this, _1));
- LLNotifications::instance().getChannel("Ignore")->
- connectFailedFilter(&handleIgnoredNotification);
-}
-
-bool LLNotifications::addTemplate(const std::string &name,
- LLNotificationTemplatePtr theTemplate)
-{
- if (mTemplates.count(name))
- {
- llwarns << "LLNotifications -- attempted to add template '" << name << "' twice." << llendl;
- return false;
- }
- mTemplates[name] = theTemplate;
- return true;
-}
-
-LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
-{
- if (mTemplates.count(name))
- {
- return mTemplates[name];
- }
- else
- {
- return mTemplates["MissingAlert"];
- }
-}
-
-bool LLNotifications::templateExists(const std::string& name)
-{
- return (mTemplates.count(name) != 0);
-}
-
-void LLNotifications::clearTemplates()
-{
- mTemplates.clear();
-}
-
-void LLNotifications::forceResponse(const LLNotification::Params& params, S32 option)
-{
- LLNotificationPtr temp_notify(new LLNotification(params));
- LLSD response = temp_notify->getResponseTemplate();
- LLSD selected_item = temp_notify->getForm()->getElement(option);
-
- if (selected_item.isUndefined())
- {
- llwarns << "Invalid option" << option << " for notification " << (std::string)params.name << llendl;
- return;
- }
- response[selected_item["name"].asString()] = true;
-
- temp_notify->respond(response);
-}
-
-LLNotifications::TemplateNames LLNotifications::getTemplateNames() const
-{
- TemplateNames names;
- for (TemplateMap::const_iterator it = mTemplates.begin(); it != mTemplates.end(); ++it)
- {
- names.push_back(it->first);
- }
- return names;
-}
-
-typedef std::map<std::string, std::string> StringMap;
-void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
-{
- //llwarns << "replaceSubstitutionStrings" << llendl;
- // walk the list of attributes looking for replacements
- for (LLXMLAttribList::iterator it=node->mAttributes.begin();
- it != node->mAttributes.end(); ++it)
- {
- std::string value = it->second->getValue();
- if (value[0] == '$')
- {
- value.erase(0, 1); // trim off the $
- std::string replacement;
- StringMap::const_iterator found = replacements.find(value);
- if (found != replacements.end())
- {
- replacement = found->second;
- //llwarns << "replaceSubstituionStrings: value: " << value << " repl: " << replacement << llendl;
-
- it->second->setValue(replacement);
- }
- else
- {
- llwarns << "replaceSubstituionStrings FAILURE: value: " << value << " repl: " << replacement << llendl;
- }
- }
- }
-
- // now walk the list of children and call this recursively.
- for (LLXMLNodePtr child = node->getFirstChild();
- child.notNull(); child = child->getNextSibling())
- {
- replaceSubstitutionStrings(child, replacements);
- }
-}
-
-// private to this file
-// returns true if the template request was invalid and there's nothing else we
-// can do with this node, false if you should keep processing (it may have
-// replaced the contents of the node referred to)
-LLXMLNodePtr LLNotifications::checkForXMLTemplate(LLXMLNodePtr item)
-{
- if (item->hasName("usetemplate"))
- {
- std::string replacementName;
- if (item->getAttributeString("name", replacementName))
- {
- StringMap replacements;
- for (LLXMLAttribList::const_iterator it=item->mAttributes.begin();
- it != item->mAttributes.end(); ++it)
- {
- replacements[it->second->getName()->mString] = it->second->getValue();
- }
- if (mXmlTemplates.count(replacementName))
- {
- item=LLXMLNode::replaceNode(item, mXmlTemplates[replacementName]);
-
- // walk the nodes looking for $(substitution) here and replace
- replaceSubstitutionStrings(item, replacements);
- }
- else
- {
- llwarns << "XML template lookup failure on '" << replacementName << "' " << llendl;
- }
- }
- }
- return item;
-}
-
-bool LLNotifications::loadTemplates()
-{
- const std::string xml_filename = "notifications.xml";
- LLXMLNodePtr root;
-
- BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
-
- if (!success || root.isNull() || !root->hasName( "notifications" ))
- {
- llerrs << "Problem reading UI Notifications file: " << xml_filename << llendl;
- return false;
- }
-
- clearTemplates();
-
- for (LLXMLNodePtr item = root->getFirstChild();
- item.notNull(); item = item->getNextSibling())
- {
- // we do this FIRST so that item can be changed if we
- // encounter a usetemplate -- we just replace the
- // current xml node and keep processing
- item = checkForXMLTemplate(item);
-
- if (item->hasName("global"))
- {
- std::string global_name;
- if (item->getAttributeString("name", global_name))
- {
- mGlobalStrings[global_name] = item->getTextContents();
- }
- continue;
- }
-
- if (item->hasName("template"))
- {
- // store an xml template; templates must have a single node (can contain
- // other nodes)
- std::string name;
- item->getAttributeString("name", name);
- LLXMLNodePtr ptr = item->getFirstChild();
- mXmlTemplates[name] = ptr;
- continue;
- }
-
- if (!item->hasName("notification"))
- {
- llwarns << "Unexpected entity " << item->getName()->mString <<
- " found in " << xml_filename << llendl;
- continue;
- }
-
- // now we know we have a notification entry, so let's build it
- LLNotificationTemplatePtr pTemplate(new LLNotificationTemplate());
-
- if (!item->getAttributeString("name", pTemplate->mName))
- {
- llwarns << "Unable to parse notification with no name" << llendl;
- continue;
- }
-
- //llinfos << "Parsing " << pTemplate->mName << llendl;
-
- pTemplate->mMessage = item->getTextContents();
- pTemplate->mDefaultFunctor = pTemplate->mName;
- item->getAttributeString("type", pTemplate->mType);
- item->getAttributeString("icon", pTemplate->mIcon);
- item->getAttributeString("label", pTemplate->mLabel);
- item->getAttributeU32("duration", pTemplate->mExpireSeconds);
- item->getAttributeU32("expireOption", pTemplate->mExpireOption);
-
- std::string priority;
- item->getAttributeString("priority", priority);
- pTemplate->mPriority = NOTIFICATION_PRIORITY_NORMAL;
- if (!priority.empty())
- {
- if (priority == "low") pTemplate->mPriority = NOTIFICATION_PRIORITY_LOW;
- if (priority == "normal") pTemplate->mPriority = NOTIFICATION_PRIORITY_NORMAL;
- if (priority == "high") pTemplate->mPriority = NOTIFICATION_PRIORITY_HIGH;
- if (priority == "critical") pTemplate->mPriority = NOTIFICATION_PRIORITY_CRITICAL;
- }
-
- item->getAttributeString("functor", pTemplate->mDefaultFunctor);
-
- BOOL persist = false;
- item->getAttributeBOOL("persist", persist);
- pTemplate->mPersist = persist;
-
- std::string sound;
- item->getAttributeString("sound", sound);
- if (!sound.empty())
- {
- // test for bad sound effect name / missing effect
- if (LLUI::sSettingGroups["config"]->controlExists(sound))
- {
- pTemplate->mSoundEffect =
- LLUUID(LLUI::sSettingGroups["config"]->getString(sound));
- }
- else
- {
- llwarns << "Unknown sound effect control name " << sound
- << llendl;
- }
- }
-
- for (LLXMLNodePtr child = item->getFirstChild();
- !child.isNull(); child = child->getNextSibling())
- {
- child = checkForXMLTemplate(child);
-
- // <url>
- if (child->hasName("url"))
- {
- pTemplate->mURL = child->getTextContents();
- child->getAttributeU32("option", pTemplate->mURLOption);
- child->getAttributeU32("openexternally", pTemplate->mURLOpenExternally);
- }
-
- if (child->hasName("unique"))
- {
- pTemplate->mUnique = true;
- for (LLXMLNodePtr formitem = child->getFirstChild();
- !formitem.isNull(); formitem = formitem->getNextSibling())
- {
- if (formitem->hasName("context"))
- {
- std::string key;
- formitem->getAttributeString("key", key);
- pTemplate->mUniqueContext.push_back(key);
- //llwarns << "adding " << key << " to unique context" << llendl;
- }
- else
- {
- llwarns << "'unique' has unrecognized subelement "
- << formitem->getName()->mString << llendl;
- }
- }
- }
-
- // <form>
- if (child->hasName("form"))
- {
- pTemplate->mForm = LLNotificationFormPtr(new LLNotificationForm(pTemplate->mName, child));
- }
- }
- addTemplate(pTemplate->mName, pTemplate);
- }
-
- //std::ostringstream ostream;
- //root->writeToOstream(ostream, "\n ");
- //llwarns << ostream.str() << llendl;
-
- return true;
-}
-
-// Add a simple notification (from XUI)
-void LLNotifications::addFromCallback(const LLSD& name)
-{
- add(LLNotification::Params().name(name.asString()));
-}
-
-// we provide a couple of simple add notification functions so that it's reasonable to create notifications in one line
-LLNotificationPtr LLNotifications::add(const std::string& name,
- const LLSD& substitutions,
- const LLSD& payload)
-{
- LLNotification::Params::Functor functor_p;
- functor_p.name = name;
- return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p));
-}
-
-LLNotificationPtr LLNotifications::add(const std::string& name,
- const LLSD& substitutions,
- const LLSD& payload,
- const std::string& functor_name)
-{
- LLNotification::Params::Functor functor_p;
- functor_p.name = functor_name;
- return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p));
-}
-
-LLNotificationPtr LLNotifications::add(const std::string& name,
- const LLSD& substitutions,
- const LLSD& payload,
- LLNotificationFunctorRegistry::ResponseFunctor functor)
-{
- LLNotification::Params::Functor functor_p;
- functor_p.function = functor;
- return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p));
-}
-
-// generalized add function that takes a parameter block object for more complex instantiations
-LLNotificationPtr LLNotifications::add(const LLNotification::Params& p)
-{
- LLNotificationPtr pNotif(new LLNotification(p));
- add(pNotif);
- return pNotif;
-}
-
-
-void LLNotifications::add(const LLNotificationPtr pNotif)
-{
- // first see if we already have it -- if so, that's a problem
- LLNotificationSet::iterator it=mItems.find(pNotif);
- if (it != mItems.end())
- {
- llerrs << "Notification added a second time to the master notification channel." << llendl;
- }
-
- updateItem(LLSD().insert("sigtype", "add").insert("id", pNotif->id()), pNotif);
-}
-
-void LLNotifications::cancel(LLNotificationPtr pNotif)
-{
- LLNotificationSet::iterator it=mItems.find(pNotif);
- if (it == mItems.end())
- {
- llerrs << "Attempted to delete nonexistent notification " << pNotif->getName() << llendl;
- }
- updateItem(LLSD().insert("sigtype", "delete").insert("id", pNotif->id()), pNotif);
- pNotif->cancel();
-}
-
-void LLNotifications::update(const LLNotificationPtr pNotif)
-{
- LLNotificationSet::iterator it=mItems.find(pNotif);
- if (it != mItems.end())
- {
- updateItem(LLSD().insert("sigtype", "change").insert("id", pNotif->id()), pNotif);
- }
-}
-
-
-LLNotificationPtr LLNotifications::find(LLUUID uuid)
-{
- LLNotificationPtr target = LLNotificationPtr(new LLNotification(uuid));
- LLNotificationSet::iterator it=mItems.find(target);
- if (it == mItems.end())
- {
- llwarns << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl;
- return LLNotificationPtr((LLNotification*)NULL);
- }
- else
- {
- return *it;
- }
-}
-
-void LLNotifications::forEachNotification(NotificationProcess process)
-{
- std::for_each(mItems.begin(), mItems.end(), process);
-}
-
-std::string LLNotifications::getGlobalString(const std::string& key) const
-{
- GlobalStringMap::const_iterator it = mGlobalStrings.find(key);
- if (it != mGlobalStrings.end())
- {
- return it->second;
- }
- else
- {
- // if we don't have the key as a global, return the key itself so that the error
- // is self-diagnosing.
- return key;
- }
-}
-
-void LLNotifications::setIgnoreAllNotifications(bool setting)
-{
- mIgnoreAllNotifications = setting;
-}
-bool LLNotifications::getIgnoreAllNotifications()
-{
- return mIgnoreAllNotifications;
-}
-
-// ---
-// END OF LLNotifications implementation
-// =========================================================
-
-std::ostream& operator<<(std::ostream& s, const LLNotification& notification)
-{
- s << notification.summarize();
- return s;
-}
-
+/**
+* @file llnotifications.cpp
+* @brief Non-UI queue manager for keeping a prioritized list of notifications
+*
+* $LicenseInfo:firstyear=2008&license=viewergpl$
+*
+* Copyright (c) 2008-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llnotifications.h"
+
+#include "lluictrl.h"
+#include "lluictrlfactory.h"
+#include "lldir.h"
+#include "llsdserialize.h"
+#include "lltrans.h"
+#include "llnotificationslistener.h"
+
+#include <algorithm>
+#include <boost/regex.hpp>
+
+
+const std::string NOTIFICATION_PERSIST_VERSION = "0.93";
+
+// local channel for notification history
+class LLNotificationHistoryChannel : public LLNotificationChannel
+{
+ LOG_CLASS(LLNotificationHistoryChannel);
+public:
+ LLNotificationHistoryChannel(const std::string& filename) :
+ LLNotificationChannel("History", "Visible", &historyFilter, LLNotificationComparators::orderByUUID()),
+ mFileName(filename)
+ {
+ connectChanged(boost::bind(&LLNotificationHistoryChannel::historyHandler, this, _1));
+ loadPersistentNotifications();
+ }
+
+private:
+ bool historyHandler(const LLSD& payload)
+ {
+ // we ignore "load" messages, but rewrite the persistence file on any other
+ std::string sigtype = payload["sigtype"];
+ if (sigtype != "load")
+ {
+ savePersistentNotifications();
+ }
+ return false;
+ }
+
+ // The history channel gets all notifications except those that have been cancelled
+ static bool historyFilter(LLNotificationPtr pNotification)
+ {
+ return !pNotification->isCancelled();
+ }
+
+ void savePersistentNotifications()
+ {
+ llinfos << "Saving open notifications to " << mFileName << llendl;
+
+ llofstream notify_file(mFileName.c_str());
+ if (!notify_file.is_open())
+ {
+ llwarns << "Failed to open " << mFileName << llendl;
+ return;
+ }
+
+ LLSD output;
+ output["version"] = NOTIFICATION_PERSIST_VERSION;
+ LLSD& data = output["data"];
+
+ for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
+ {
+ if (!LLNotifications::instance().templateExists((*it)->getName())) continue;
+
+ // only store notifications flagged as persisting
+ LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate((*it)->getName());
+ if (!templatep->mPersist) continue;
+
+ data.append((*it)->asLLSD());
+ }
+
+ LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
+ formatter->format(output, notify_file, LLSDFormatter::OPTIONS_PRETTY);
+ }
+
+ void loadPersistentNotifications()
+ {
+ llinfos << "Loading open notifications from " << mFileName << llendl;
+
+ llifstream notify_file(mFileName.c_str());
+ if (!notify_file.is_open())
+ {
+ llwarns << "Failed to open " << mFileName << llendl;
+ return;
+ }
+
+ LLSD input;
+ LLPointer<LLSDParser> parser = new LLSDXMLParser();
+ if (parser->parse(notify_file, input, LLSDSerialize::SIZE_UNLIMITED) < 0)
+ {
+ llwarns << "Failed to parse open notifications" << llendl;
+ return;
+ }
+
+ if (input.isUndefined()) return;
+ std::string version = input["version"];
+ if (version != NOTIFICATION_PERSIST_VERSION)
+ {
+ llwarns << "Bad open notifications version: " << version << llendl;
+ return;
+ }
+ LLSD& data = input["data"];
+ if (data.isUndefined()) return;
+
+ LLNotifications& instance = LLNotifications::instance();
+ for (LLSD::array_const_iterator notification_it = data.beginArray();
+ notification_it != data.endArray();
+ ++notification_it)
+ {
+ instance.add(LLNotificationPtr(new LLNotification(*notification_it)));
+ }
+ }
+
+ //virtual
+ void onDelete(LLNotificationPtr pNotification)
+ {
+ // we want to keep deleted notifications in our log
+ mItems.insert(pNotification);
+
+ return;
+ }
+
+private:
+ std::string mFileName;
+};
+
+bool filterIgnoredNotifications(LLNotificationPtr notification)
+{
+ // filter everything if we are to ignore ALL
+ if(LLNotifications::instance().getIgnoreAllNotifications())
+ {
+ return false;
+ }
+
+ LLNotificationFormPtr form = notification->getForm();
+ // Check to see if the user wants to ignore this alert
+ if (form->getIgnoreType() != LLNotificationForm::IGNORE_NO)
+ {
+ return LLUI::sSettingGroups["ignores"]->getBOOL(notification->getName());
+ }
+
+ return true;
+}
+
+bool handleIgnoredNotification(const LLSD& payload)
+{
+ if (payload["sigtype"].asString() == "add")
+ {
+ LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
+ if (!pNotif) return false;
+
+ LLNotificationFormPtr form = pNotif->getForm();
+ LLSD response;
+ switch(form->getIgnoreType())
+ {
+ case LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE:
+ response = pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON);
+ break;
+ case LLNotificationForm::IGNORE_WITH_LAST_RESPONSE:
+ response = LLUI::sSettingGroups["ignores"]->getLLSD("Default" + pNotif->getName());
+ break;
+ case LLNotificationForm::IGNORE_SHOW_AGAIN:
+ break;
+ default:
+ return false;
+ }
+ pNotif->setIgnored(true);
+ pNotif->respond(response);
+ return true; // don't process this item any further
+ }
+ return false;
+}
+
+namespace LLNotificationFilters
+{
+ // a sample filter
+ bool includeEverything(LLNotificationPtr p)
+ {
+ return true;
+ }
+};
+
+LLNotificationForm::LLNotificationForm()
+: mFormData(LLSD::emptyArray()),
+ mIgnore(IGNORE_NO)
+{
+}
+
+
+LLNotificationForm::LLNotificationForm(const std::string& name, const LLXMLNodePtr xml_node)
+: mFormData(LLSD::emptyArray()),
+ mIgnore(IGNORE_NO)
+{
+ if (!xml_node->hasName("form"))
+ {
+ llwarns << "Bad xml node for form: " << xml_node->getName() << llendl;
+ }
+ LLXMLNodePtr child = xml_node->getFirstChild();
+ while(child)
+ {
+ child = LLNotifications::instance().checkForXMLTemplate(child);
+
+ LLSD item_entry;
+ std::string element_name = child->getName()->mString;
+
+ if (element_name == "ignore" )
+ {
+ bool save_option = false;
+ child->getAttribute_bool("save_option", save_option);
+ if (!save_option)
+ {
+ mIgnore = IGNORE_WITH_DEFAULT_RESPONSE;
+ }
+ else
+ {
+ // remember last option chosen by user and automatically respond with that in the future
+ mIgnore = IGNORE_WITH_LAST_RESPONSE;
+ LLUI::sSettingGroups["ignores"]->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name));
+ }
+ child->getAttributeString("text", mIgnoreMsg);
+ BOOL show_notification = TRUE;
+ LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Ignore notification with this name", TRUE);
+ }
+ else
+ {
+ // flatten xml form entry into single LLSD map with type==name
+ item_entry["type"] = element_name;
+ const LLXMLAttribList::iterator attrib_end = child->mAttributes.end();
+ for(LLXMLAttribList::iterator attrib_it = child->mAttributes.begin();
+ attrib_it != attrib_end;
+ ++attrib_it)
+ {
+ item_entry[std::string(attrib_it->second->getName()->mString)] = attrib_it->second->getValue();
+ }
+ item_entry["value"] = child->getTextContents();
+ mFormData.append(item_entry);
+ }
+
+ child = child->getNextSibling();
+ }
+}
+
+LLNotificationForm::LLNotificationForm(const LLSD& sd)
+{
+ if (sd.isArray())
+ {
+ mFormData = sd;
+ }
+ else
+ {
+ llwarns << "Invalid form data " << sd << llendl;
+ mFormData = LLSD::emptyArray();
+ }
+}
+
+LLSD LLNotificationForm::asLLSD() const
+{
+ return mFormData;
+}
+
+LLSD LLNotificationForm::getElement(const std::string& element_name)
+{
+ for (LLSD::array_const_iterator it = mFormData.beginArray();
+ it != mFormData.endArray();
+ ++it)
+ {
+ if ((*it)["name"].asString() == element_name) return (*it);
+ }
+ return LLSD();
+}
+
+
+bool LLNotificationForm::hasElement(const std::string& element_name)
+{
+ for (LLSD::array_const_iterator it = mFormData.beginArray();
+ it != mFormData.endArray();
+ ++it)
+ {
+ if ((*it)["name"].asString() == element_name) return true;
+ }
+ return false;
+}
+
+void LLNotificationForm::addElement(const std::string& type, const std::string& name, const LLSD& value)
+{
+ LLSD element;
+ element["type"] = type;
+ element["name"] = name;
+ element["text"] = name;
+ element["value"] = value;
+ element["index"] = mFormData.size();
+ mFormData.append(element);
+}
+
+void LLNotificationForm::append(const LLSD& sub_form)
+{
+ if (sub_form.isArray())
+ {
+ for (LLSD::array_const_iterator it = sub_form.beginArray();
+ it != sub_form.endArray();
+ ++it)
+ {
+ mFormData.append(*it);
+ }
+ }
+}
+
+void LLNotificationForm::formatElements(const LLSD& substitutions)
+{
+ for (LLSD::array_iterator it = mFormData.beginArray();
+ it != mFormData.endArray();
+ ++it)
+ {
+ // format "text" component of each form element
+ if ((*it).has("text"))
+ {
+ std::string text = (*it)["text"].asString();
+ LLStringUtil::format(text, substitutions);
+ (*it)["text"] = text;
+ }
+ if ((*it)["type"].asString() == "text" && (*it).has("value"))
+ {
+ std::string value = (*it)["value"].asString();
+ LLStringUtil::format(value, substitutions);
+ (*it)["value"] = value;
+ }
+ }
+}
+
+std::string LLNotificationForm::getDefaultOption()
+{
+ for (LLSD::array_const_iterator it = mFormData.beginArray();
+ it != mFormData.endArray();
+ ++it)
+ {
+ if ((*it)["default"]) return (*it)["name"].asString();
+ }
+ return "";
+}
+
+LLNotificationTemplate::LLNotificationTemplate() :
+ mExpireSeconds(0),
+ mExpireOption(-1),
+ mURLOption(-1),
+ mURLOpenExternally(-1),
+ mUnique(false),
+ mPriority(NOTIFICATION_PRIORITY_NORMAL)
+{
+ mForm = LLNotificationFormPtr(new LLNotificationForm());
+}
+
+LLNotification::LLNotification(const LLNotification::Params& p) :
+ mTimestamp(p.time_stamp),
+ mSubstitutions(p.substitutions),
+ mPayload(p.payload),
+ mExpiresAt(0),
+ mTemporaryResponder(false),
+ mRespondedTo(false),
+ mPriority(p.priority),
+ mCancelled(false),
+ mIgnored(false)
+{
+ if (p.functor.name.isChosen())
+ {
+ mResponseFunctorName = p.functor.name;
+ }
+ else if (p.functor.function.isChosen())
+ {
+ mResponseFunctorName = LLUUID::generateNewID().asString();
+ LLNotificationFunctorRegistry::instance().registerFunctor(mResponseFunctorName, p.functor.function());
+
+ mTemporaryResponder = true;
+ }
+
+ mId.generate();
+ init(p.name, p.form_elements);
+}
+
+
+LLNotification::LLNotification(const LLSD& sd) :
+ mTemporaryResponder(false),
+ mRespondedTo(false),
+ mCancelled(false),
+ mIgnored(false)
+{
+ mId.generate();
+ mSubstitutions = sd["substitutions"];
+ mPayload = sd["payload"];
+ mTimestamp = sd["time"];
+ mExpiresAt = sd["expiry"];
+ mPriority = (ENotificationPriority)sd["priority"].asInteger();
+ mResponseFunctorName = sd["responseFunctor"].asString();
+ std::string templatename = sd["name"].asString();
+ init(templatename, LLSD());
+ // replace form with serialized version
+ mForm = LLNotificationFormPtr(new LLNotificationForm(sd["form"]));
+}
+
+
+LLSD LLNotification::asLLSD()
+{
+ LLSD output;
+ output["name"] = mTemplatep->mName;
+ output["form"] = getForm()->asLLSD();
+ output["substitutions"] = mSubstitutions;
+ output["payload"] = mPayload;
+ output["time"] = mTimestamp;
+ output["expiry"] = mExpiresAt;
+ output["priority"] = (S32)mPriority;
+ output["responseFunctor"] = mResponseFunctorName;
+ return output;
+}
+
+void LLNotification::update()
+{
+ LLNotifications::instance().update(shared_from_this());
+}
+
+void LLNotification::updateFrom(LLNotificationPtr other)
+{
+ // can only update from the same notification type
+ if (mTemplatep != other->mTemplatep) return;
+
+ // NOTE: do NOT change the ID, since it is the key to
+ // this given instance, just update all the metadata
+ //mId = other->mId;
+
+ mPayload = other->mPayload;
+ mSubstitutions = other->mSubstitutions;
+ mTimestamp = other->mTimestamp;
+ mExpiresAt = other->mExpiresAt;
+ mCancelled = other->mCancelled;
+ mIgnored = other->mIgnored;
+ mPriority = other->mPriority;
+ mForm = other->mForm;
+ mResponseFunctorName = other->mResponseFunctorName;
+ mRespondedTo = other->mRespondedTo;
+ mTemporaryResponder = other->mTemporaryResponder;
+
+ update();
+}
+
+const LLNotificationFormPtr LLNotification::getForm()
+{
+ return mForm;
+}
+
+void LLNotification::cancel()
+{
+ mCancelled = true;
+}
+
+LLSD LLNotification::getResponseTemplate(EResponseTemplateType type)
+{
+ LLSD response = LLSD::emptyMap();
+ for (S32 element_idx = 0;
+ element_idx < mForm->getNumElements();
+ ++element_idx)
+ {
+ LLSD element = mForm->getElement(element_idx);
+ if (element.has("name"))
+ {
+ response[element["name"].asString()] = element["value"];
+ }
+
+ if ((type == WITH_DEFAULT_BUTTON)
+ && element["default"].asBoolean())
+ {
+ response[element["name"].asString()] = true;
+ }
+ }
+ return response;
+}
+
+//static
+S32 LLNotification::getSelectedOption(const LLSD& notification, const LLSD& response)
+{
+ LLNotificationForm form(notification["form"]);
+
+ for (S32 element_idx = 0;
+ element_idx < form.getNumElements();
+ ++element_idx)
+ {
+ LLSD element = form.getElement(element_idx);
+
+ // only look at buttons
+ if (element["type"].asString() == "button"
+ && response[element["name"].asString()].asBoolean())
+ {
+ return element["index"].asInteger();
+ }
+ }
+
+ return -1;
+}
+
+//static
+std::string LLNotification::getSelectedOptionName(const LLSD& response)
+{
+ for (LLSD::map_const_iterator response_it = response.beginMap();
+ response_it != response.endMap();
+ ++response_it)
+ {
+ if (response_it->second.isBoolean() && response_it->second.asBoolean())
+ {
+ return response_it->first;
+ }
+ }
+ return "";
+}
+
+
+void LLNotification::respond(const LLSD& response)
+{
+ mRespondedTo = true;
+ // look up the functor
+ LLNotificationFunctorRegistry::ResponseFunctor functor =
+ LLNotificationFunctorRegistry::instance().getFunctor(mResponseFunctorName);
+ // and then call it
+ functor(asLLSD(), response);
+
+ if (mTemporaryResponder)
+ {
+ LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName);
+ mResponseFunctorName = "";
+ mTemporaryResponder = false;
+ }
+
+ if (mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO)
+ {
+ BOOL show_notification = mIgnored ? FALSE : TRUE;
+ LLUI::sSettingGroups["ignores"]->setBOOL(getName(), show_notification);
+ if (mIgnored && mForm->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
+ {
+ LLUI::sSettingGroups["ignores"]->setLLSD("Default" + getName(), response);
+ }
+ }
+
+ update();
+}
+
+void LLNotification::setIgnored(bool ignore)
+{
+ mIgnored = ignore;
+}
+
+void LLNotification::setResponseFunctor(std::string const &responseFunctorName)
+{
+ if (mTemporaryResponder)
+ // get rid of the old one
+ LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName);
+ mResponseFunctorName = responseFunctorName;
+ mTemporaryResponder = false;
+}
+
+bool LLNotification::payloadContainsAll(const std::vector<std::string>& required_fields) const
+{
+ for(std::vector<std::string>::const_iterator required_fields_it = required_fields.begin();
+ required_fields_it != required_fields.end();
+ required_fields_it++)
+ {
+ std::string required_field_name = *required_fields_it;
+ if( ! getPayload().has(required_field_name))
+ {
+ return false; // a required field was not found
+ }
+ }
+ return true; // all required fields were found
+}
+
+bool LLNotification::isEquivalentTo(LLNotificationPtr that) const
+{
+ if (this->mTemplatep->mName != that->mTemplatep->mName)
+ {
+ return false; // must have the same template name or forget it
+ }
+ if (this->mTemplatep->mUnique)
+ {
+ // highlander bit sez there can only be one of these
+ return
+ this->payloadContainsAll(that->mTemplatep->mUniqueContext) &&
+ that->payloadContainsAll(this->mTemplatep->mUniqueContext);
+ }
+ return false;
+}
+
+void LLNotification::init(const std::string& template_name, const LLSD& form_elements)
+{
+ mTemplatep = LLNotifications::instance().getTemplate(template_name);
+ if (!mTemplatep) return;
+
+ // add default substitutions
+ const LLStringUtil::format_map_t& default_args = LLTrans::getDefaultArgs();
+ for (LLStringUtil::format_map_t::const_iterator iter = default_args.begin();
+ iter != default_args.end(); ++iter)
+ {
+ mSubstitutions[iter->first] = iter->second;
+ }
+ mSubstitutions["_URL"] = getURL();
+ mSubstitutions["_NAME"] = template_name;
+ // TODO: something like this so that a missing alert is sensible:
+ //mSubstitutions["_ARGS"] = get_all_arguments_as_text(mSubstitutions);
+
+ mForm = LLNotificationFormPtr(new LLNotificationForm(*mTemplatep->mForm));
+ mForm->append(form_elements);
+
+ // apply substitution to form labels
+ mForm->formatElements(mSubstitutions);
+
+ LLDate rightnow = LLDate::now();
+ if (mTemplatep->mExpireSeconds)
+ {
+ mExpiresAt = LLDate(rightnow.secondsSinceEpoch() + mTemplatep->mExpireSeconds);
+ }
+
+ if (mPriority == NOTIFICATION_PRIORITY_UNSPECIFIED)
+ {
+ mPriority = mTemplatep->mPriority;
+ }
+}
+
+std::string LLNotification::summarize() const
+{
+ std::string s = "Notification(";
+ s += getName();
+ s += ") : ";
+ s += mTemplatep ? mTemplatep->mMessage : "";
+ // should also include timestamp and expiration time (but probably not payload)
+ return s;
+}
+
+std::string LLNotification::getMessage() const
+{
+ // all our callers cache this result, so it gives us more flexibility
+ // to do the substitution at call time rather than attempting to
+ // cache it in the notification
+ if (!mTemplatep)
+ return std::string();
+
+ std::string message = mTemplatep->mMessage;
+ LLStringUtil::format(message, mSubstitutions);
+ return message;
+}
+
+std::string LLNotification::getLabel() const
+{
+ std::string label = mTemplatep->mLabel;
+ LLStringUtil::format(label, mSubstitutions);
+ return (mTemplatep ? label : "");
+}
+
+std::string LLNotification::getURL() const
+{
+ if (!mTemplatep)
+ return std::string();
+ std::string url = mTemplatep->mURL;
+ LLStringUtil::format(url, mSubstitutions);
+ return (mTemplatep ? url : "");
+}
+
+// =========================================================
+// LLNotificationChannel implementation
+// ---
+LLBoundListener LLNotificationChannelBase::connectChangedImpl(const LLEventListener& slot)
+{
+ // when someone wants to connect to a channel, we first throw them
+ // all of the notifications that are already in the channel
+ // we use a special signal called "load" in case the channel wants to care
+ // only about new notifications
+ for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
+ {
+ slot(LLSD().insert("sigtype", "load").insert("id", (*it)->id()));
+ }
+ // and then connect the signal so that all future notifications will also be
+ // forwarded.
+ return mChanged.connect(slot);
+}
+
+LLBoundListener LLNotificationChannelBase::connectAtFrontChangedImpl(const LLEventListener& slot)
+{
+ for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
+ {
+ slot(LLSD().insert("sigtype", "load").insert("id", (*it)->id()));
+ }
+ return mChanged.connect(slot, boost::signals2::at_front);
+}
+
+LLBoundListener LLNotificationChannelBase::connectPassedFilterImpl(const LLEventListener& slot)
+{
+ // these two filters only fire for notifications added after the current one, because
+ // they don't participate in the hierarchy.
+ return mPassedFilter.connect(slot);
+}
+
+LLBoundListener LLNotificationChannelBase::connectFailedFilterImpl(const LLEventListener& slot)
+{
+ return mFailedFilter.connect(slot);
+}
+
+// external call, conforms to our standard signature
+bool LLNotificationChannelBase::updateItem(const LLSD& payload)
+{
+ // first check to see if it's in the master list
+ LLNotificationPtr pNotification = LLNotifications::instance().find(payload["id"]);
+ if (!pNotification)
+ return false; // not found
+
+ return updateItem(payload, pNotification);
+}
+
+
+//FIX QUIT NOT WORKING
+
+
+// internal call, for use in avoiding lookup
+bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPtr pNotification)
+{
+ std::string cmd = payload["sigtype"];
+ LLNotificationSet::iterator foundItem = mItems.find(pNotification);
+ bool wasFound = (foundItem != mItems.end());
+ bool passesFilter = mFilter(pNotification);
+
+ // first, we offer the result of the filter test to the simple
+ // signals for pass/fail. One of these is guaranteed to be called.
+ // If either signal returns true, the change processing is NOT performed
+ // (so don't return true unless you know what you're doing!)
+ bool abortProcessing = false;
+ if (passesFilter)
+ {
+ abortProcessing = mPassedFilter(payload);
+ }
+ else
+ {
+ abortProcessing = mFailedFilter(payload);
+ }
+
+ if (abortProcessing)
+ {
+ return true;
+ }
+
+ if (cmd == "load")
+ {
+ // should be no reason we'd ever get a load if we already have it
+ // if passes filter send a load message, else do nothing
+ assert(!wasFound);
+ if (passesFilter)
+ {
+ // not in our list, add it and say so
+ mItems.insert(pNotification);
+ abortProcessing = mChanged(payload);
+ onLoad(pNotification);
+ }
+ }
+ else if (cmd == "change")
+ {
+ // if it passes filter now and was found, we just send a change message
+ // if it passes filter now and wasn't found, we have to add it
+ // if it doesn't pass filter and wasn't found, we do nothing
+ // if it doesn't pass filter and was found, we need to delete it
+ if (passesFilter)
+ {
+ if (wasFound)
+ {
+ // it already existed, so this is a change
+ // since it changed in place, all we have to do is resend the signal
+ abortProcessing = mChanged(payload);
+ onChange(pNotification);
+ }
+ else
+ {
+ // not in our list, add it and say so
+ mItems.insert(pNotification);
+ // our payload is const, so make a copy before changing it
+ LLSD newpayload = payload;
+ newpayload["sigtype"] = "add";
+ abortProcessing = mChanged(newpayload);
+ onChange(pNotification);
+ }
+ }
+ else
+ {
+ if (wasFound)
+ {
+ // it already existed, so this is a delete
+ mItems.erase(pNotification);
+ // our payload is const, so make a copy before changing it
+ LLSD newpayload = payload;
+ newpayload["sigtype"] = "delete";
+ abortProcessing = mChanged(newpayload);
+ onChange(pNotification);
+ }
+ // didn't pass, not on our list, do nothing
+ }
+ }
+ else if (cmd == "add")
+ {
+ // should be no reason we'd ever get an add if we already have it
+ // if passes filter send an add message, else do nothing
+ assert(!wasFound);
+ if (passesFilter)
+ {
+ // not in our list, add it and say so
+ mItems.insert(pNotification);
+ abortProcessing = mChanged(payload);
+ onAdd(pNotification);
+ }
+ }
+ else if (cmd == "delete")
+ {
+ // if we have it in our list, pass on the delete, then delete it, else do nothing
+ if (wasFound)
+ {
+ abortProcessing = mChanged(payload);
+ mItems.erase(pNotification);
+ onDelete(pNotification);
+ }
+ }
+ return abortProcessing;
+}
+
+/* static */
+LLNotificationChannelPtr LLNotificationChannel::buildChannel(const std::string& name,
+ const std::string& parent,
+ LLNotificationFilter filter,
+ LLNotificationComparator comparator)
+{
+ // note: this is not a leak; notifications are self-registering.
+ // This factory helps to prevent excess deletions by making sure all smart
+ // pointers to notification channels come from the same source
+ new LLNotificationChannel(name, parent, filter, comparator);
+ return LLNotifications::instance().getChannel(name);
+}
+
+
+LLNotificationChannel::LLNotificationChannel(const std::string& name,
+ const std::string& parent,
+ LLNotificationFilter filter,
+ LLNotificationComparator comparator) :
+LLNotificationChannelBase(filter, comparator),
+mName(name),
+mParent(parent)
+{
+ // store myself in the channel map
+ LLNotifications::instance().addChannel(LLNotificationChannelPtr(this));
+ // bind to notification broadcast
+ if (parent.empty())
+ {
+ LLNotifications::instance().connectChanged(
+ boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
+ }
+ else
+ {
+ LLNotificationChannelPtr p = LLNotifications::instance().getChannel(parent);
+ p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
+ }
+}
+
+
+void LLNotificationChannel::setComparator(LLNotificationComparator comparator)
+{
+ mComparator = comparator;
+ LLNotificationSet s2(mComparator);
+ s2.insert(mItems.begin(), mItems.end());
+ mItems.swap(s2);
+
+ // notify clients that we've been resorted
+ mChanged(LLSD().insert("sigtype", "sort"));
+}
+
+bool LLNotificationChannel::isEmpty() const
+{
+ return mItems.empty();
+}
+
+LLNotificationChannel::Iterator LLNotificationChannel::begin()
+{
+ return mItems.begin();
+}
+
+LLNotificationChannel::Iterator LLNotificationChannel::end()
+{
+ return mItems.end();
+}
+
+std::string LLNotificationChannel::summarize()
+{
+ std::string s("Channel '");
+ s += mName;
+ s += "'\n ";
+ for (LLNotificationChannel::Iterator it = begin(); it != end(); ++it)
+ {
+ s += (*it)->summarize();
+ s += "\n ";
+ }
+ return s;
+}
+
+
+// ---
+// END OF LLNotificationChannel implementation
+// =========================================================
+
+
+// =========================================================
+// LLNotifications implementation
+// ---
+LLNotifications::LLNotifications() : LLNotificationChannelBase(LLNotificationFilters::includeEverything,
+ LLNotificationComparators::orderByUUID()),
+ mIgnoreAllNotifications(false)
+{
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2));
+
+ mListener.reset(new LLNotificationsListener(*this));
+}
+
+
+// The expiration channel gets all notifications that are cancelled
+bool LLNotifications::expirationFilter(LLNotificationPtr pNotification)
+{
+ return pNotification->isCancelled() || pNotification->isRespondedTo();
+}
+
+bool LLNotifications::expirationHandler(const LLSD& payload)
+{
+ if (payload["sigtype"].asString() != "delete")
+ {
+ // anything added to this channel actually should be deleted from the master
+ cancel(find(payload["id"]));
+ return true; // don't process this item any further
+ }
+ return false;
+}
+
+bool LLNotifications::uniqueFilter(LLNotificationPtr pNotif)
+{
+ if (!pNotif->hasUniquenessConstraints())
+ {
+ return true;
+ }
+
+ // checks against existing unique notifications
+ for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName());
+ existing_it != mUniqueNotifications.end();
+ ++existing_it)
+ {
+ LLNotificationPtr existing_notification = existing_it->second;
+ if (pNotif != existing_notification
+ && pNotif->isEquivalentTo(existing_notification))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool LLNotifications::uniqueHandler(const LLSD& payload)
+{
+ LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
+ if (pNotif && pNotif->hasUniquenessConstraints())
+ {
+ if (payload["sigtype"].asString() == "add")
+ {
+ // not a duplicate according to uniqueness criteria, so we keep it
+ // and store it for future uniqueness checks
+ mUniqueNotifications.insert(std::make_pair(pNotif->getName(), pNotif));
+ }
+ else if (payload["sigtype"].asString() == "delete")
+ {
+ mUniqueNotifications.erase(pNotif->getName());
+ }
+ }
+
+ return false;
+}
+
+bool LLNotifications::failedUniquenessTest(const LLSD& payload)
+{
+ LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID());
+
+ if (!pNotif || !pNotif->hasUniquenessConstraints())
+ {
+ return false;
+ }
+
+ // checks against existing unique notifications
+ for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName());
+ existing_it != mUniqueNotifications.end();
+ ++existing_it)
+ {
+ LLNotificationPtr existing_notification = existing_it->second;
+ if (pNotif != existing_notification
+ && pNotif->isEquivalentTo(existing_notification))
+ {
+ // copy notification instance data over to oldest instance
+ // of this unique notification and update it
+ existing_notification->updateFrom(pNotif);
+ // then delete the new one
+ pNotif->cancel();
+ }
+ }
+
+ return false;
+}
+
+
+void LLNotifications::addChannel(LLNotificationChannelPtr pChan)
+{
+ mChannels[pChan->getName()] = pChan;
+}
+
+LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelName)
+{
+ ChannelMap::iterator p = mChannels.find(channelName);
+ if(p == mChannels.end())
+ {
+ llerrs << "Did not find channel named " << channelName << llendl;
+ }
+ return p->second;
+}
+
+
+// this function is called once at construction time, after the object is constructed.
+void LLNotifications::initSingleton()
+{
+ loadTemplates();
+ createDefaultChannels();
+}
+
+void LLNotifications::createDefaultChannels()
+{
+ // now construct the various channels AFTER loading the notifications,
+ // because the history channel is going to rewrite the stored notifications file
+ LLNotificationChannel::buildChannel("Expiration", "",
+ boost::bind(&LLNotifications::expirationFilter, this, _1));
+ LLNotificationChannel::buildChannel("Unexpired", "",
+ !boost::bind(&LLNotifications::expirationFilter, this, _1)); // use negated bind
+ LLNotificationChannel::buildChannel("Unique", "Unexpired",
+ boost::bind(&LLNotifications::uniqueFilter, this, _1));
+ LLNotificationChannel::buildChannel("Ignore", "Unique",
+ filterIgnoredNotifications);
+ LLNotificationChannel::buildChannel("Visible", "Ignore",
+ &LLNotificationFilters::includeEverything);
+
+ // create special history channel
+ //std::string notifications_log_file = gDirUtilp->getExpandedFilename ( LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml" );
+ // use ^^^ when done debugging notifications serialization
+ std::string notifications_log_file = gDirUtilp->getExpandedFilename ( LL_PATH_USER_SETTINGS, "open_notifications.xml" );
+ // this isn't a leak, don't worry about the empty "new"
+ new LLNotificationHistoryChannel(notifications_log_file);
+
+ // connect action methods to these channels
+ LLNotifications::instance().getChannel("Expiration")->
+ connectChanged(boost::bind(&LLNotifications::expirationHandler, this, _1));
+ // uniqueHandler slot should be added as first slot of the signal due to
+ // usage LLStopWhenHandled combiner in LLStandardSignal
+ LLNotifications::instance().getChannel("Unique")->
+ connectAtFrontChanged(boost::bind(&LLNotifications::uniqueHandler, this, _1));
+// failedUniquenessTest slot isn't necessary
+// LLNotifications::instance().getChannel("Unique")->
+// connectFailedFilter(boost::bind(&LLNotifications::failedUniquenessTest, this, _1));
+ LLNotifications::instance().getChannel("Ignore")->
+ connectFailedFilter(&handleIgnoredNotification);
+}
+
+bool LLNotifications::addTemplate(const std::string &name,
+ LLNotificationTemplatePtr theTemplate)
+{
+ if (mTemplates.count(name))
+ {
+ llwarns << "LLNotifications -- attempted to add template '" << name << "' twice." << llendl;
+ return false;
+ }
+ mTemplates[name] = theTemplate;
+ return true;
+}
+
+LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
+{
+ if (mTemplates.count(name))
+ {
+ return mTemplates[name];
+ }
+ else
+ {
+ return mTemplates["MissingAlert"];
+ }
+}
+
+bool LLNotifications::templateExists(const std::string& name)
+{
+ return (mTemplates.count(name) != 0);
+}
+
+void LLNotifications::clearTemplates()
+{
+ mTemplates.clear();
+}
+
+void LLNotifications::forceResponse(const LLNotification::Params& params, S32 option)
+{
+ LLNotificationPtr temp_notify(new LLNotification(params));
+ LLSD response = temp_notify->getResponseTemplate();
+ LLSD selected_item = temp_notify->getForm()->getElement(option);
+
+ if (selected_item.isUndefined())
+ {
+ llwarns << "Invalid option" << option << " for notification " << (std::string)params.name << llendl;
+ return;
+ }
+ response[selected_item["name"].asString()] = true;
+
+ temp_notify->respond(response);
+}
+
+LLNotifications::TemplateNames LLNotifications::getTemplateNames() const
+{
+ TemplateNames names;
+ for (TemplateMap::const_iterator it = mTemplates.begin(); it != mTemplates.end(); ++it)
+ {
+ names.push_back(it->first);
+ }
+ return names;
+}
+
+typedef std::map<std::string, std::string> StringMap;
+void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
+{
+ //llwarns << "replaceSubstitutionStrings" << llendl;
+ // walk the list of attributes looking for replacements
+ for (LLXMLAttribList::iterator it=node->mAttributes.begin();
+ it != node->mAttributes.end(); ++it)
+ {
+ std::string value = it->second->getValue();
+ if (value[0] == '$')
+ {
+ value.erase(0, 1); // trim off the $
+ std::string replacement;
+ StringMap::const_iterator found = replacements.find(value);
+ if (found != replacements.end())
+ {
+ replacement = found->second;
+ //llwarns << "replaceSubstituionStrings: value: " << value << " repl: " << replacement << llendl;
+
+ it->second->setValue(replacement);
+ }
+ else
+ {
+ llwarns << "replaceSubstituionStrings FAILURE: value: " << value << " repl: " << replacement << llendl;
+ }
+ }
+ }
+
+ // now walk the list of children and call this recursively.
+ for (LLXMLNodePtr child = node->getFirstChild();
+ child.notNull(); child = child->getNextSibling())
+ {
+ replaceSubstitutionStrings(child, replacements);
+ }
+}
+
+// private to this file
+// returns true if the template request was invalid and there's nothing else we
+// can do with this node, false if you should keep processing (it may have
+// replaced the contents of the node referred to)
+LLXMLNodePtr LLNotifications::checkForXMLTemplate(LLXMLNodePtr item)
+{
+ if (item->hasName("usetemplate"))
+ {
+ std::string replacementName;
+ if (item->getAttributeString("name", replacementName))
+ {
+ StringMap replacements;
+ for (LLXMLAttribList::const_iterator it=item->mAttributes.begin();
+ it != item->mAttributes.end(); ++it)
+ {
+ replacements[it->second->getName()->mString] = it->second->getValue();
+ }
+ if (mXmlTemplates.count(replacementName))
+ {
+ item=LLXMLNode::replaceNode(item, mXmlTemplates[replacementName]);
+
+ // walk the nodes looking for $(substitution) here and replace
+ replaceSubstitutionStrings(item, replacements);
+ }
+ else
+ {
+ llwarns << "XML template lookup failure on '" << replacementName << "' " << llendl;
+ }
+ }
+ }
+ return item;
+}
+
+bool LLNotifications::loadTemplates()
+{
+ const std::string xml_filename = "notifications.xml";
+ LLXMLNodePtr root;
+
+ BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
+
+ if (!success || root.isNull() || !root->hasName( "notifications" ))
+ {
+ llerrs << "Problem reading UI Notifications file: " << xml_filename << llendl;
+ return false;
+ }
+
+ clearTemplates();
+
+ for (LLXMLNodePtr item = root->getFirstChild();
+ item.notNull(); item = item->getNextSibling())
+ {
+ // we do this FIRST so that item can be changed if we
+ // encounter a usetemplate -- we just replace the
+ // current xml node and keep processing
+ item = checkForXMLTemplate(item);
+
+ if (item->hasName("global"))
+ {
+ std::string global_name;
+ if (item->getAttributeString("name", global_name))
+ {
+ mGlobalStrings[global_name] = item->getTextContents();
+ }
+ continue;
+ }
+
+ if (item->hasName("template"))
+ {
+ // store an xml template; templates must have a single node (can contain
+ // other nodes)
+ std::string name;
+ item->getAttributeString("name", name);
+ LLXMLNodePtr ptr = item->getFirstChild();
+ mXmlTemplates[name] = ptr;
+ continue;
+ }
+
+ if (!item->hasName("notification"))
+ {
+ llwarns << "Unexpected entity " << item->getName()->mString <<
+ " found in " << xml_filename << llendl;
+ continue;
+ }
+
+ // now we know we have a notification entry, so let's build it
+ LLNotificationTemplatePtr pTemplate(new LLNotificationTemplate());
+
+ if (!item->getAttributeString("name", pTemplate->mName))
+ {
+ llwarns << "Unable to parse notification with no name" << llendl;
+ continue;
+ }
+
+ //llinfos << "Parsing " << pTemplate->mName << llendl;
+
+ pTemplate->mMessage = item->getTextContents();
+ pTemplate->mDefaultFunctor = pTemplate->mName;
+ item->getAttributeString("type", pTemplate->mType);
+ item->getAttributeString("icon", pTemplate->mIcon);
+ item->getAttributeString("label", pTemplate->mLabel);
+ item->getAttributeU32("duration", pTemplate->mExpireSeconds);
+ item->getAttributeU32("expireOption", pTemplate->mExpireOption);
+
+ std::string priority;
+ item->getAttributeString("priority", priority);
+ pTemplate->mPriority = NOTIFICATION_PRIORITY_NORMAL;
+ if (!priority.empty())
+ {
+ if (priority == "low") pTemplate->mPriority = NOTIFICATION_PRIORITY_LOW;
+ if (priority == "normal") pTemplate->mPriority = NOTIFICATION_PRIORITY_NORMAL;
+ if (priority == "high") pTemplate->mPriority = NOTIFICATION_PRIORITY_HIGH;
+ if (priority == "critical") pTemplate->mPriority = NOTIFICATION_PRIORITY_CRITICAL;
+ }
+
+ item->getAttributeString("functor", pTemplate->mDefaultFunctor);
+
+ BOOL persist = false;
+ item->getAttributeBOOL("persist", persist);
+ pTemplate->mPersist = persist;
+
+ std::string sound;
+ item->getAttributeString("sound", sound);
+ if (!sound.empty())
+ {
+ // test for bad sound effect name / missing effect
+ if (LLUI::sSettingGroups["config"]->controlExists(sound))
+ {
+ pTemplate->mSoundEffect =
+ LLUUID(LLUI::sSettingGroups["config"]->getString(sound));
+ }
+ else
+ {
+ llwarns << "Unknown sound effect control name " << sound
+ << llendl;
+ }
+ }
+
+ for (LLXMLNodePtr child = item->getFirstChild();
+ !child.isNull(); child = child->getNextSibling())
+ {
+ child = checkForXMLTemplate(child);
+
+ // <url>
+ if (child->hasName("url"))
+ {
+ pTemplate->mURL = child->getTextContents();
+ child->getAttributeU32("option", pTemplate->mURLOption);
+ child->getAttributeU32("openexternally", pTemplate->mURLOpenExternally);
+ }
+
+ if (child->hasName("unique"))
+ {
+ pTemplate->mUnique = true;
+ for (LLXMLNodePtr formitem = child->getFirstChild();
+ !formitem.isNull(); formitem = formitem->getNextSibling())
+ {
+ if (formitem->hasName("context"))
+ {
+ std::string key;
+ formitem->getAttributeString("key", key);
+ pTemplate->mUniqueContext.push_back(key);
+ //llwarns << "adding " << key << " to unique context" << llendl;
+ }
+ else
+ {
+ llwarns << "'unique' has unrecognized subelement "
+ << formitem->getName()->mString << llendl;
+ }
+ }
+ }
+
+ // <form>
+ if (child->hasName("form"))
+ {
+ pTemplate->mForm = LLNotificationFormPtr(new LLNotificationForm(pTemplate->mName, child));
+ }
+ }
+ addTemplate(pTemplate->mName, pTemplate);
+ }
+
+ //std::ostringstream ostream;
+ //root->writeToOstream(ostream, "\n ");
+ //llwarns << ostream.str() << llendl;
+
+ return true;
+}
+
+// Add a simple notification (from XUI)
+void LLNotifications::addFromCallback(const LLSD& name)
+{
+ add(LLNotification::Params().name(name.asString()));
+}
+
+// we provide a couple of simple add notification functions so that it's reasonable to create notifications in one line
+LLNotificationPtr LLNotifications::add(const std::string& name,
+ const LLSD& substitutions,
+ const LLSD& payload)
+{
+ LLNotification::Params::Functor functor_p;
+ functor_p.name = name;
+ return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p));
+}
+
+LLNotificationPtr LLNotifications::add(const std::string& name,
+ const LLSD& substitutions,
+ const LLSD& payload,
+ const std::string& functor_name)
+{
+ LLNotification::Params::Functor functor_p;
+ functor_p.name = functor_name;
+ return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p));
+}
+
+LLNotificationPtr LLNotifications::add(const std::string& name,
+ const LLSD& substitutions,
+ const LLSD& payload,
+ LLNotificationFunctorRegistry::ResponseFunctor functor)
+{
+ LLNotification::Params::Functor functor_p;
+ functor_p.function = functor;
+ return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p));
+}
+
+// generalized add function that takes a parameter block object for more complex instantiations
+LLNotificationPtr LLNotifications::add(const LLNotification::Params& p)
+{
+ LLNotificationPtr pNotif(new LLNotification(p));
+ add(pNotif);
+ return pNotif;
+}
+
+
+void LLNotifications::add(const LLNotificationPtr pNotif)
+{
+ // first see if we already have it -- if so, that's a problem
+ LLNotificationSet::iterator it=mItems.find(pNotif);
+ if (it != mItems.end())
+ {
+ llerrs << "Notification added a second time to the master notification channel." << llendl;
+ }
+
+ updateItem(LLSD().insert("sigtype", "add").insert("id", pNotif->id()), pNotif);
+}
+
+void LLNotifications::cancel(LLNotificationPtr pNotif)
+{
+ LLNotificationSet::iterator it=mItems.find(pNotif);
+ if (it == mItems.end())
+ {
+ llerrs << "Attempted to delete nonexistent notification " << pNotif->getName() << llendl;
+ }
+ updateItem(LLSD().insert("sigtype", "delete").insert("id", pNotif->id()), pNotif);
+ pNotif->cancel();
+}
+
+void LLNotifications::update(const LLNotificationPtr pNotif)
+{
+ LLNotificationSet::iterator it=mItems.find(pNotif);
+ if (it != mItems.end())
+ {
+ updateItem(LLSD().insert("sigtype", "change").insert("id", pNotif->id()), pNotif);
+ }
+}
+
+
+LLNotificationPtr LLNotifications::find(LLUUID uuid)
+{
+ LLNotificationPtr target = LLNotificationPtr(new LLNotification(uuid));
+ LLNotificationSet::iterator it=mItems.find(target);
+ if (it == mItems.end())
+ {
+ llwarns << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl;
+ return LLNotificationPtr((LLNotification*)NULL);
+ }
+ else
+ {
+ return *it;
+ }
+}
+
+void LLNotifications::forEachNotification(NotificationProcess process)
+{
+ std::for_each(mItems.begin(), mItems.end(), process);
+}
+
+std::string LLNotifications::getGlobalString(const std::string& key) const
+{
+ GlobalStringMap::const_iterator it = mGlobalStrings.find(key);
+ if (it != mGlobalStrings.end())
+ {
+ return it->second;
+ }
+ else
+ {
+ // if we don't have the key as a global, return the key itself so that the error
+ // is self-diagnosing.
+ return key;
+ }
+}
+
+void LLNotifications::setIgnoreAllNotifications(bool setting)
+{
+ mIgnoreAllNotifications = setting;
+}
+bool LLNotifications::getIgnoreAllNotifications()
+{
+ return mIgnoreAllNotifications;
+}
+
+// ---
+// END OF LLNotifications implementation
+// =========================================================
+
+std::ostream& operator<<(std::ostream& s, const LLNotification& notification)
+{
+ s << notification.summarize();
+ return s;
+}
+
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 19895c3293..0335a265b6 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -103,6 +103,7 @@
#include "llpointer.h"
#include "llinitparam.h"
#include "llxmlnode.h"
+#include "llnotificationslistener.h"
class LLNotification;
typedef boost::shared_ptr<LLNotification> LLNotificationPtr;
@@ -813,9 +814,19 @@ private:
LLNotificationComparator mComparator;
};
-
+// An interface class to provide a clean linker seam to the LLNotifications class.
+// Extend this interface as needed for your use of LLNotifications.
+class LLNotificationsInterface
+{
+public:
+ virtual LLNotificationPtr add(const std::string& name,
+ const LLSD& substitutions,
+ const LLSD& payload,
+ LLNotificationFunctorRegistry::ResponseFunctor functor) = 0;
+};
class LLNotifications :
+ public LLNotificationsInterface,
public LLSingleton<LLNotifications>,
public LLNotificationChannelBase
{
@@ -839,7 +850,7 @@ public:
const LLSD& substitutions,
const LLSD& payload,
const std::string& functor_name);
- LLNotificationPtr add(const std::string& name,
+ /* virtual */ LLNotificationPtr add(const std::string& name,
const LLSD& substitutions,
const LLSD& payload,
LLNotificationFunctorRegistry::ResponseFunctor functor);
@@ -918,6 +929,8 @@ private:
GlobalStringMap mGlobalStrings;
bool mIgnoreAllNotifications;
+
+ boost::scoped_ptr<LLNotificationsListener> mListener;
};
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
new file mode 100644
index 0000000000..75f4d6177d
--- /dev/null
+++ b/indra/llui/llnotificationslistener.cpp
@@ -0,0 +1,55 @@
+/**
+ * @file llnotificationslistener.cpp
+ * @author Brad Kittenbrink
+ * @date 2009-07-08
+ * @brief Implementation for llnotificationslistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "llnotificationslistener.h"
+
+#include "llnotifications.h"
+
+LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
+ LLDispatchListener("LLNotifications", "op"),
+ mNotifications(notifications)
+{
+ add("requestAdd", &LLNotificationsListener::requestAdd);
+}
+
+void LLNotificationsListener::requestAdd(const LLSD& event_data) const
+{
+ if(event_data.has("reply"))
+ {
+ mNotifications.add(event_data["name"],
+ event_data["substitutions"],
+ event_data["payload"],
+ boost::bind(&LLNotificationsListener::NotificationResponder,
+ this,
+ event_data["reply"].asString(),
+ _1, _2
+ )
+ );
+ }
+ else
+ {
+ mNotifications.add(event_data["name"],
+ event_data["substitutions"],
+ event_data["payload"]);
+ }
+}
+
+void LLNotificationsListener::NotificationResponder(const std::string& reply_pump,
+ const LLSD& notification,
+ const LLSD& response) const
+{
+ LLSD reponse_event;
+ reponse_event["notification"] = notification;
+ reponse_event["response"] = response;
+ LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event);
+}
diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h
new file mode 100644
index 0000000000..6f71a7c781
--- /dev/null
+++ b/indra/llui/llnotificationslistener.h
@@ -0,0 +1,34 @@
+/**
+ * @file llnotificationslistener.h
+ * @author Brad Kittenbrink
+ * @date 2009-07-08
+ * @brief Wrap subset of LLNotifications API in event API for test scripts.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLNOTIFICATIONSLISTENER_H
+#define LL_LLNOTIFICATIONSLISTENER_H
+
+#include "lleventdispatcher.h"
+
+class LLNotifications;
+class LLSD;
+
+class LLNotificationsListener : public LLDispatchListener
+{
+public:
+ LLNotificationsListener(LLNotifications & notifications);
+
+ void requestAdd(LLSD const & event_data) const;
+
+private:
+ void NotificationResponder(const std::string& replypump,
+ const LLSD& notification,
+ const LLSD& response) const;
+ LLNotifications & mNotifications;
+};
+
+#endif // LL_LLNOTIFICATIONSLISTENER_H
diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp
index 07b6895378..f86776384a 100644
--- a/indra/llui/llslider.cpp
+++ b/indra/llui/llslider.cpp
@@ -43,6 +43,8 @@
#include "lluictrlfactory.h"
static LLDefaultChildRegistry::Register<LLSlider> r1("slider_bar");
+//FIXME: make this into an unregistered template so that code constructed sliders don't
+// have ambigious template lookup problem
LLSlider::Params::Params()
: track_color("track_color"),
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 15584c8dc7..675a29a8b4 100644
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -396,4 +396,3 @@ void LLSliderCtrl::reportInvalidData()
make_ui_sound("UISndBadKeystroke");
}
-
diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp
index 24efcb8ae8..7a531e0fbf 100644
--- a/indra/llvfs/lldir_linux.cpp
+++ b/indra/llvfs/lldir_linux.cpp
@@ -383,7 +383,7 @@ BOOL LLDir_Linux::fileExists(const std::string &filename) const
/*virtual*/ std::string LLDir_Linux::getLLPluginLauncher()
{
- return gDirUtilp->getLLPluginDir() + gDirUtilp->getDirDelimiter() +
+ return gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() +
"SLPlugin";
}
diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp
index 9be787df11..3e296831ae 100644
--- a/indra/llvfs/lldir_mac.cpp
+++ b/indra/llvfs/lldir_mac.cpp
@@ -424,7 +424,7 @@ BOOL LLDir_Mac::fileExists(const std::string &filename) const
/*virtual*/ std::string LLDir_Mac::getLLPluginLauncher()
{
- return gDirUtilp->getLLPluginDir() + gDirUtilp->getDirDelimiter() +
+ return gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() +
"SLPlugin";
}
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index 872f2cf1c1..3e302764de 100644
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -397,7 +397,7 @@ BOOL LLDir_Win32::fileExists(const std::string &filename) const
/*virtual*/ std::string LLDir_Win32::getLLPluginLauncher()
{
- return gDirUtilp->getLLPluginDir() + gDirUtilp->getDirDelimiter() +
+ return gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() +
"SLPlugin.exe";
}
diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp
index 7ee09f4a24..48736d9207 100644
--- a/indra/llwindow/llwindowmesaheadless.cpp
+++ b/indra/llwindow/llwindowmesaheadless.cpp
@@ -45,7 +45,7 @@ U16 *gMesaBuffer = NULL;
// LLWindowMesaHeadless
//
LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
- const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
+ const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clearBg,
BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth)
: LLWindow(callbacks, fullscreen, flags)
diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h
index 22e0ec126d..46b62b914c 100644
--- a/indra/llwindow/llwindowmesaheadless.h
+++ b/indra/llwindow/llwindowmesaheadless.h
@@ -99,7 +99,7 @@ public:
/*virtual*/ void bringToFront() {};
LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
- const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
+ const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clearBg,
BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
~LLWindowMesaHeadless();
diff --git a/indra/llxuixml/lluicolor.cpp b/indra/llxuixml/lluicolor.cpp
index ef0fa5d634..fe02907e14 100644
--- a/indra/llxuixml/lluicolor.cpp
+++ b/indra/llxuixml/lluicolor.cpp
@@ -7,6 +7,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "lluicolor.h"
LLUIColor::LLUIColor()
diff --git a/indra/lscript/lscript_execute/llscriptresource.cpp b/indra/lscript/lscript_execute/llscriptresource.cpp
index 6c4776c2e4..cd3696ab3f 100644
--- a/indra/lscript/lscript_execute/llscriptresource.cpp
+++ b/indra/lscript/lscript_execute/llscriptresource.cpp
@@ -30,6 +30,8 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "llscriptresource.h"
#include "llerror.h"
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 2e210e41c9..2faa9b1df1 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -36,10 +36,7 @@ include(UI)
include(UnixInstall)
include(LLKDU)
include(ViewerMiscLibs)
-
-if (WINDOWS)
- include(CopyWinLibs)
-endif (WINDOWS)
+include(LLLogin)
include_directories(
${DBUSGLIB_INCLUDE_DIRS}
@@ -61,12 +58,14 @@ include_directories(
${LLXUIXML_INCLUDE_DIRS}
${LSCRIPT_INCLUDE_DIRS}
${LSCRIPT_INCLUDE_DIRS}/lscript_compile
+ ${LLLOGIN_INCLUDE_DIRS}
)
set(viewer_SOURCE_FILES
llaccordionctrltab.cpp
llaccordionctrl.cpp
llagent.cpp
+ llagentlistener.cpp
llagentaccess.cpp
llagentdata.cpp
llagentlanguage.cpp
@@ -76,6 +75,7 @@ set(viewer_SOURCE_FILES
llanimstatelabels.cpp
llappearancemgr.cpp
llappviewer.cpp
+ llappviewerlistener.cpp
llassetuploadresponders.cpp
llassetuploadqueue.cpp
llaudiosourcevo.cpp
@@ -253,6 +253,7 @@ set(viewer_SOURCE_FILES
llurllineeditorctrl.cpp
lllogchat.cpp
llloginhandler.cpp
+ lllogininstance.cpp
llmanip.cpp
llmaniprotate.cpp
llmanipscale.cpp
@@ -325,6 +326,7 @@ set(viewer_SOURCE_FILES
llpanelpicks.cpp
llpanelplace.cpp
llpanelplaceinfo.cpp
+ llpanelshower.cpp
llpanelplaces.cpp
llpanelplacestab.cpp
llpanelprofile.cpp
@@ -359,7 +361,6 @@ set(viewer_SOURCE_FILES
llspatialpartition.cpp
llsplitbutton.cpp
llsprite.cpp
- llsrv.cpp
llstartup.cpp
llstatusbar.cpp
llstylemap.cpp
@@ -403,19 +404,20 @@ set(viewer_SOURCE_FILES
lltoolselectland.cpp
lltoolselectrect.cpp
lltracker.cpp
+ lluilistener.cpp
lluploaddialog.cpp
llurl.cpp
llurldispatcher.cpp
llurlhistory.cpp
llurlsimstring.cpp
llurlwhitelist.cpp
- lluserauth.cpp
llvectorperfoptions.cpp
llviewchildren.cpp
llviewerassetstorage.cpp
llvieweraudio.cpp
llviewercamera.cpp
llviewercontrol.cpp
+ llviewercontrollistener.cpp
llviewerdisplay.cpp
llviewerfloaterreg.cpp
llviewergenericmessage.cpp
@@ -455,6 +457,7 @@ set(viewer_SOURCE_FILES
llviewerthrottle.cpp
llviewervisualparam.cpp
llviewerwindow.cpp
+ llviewerwindowlistener.cpp
llvlcomposition.cpp
llvlmanager.cpp
llvoavatar.cpp
@@ -493,6 +496,7 @@ set(viewer_SOURCE_FILES
llworld.cpp
llworldmap.cpp
llworldmapview.cpp
+ llxmlrpclistener.cpp
llxmlrpctransaction.cpp
noise.cpp
pipeline.cpp
@@ -521,6 +525,7 @@ set(viewer_HEADER_FILES
llaccordionctrltab.h
llaccordionctrl.h
llagent.h
+ llagentlistener.h
llagentaccess.h
llagentdata.h
llagentlanguage.h
@@ -530,6 +535,7 @@ set(viewer_HEADER_FILES
llanimstatelabels.h
llappearance.h
llappviewer.h
+ llappviewerlistener.h
llassetuploadresponders.h
llassetuploadqueue.h
llaudiosourcevo.h
@@ -710,6 +716,7 @@ set(viewer_HEADER_FILES
llurllineeditorctrl.h
lllogchat.h
llloginhandler.h
+ lllogininstance.h
llmanip.h
llmaniprotate.h
llmanipscale.h
@@ -780,6 +787,7 @@ set(viewer_HEADER_FILES
llpanelpicks.h
llpanelplace.h
llpanelplaceinfo.h
+ llpanelshower.h
llpanelplaces.h
llpanelplacestab.h
llpanelprofile.h
@@ -816,7 +824,6 @@ set(viewer_HEADER_FILES
llspatialpartition.h
llsplitbutton.h
llsprite.h
- llsrv.h
llstartup.h
llstatusbar.h
llstylemap.h
@@ -862,13 +869,13 @@ set(viewer_HEADER_FILES
lltoolselectrect.h
lltracker.h
lluiconstants.h
+ lluilistener.h
lluploaddialog.h
llurl.h
llurldispatcher.h
llurlhistory.h
llurlsimstring.h
llurlwhitelist.h
- lluserauth.h
llvectorperfoptions.h
llviewchildren.h
llviewerassetstorage.h
@@ -876,6 +883,7 @@ set(viewer_HEADER_FILES
llviewerbuild.h
llviewercamera.h
llviewercontrol.h
+ llviewercontrollistener.h
llviewerdisplay.h
llviewerfloaterreg.h
llviewergenericmessage.h
@@ -913,6 +921,7 @@ set(viewer_HEADER_FILES
llviewerthrottle.h
llviewervisualparam.h
llviewerwindow.h
+ llviewerwindowlistener.h
llvlcomposition.h
llvlmanager.h
llvoavatar.h
@@ -953,6 +962,7 @@ set(viewer_HEADER_FILES
llworld.h
llworldmap.h
llworldmapview.h
+ llxmlrpclistener.h
llxmlrpctransaction.h
macmain.h
noise.h
@@ -1155,6 +1165,15 @@ file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST
${CMAKE_CURRENT_SOURCE_DIR}/skins/default/xui/en/widgets/*.xml)
list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST})
+file(GLOB SILVER_XUI_FILE_GLOB_LIST
+ ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/*.xml)
+list(APPEND viewer_XUI_FILES ${SILVER_XUI_FILE_GLOB_LIST})
+
+# Cannot append empty lists in CMake, wait until we have files here.
+#file(GLOB SILVER_WIDGET_FILE_GLOB_LIST
+# ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml)
+#list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST})
+
list(SORT viewer_XUI_FILES)
source_group("XUI Files" FILES ${viewer_XUI_FILES})
@@ -1265,6 +1284,11 @@ if (LLKDU_LIBRARY)
add_dependencies(${VIEWER_BINARY_NAME} ${LLKDU_LIBRARY})
endif (LLKDU_LIBRARY)
+# add package files
+file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST
+ ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py)
+list(APPEND EVENT_HOST_SCRIPTS ${EVENT_HOST_SCRIPT_GLOB_LIST})
+
set(PACKAGE OFF CACHE BOOL
"Add a package target that builds an installer package.")
@@ -1321,7 +1345,42 @@ if (WINDOWS)
COMMENT "Copying message.xml to the runtime folder."
)
- add_dependencies(${VIEWER_BINARY_NAME} copy_win_libs)
+ if(WINDOWS)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${VIEWER_BINARY_NAME}.exe.config
+ COMMAND ${PYTHON_EXECUTABLE}
+ ARGS
+ ${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
+ ${CMAKE_CFG_INTDIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
+ ${VIEWER_BINARY_NAME}.exe.config
+ COMMENT "Creating app.config file"
+ )
+
+ add_custom_target(create_app_config_file ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${VIEWER_BINARY_NAME}.exe.config
+ stage_third_party_libs
+ )
+
+ # Copy Win Libs...
+ # This happens at build time, not config time. We can't glob files in this cmake.
+ # *FIX:Mani Write a sub script to glob the files...
+ add_custom_command(
+ TARGET create_app_config_file PRE_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS
+ -E
+ copy_directory
+ ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
+ COMMENT "Copying staged dlls."
+ )
+
+ add_dependencies(${VIEWER_BINARY_NAME} create_app_config_file)
+
+ endif(WINDOWS)
if (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts)
add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts)
@@ -1347,8 +1406,27 @@ if (WINDOWS)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit)
if (PACKAGE)
- add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2
+ COMMAND ${PYTHON_EXECUTABLE}
+ ARGS
+ ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/..
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CFG_INTDIR}
+
+ DEPENDS
+ lleventhost
+ ${EVENT_HOST_SCRIPTS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py)
+
+ add_custom_target(package ALL
+ DEPENDS
+ ${CMAKE_CFG_INTDIR}/touched.bat
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2)
add_dependencies(package windows-updater windows-crash-logger)
+
+
endif (PACKAGE)
endif (WINDOWS)
@@ -1385,6 +1463,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${WINDOWS_LIBRARIES}
${XMLRPCEPI_LIBRARIES}
${ELFIO_LIBRARIES}
+ ${LLLOGIN_LIBRARIES}
${GOOGLE_PERFTOOLS_LIBRARIES}
)
@@ -1515,6 +1594,7 @@ endif (INSTALL)
include(LLAddBuildTest)
SET(viewer_TEST_SOURCE_FILES
llagentaccess.cpp
+ lllogininstance.cpp
)
set_source_files_properties(
${viewer_TEST_SOURCE_FILES}
@@ -1546,6 +1626,16 @@ LL_ADD_INTEGRATION_TEST(llcapabilitylistener
# Don't do these for DARWIN or LINUX here -- they're taken care of by viewer_manifest.py
if (WINDOWS)
+ add_custom_command(
+ TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS
+ -E
+ make_directory
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
+ COMMENT "Creating llplugin dir."
+ )
+
get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
@@ -1554,7 +1644,7 @@ if (WINDOWS)
-E
copy_if_different
${BUILT_SLPLUGIN}
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
COMMENT "Copying SLPlugin executable to the runtime folder."
)
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index bbe69531b4..498d8b2e3b 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5304,6 +5304,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>QAModeEventHostPort</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable Testing Features.</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>-1</integer>
+ </map>
<key>QuietSnapshotsToDisk</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/build_win32_appConfig.py b/indra/newview/build_win32_appConfig.py
index fb6a0258bc..8eadf0068f 100644
--- a/indra/newview/build_win32_appConfig.py
+++ b/indra/newview/build_win32_appConfig.py
@@ -31,11 +31,7 @@
import sys, os, re
from xml.dom.minidom import parse
-def main():
- src_manifest_name = sys.argv[1]
- src_config_name = sys.argv[2]
- dst_config_name = sys.argv[3]
-
+def munge_binding_redirect_version(src_manifest_name, src_config_name, dst_config_name):
manifest_dom = parse(src_manifest_name)
node = manifest_dom.getElementsByTagName('assemblyIdentity')[0]
manifest_assm_ver = node.getAttribute('version')
@@ -47,11 +43,31 @@ def main():
node.setAttribute('oldVersion', src_old_ver + manifest_assm_ver)
comment = config_dom.createComment("This file is automatically generated by the build. see indra/newview/build_win32_appConfig.py")
config_dom.insertBefore(comment, config_dom.childNodes[0])
-
+
+ print "Writing: " + dst_config_name
f = open(dst_config_name, 'w')
config_dom.writexml(f)
f.close()
+
+
+
+def main():
+ config = sys.argv[1]
+ src_dir = sys.argv[2]
+ dst_dir = sys.argv[3]
+ dst_name = sys.argv[4]
+
+ if config.lower() == 'debug':
+ src_manifest_name = dst_dir + '/Microsoft.VC80.DebugCRT.manifest'
+ src_config_name = src_dir + '/SecondLifeDebug.exe.config'
+ else:
+ src_manifest_name = dst_dir + '/Microsoft.VC80.CRT.manifest'
+ src_config_name = src_dir + '/SecondLife.exe.config'
+
+ dst_config_name = dst_dir + '/' + dst_name
+ munge_binding_redirect_version(src_manifest_name, src_config_name, dst_config_name)
+
return 0
if __name__ == "__main__":
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 08681db6cb..ab9db303b5 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -35,6 +35,7 @@
#include "llagent.h"
#include "llagentwearables.h"
+#include "llagentlistener.h"
#include "llanimationstates.h"
#include "llcallingcard.h"
#include "llconsole.h"
@@ -256,6 +257,7 @@ LLAgent::LLAgent() :
mHUDTargetZoom(1.f),
mHUDCurZoom(1.f),
mInitialized(FALSE),
+ mListener(),
mForceMouselook(FALSE),
mDoubleTapRunTimer(),
@@ -384,6 +386,8 @@ LLAgent::LLAgent() :
}
mFollowCam.setMaxCameraDistantFromSubject( MAX_CAMERA_DISTANCE_FROM_AGENT );
+
+ mListener.reset(new LLAgentListener(*this));
}
// Requires gSavedSettings to be initialized.
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 5ca630f8d1..09400b3a88 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -105,6 +105,8 @@ struct LLGroupData
std::string mName;
};
+class LLAgentListener;
+
//------------------------------------------------------------------------
// LLAgent
//------------------------------------------------------------------------
@@ -142,6 +144,8 @@ public:
BOOL mInitialized;
BOOL mFirstLogin;
std::string mMOTD; // Message of the day
+private:
+ boost::shared_ptr<LLAgentListener> mListener;
//--------------------------------------------------------------------
// Session
diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp
new file mode 100644
index 0000000000..0f00078b33
--- /dev/null
+++ b/indra/newview/llagentlistener.cpp
@@ -0,0 +1,78 @@
+/**
+ * @file llagentlistener.cpp
+ * @author Brad Kittenbrink
+ * @date 2009-07-10
+ * @brief Implementation for llagentlistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llagentlistener.h"
+
+#include "llagent.h"
+#include "llcommandhandler.h"
+#include "llslurl.h"
+#include "llurldispatcher.h"
+#include "llviewerobject.h"
+#include "llviewerobjectlist.h"
+#include "llviewerregion.h"
+
+LLAgentListener::LLAgentListener(LLAgent &agent)
+ : LLDispatchListener("LLAgent", "op"),
+ mAgent(agent)
+{
+ add("requestTeleport", &LLAgentListener::requestTeleport);
+ add("requestSit", &LLAgentListener::requestSit);
+ add("requestStand", &LLAgentListener::requestStand);
+}
+
+void LLAgentListener::requestTeleport(LLSD const & event_data) const
+{
+ if(event_data["skip_confirmation"].asBoolean())
+ {
+ LLSD params(LLSD::emptyArray());
+ params.append(event_data["regionname"]);
+ params.append(event_data["x"]);
+ params.append(event_data["y"]);
+ params.append(event_data["z"]);
+ LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, true);
+ // *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "objectim", "parcel", "login", login_refresh", "balance", "chat"
+ // should we just compose LLCommandHandler and LLDispatchListener?
+ }
+ else
+ {
+ std::string url = LLSLURL::buildSLURL(event_data["regionname"], event_data["x"], event_data["y"], event_data["z"]);
+ LLURLDispatcher::dispatch(url, NULL, false);
+ }
+}
+
+void LLAgentListener::requestSit(LLSD const & event_data) const
+{
+ //mAgent.getAvatarObject()->sitOnObject();
+ // shamelessly ripped from llviewermenu.cpp:handle_sit_or_stand()
+ // *TODO - find a permanent place to share this code properly.
+ LLViewerObject *object = gObjectList.findObject(event_data["obj_uuid"]);
+
+ if (object && object->getPCode() == LL_PCODE_VOLUME)
+ {
+ gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit);
+ gMessageSystem->nextBlockFast(_PREHASH_AgentData);
+ gMessageSystem->addUUIDFast(_PREHASH_AgentID, mAgent.getID());
+ gMessageSystem->addUUIDFast(_PREHASH_SessionID, mAgent.getSessionID());
+ gMessageSystem->nextBlockFast(_PREHASH_TargetObject);
+ gMessageSystem->addUUIDFast(_PREHASH_TargetID, object->mID);
+ gMessageSystem->addVector3Fast(_PREHASH_Offset, LLVector3(0,0,0));
+
+ object->getRegion()->sendReliableMessage();
+ }
+}
+
+void LLAgentListener::requestStand(LLSD const & event_data) const
+{
+ mAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
+}
+
diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h
new file mode 100644
index 0000000000..6f0b5a54c5
--- /dev/null
+++ b/indra/newview/llagentlistener.h
@@ -0,0 +1,36 @@
+/**
+ * @file llagentlistener.h
+ * @author Brad Kittenbrink
+ * @date 2009-07-09
+ * @brief Event API for subset of LLViewerControl methods
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+
+#ifndef LL_LLAGENTLISTENER_H
+#define LL_LLAGENTLISTENER_H
+
+#include "lleventdispatcher.h"
+
+class LLAgent;
+class LLSD;
+
+class LLAgentListener : public LLDispatchListener
+{
+public:
+ LLAgentListener(LLAgent &agent);
+
+private:
+ void requestTeleport(LLSD const & event_data) const;
+ void requestSit(LLSD const & event_data) const;
+ void requestStand(LLSD const & event_data) const;
+
+private:
+ LLAgent & mAgent;
+};
+
+#endif // LL_LLAGENTLISTENER_H
+
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 19e1273dc6..ef1fa98b1f 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -72,6 +72,7 @@
#include "llurlhistory.h"
#include "llfirstuse.h"
#include "llrender.h"
+#include "llteleporthistory.h"
#include "lllocationhistory.h"
#include "llfasttimerview.h"
#include "llweb.h"
@@ -97,6 +98,10 @@
# include <sys/file.h> // For initMarkerFile support
#endif
+#include "llapr.h"
+#include "apr_dso.h"
+#include <boost/lexical_cast.hpp>
+
#include "llnotify.h"
#include "llviewerkeyboard.h"
#include "lllfsthread.h"
@@ -152,7 +157,6 @@
#include "llfolderview.h"
#include "lltoolbar.h"
#include "llagentpilot.h"
-#include "llsrv.h"
#include "llvovolume.h"
#include "llflexibleobject.h"
#include "llvosurfacepatch.h"
@@ -189,7 +193,10 @@
//----------------------------------------------------------------------------
// llviewernetwork.h
#include "llviewernetwork.h"
+// define a self-registering event API object
+#include "llappviewerlistener.h"
+static LLAppViewerListener sAppViewerListener("LLAppViewer", NULL);
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
//
@@ -215,9 +222,6 @@ BOOL gAllowTapTapHoldRun = TRUE;
BOOL gShowObjectUpdates = FALSE;
BOOL gUseQuickTime = TRUE;
-BOOL gAcceptTOS = FALSE;
-BOOL gAcceptCriticalMessage = FALSE;
-
eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL;
LLSD gDebugInfo;
@@ -562,9 +566,9 @@ LLAppViewer::LLAppViewer() :
mYieldTime(-1),
mMainloopTimeout(NULL),
mAgentRegionLastAlive(false),
- mFastTimerLogThread(NULL),
mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)),
- mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE))
+ mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)),
+ mFastTimerLogThread(NULL)
{
if(NULL != sInstance)
{
@@ -870,6 +874,11 @@ bool LLAppViewer::init()
LLViewerJoystick::getInstance()->init(false);
+ if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getS32("QAModeEventHostPort") > 0)
+ {
+ loadEventHostModule(gSavedSettings.getS32("QAModeEventHostPort"));
+ }
+
return true;
}
@@ -1163,6 +1172,20 @@ bool LLAppViewer::mainLoop()
bool LLAppViewer::cleanup()
{
+ // *TODO - generalize this and move DSO wrangling to a helper class -brad
+ std::set<struct apr_dso_handle_t *>::const_iterator i;
+ for(i = mPlugins.begin(); i != mPlugins.end(); ++i)
+ {
+ int (*ll_plugin_stop_func)(void) = NULL;
+ apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, *i, "ll_plugin_stop");
+ ll_plugin_stop_func();
+
+ // *NOTE - disabled unloading as partial solution to DEV-35406 crash on shutdown
+ //rv = apr_dso_unload(*i);
+ (void)rv;
+ }
+ mPlugins.clear();
+
//----------------------------------------------
//this test code will be removed after the test
//test manual call stack tracer
@@ -3655,6 +3678,17 @@ void LLAppViewer::idleShutdown()
{
return;
}
+
+ // ProductEngine: Try moving this code to where we shut down sTextureCache in cleanup()
+ // *TODO: ugly
+ static bool saved_teleport_history = false;
+ if (!saved_teleport_history)
+ {
+ saved_teleport_history = true;
+ LLTeleportHistory::getInstance()->dump();
+ LLLocationHistory::getInstance()->save(); // *TODO: find a better place for doing this
+ return;
+ }
static bool saved_snapshot = false;
if (!saved_snapshot)
@@ -3953,7 +3987,7 @@ void LLAppViewer::forceErrorBadMemoryAccess()
return;
}
-void LLAppViewer::forceErrorInifiniteLoop()
+void LLAppViewer::forceErrorInfiniteLoop()
{
while(true)
{
@@ -4074,3 +4108,198 @@ void LLAppViewer::handleLoginComplete()
writeDebugInfo();
}
+
+// *TODO - generalize this and move DSO wrangling to a helper class -brad
+void LLAppViewer::loadEventHostModule(S32 listen_port)
+{
+ std::string dso_name =
+#if LL_WINDOWS
+ "lleventhost.dll";
+#elif LL_DARWIN
+ "liblleventhost.dylib";
+#else
+ "liblleventhost.so";
+#endif
+
+ std::string dso_path = gDirUtilp->findFile(dso_name,
+ gDirUtilp->getAppRODataDir(),
+ gDirUtilp->getExecutableDir());
+
+ if(dso_path == "")
+ {
+ llwarns << "QAModeEventHost requested but module \"" << dso_name << "\" not found!" << llendl;
+ return;
+ }
+
+ apr_dso_handle_t * eventhost_dso_handle = NULL;
+ apr_pool_t * eventhost_dso_memory_pool = NULL;
+
+ //attempt to load the shared library
+ apr_pool_create(&eventhost_dso_memory_pool, NULL);
+ apr_status_t rv = apr_dso_load(&eventhost_dso_handle,
+ dso_path.c_str(),
+ eventhost_dso_memory_pool);
+ ll_apr_assert_status(rv);
+ llassert_always(eventhost_dso_handle != NULL);
+
+ int (*ll_plugin_start_func)(LLSD const &) = NULL;
+ rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_start_func, eventhost_dso_handle, "ll_plugin_start");
+
+ ll_apr_assert_status(rv);
+ llassert_always(ll_plugin_start_func != NULL);
+
+ LLSD args;
+ args["listen_port"] = listen_port;
+
+ int status = ll_plugin_start_func(args);
+
+ if(status != 0)
+ {
+ llwarns << "problem loading eventhost plugin, status: " << status << llendl;
+ }
+
+ mPlugins.insert(eventhost_dso_handle);
+}
+
+void LLAppViewer::launchUpdater()
+{
+ LLSD query_map = LLSD::emptyMap();
+ // *TODO place os string in a global constant
+#if LL_WINDOWS
+ query_map["os"] = "win";
+#elif LL_DARWIN
+ query_map["os"] = "mac";
+#elif LL_LINUX
+ query_map["os"] = "lnx";
+#elif LL_SOLARIS
+ query_map["os"] = "sol";
+#endif
+ // *TODO change userserver to be grid on both viewer and sim, since
+ // userserver no longer exists.
+ query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel();
+ query_map["channel"] = gSavedSettings.getString("VersionChannelName");
+ // *TODO constantize this guy
+ // *NOTE: This URL is also used in win_setup/lldownloader.cpp
+ LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
+
+ if(LLAppViewer::sUpdaterInfo)
+ {
+ delete LLAppViewer::sUpdaterInfo;
+ }
+ LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ;
+
+ // if a sim name was passed in via command line parameter (typically through a SLURL)
+ if ( LLURLSimString::sInstance.mSimString.length() )
+ {
+ // record the location to start at next time
+ gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString );
+ };
+
+#if LL_WINDOWS
+ LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename();
+ if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty())
+ {
+ delete LLAppViewer::sUpdaterInfo ;
+ LLAppViewer::sUpdaterInfo = NULL ;
+
+ // We're hosed, bail
+ LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL;
+ return;
+ }
+
+ LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe";
+
+ std::string updater_source = gDirUtilp->getAppRODataDir();
+ updater_source += gDirUtilp->getDirDelimiter();
+ updater_source += "updater.exe";
+
+ LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source
+ << " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath
+ << LL_ENDL;
+
+
+ if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE))
+ {
+ delete LLAppViewer::sUpdaterInfo ;
+ LLAppViewer::sUpdaterInfo = NULL ;
+
+ LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL;
+
+ return;
+ }
+
+ LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\"";
+
+ LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL;
+
+ //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird.
+ LLAppViewer::instance()->removeMarkerFile(); // In case updater fails
+
+ // *NOTE:Mani The updater is spawned as the last thing before the WinMain exit.
+ // see LLAppViewerWin32.cpp
+
+#elif LL_DARWIN
+ LLAppViewer::sUpdaterInfo->mUpdateExePath = "'";
+ LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir();
+ LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \"";
+ LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString();
+ LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \"";
+ LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle();
+ LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &";
+
+ LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
+
+ // Run the auto-updater.
+ system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
+
+#elif (LL_LINUX || LL_SOLARIS) && LL_GTK
+ // we tell the updater where to find the xml containing string
+ // translations which it can use for its own UI
+ std::string xml_strings_file = "strings.xml";
+ std::vector<std::string> xui_path_vec = LLUI::getXUIPaths();
+ std::string xml_search_paths;
+ std::vector<std::string>::const_iterator iter;
+ // build comma-delimited list of xml paths to pass to updater
+ for (iter = xui_path_vec.begin(); iter != xui_path_vec.end(); )
+ {
+ std::string this_skin_dir = gDirUtilp->getDefaultSkinDir()
+ + gDirUtilp->getDirDelimiter()
+ + (*iter);
+ llinfos << "Got a XUI path: " << this_skin_dir << llendl;
+ xml_search_paths.append(this_skin_dir);
+ ++iter;
+ if (iter != xui_path_vec.end())
+ xml_search_paths.append(","); // comma-delimit
+ }
+ // build the overall command-line to run the updater correctly
+ LLAppViewer::sUpdaterInfo->mUpdateExePath =
+ gDirUtilp->getExecutableDir() + "/" + "linux-updater.bin" +
+ " --url \"" + update_url.asString() + "\"" +
+ " --name \"" + LLAppViewer::instance()->getSecondLifeTitle() + "\"" +
+ " --dest \"" + gDirUtilp->getAppRODataDir() + "\"" +
+ " --stringsdir \"" + xml_search_paths + "\"" +
+ " --stringsfile \"" + xml_strings_file + "\"";
+
+ LL_INFOS("AppInit") << "Calling updater: "
+ << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
+
+ // *TODO: we could use the gdk equivalent to ensure the updater
+ // gets started on the same screen.
+ GError *error = NULL;
+ if (!g_spawn_command_line_async(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), &error))
+ {
+ llerrs << "Failed to launch updater: "
+ << error->message
+ << llendl;
+ }
+ if (error) {
+ g_error_free(error);
+ }
+#else
+ OSMessageBox(LLTrans::getString("MBNoAutoUpdate"), LLStringUtil::null, OSMB_OK);
+#endif
+
+ // *REMOVE:Mani - Saving for reference...
+ // LLAppViewer::instance()->forceQuit();
+}
+
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 646b677264..f95d7cb412 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -47,6 +47,8 @@ class LLVFS;
class LLWatchdogTimeout;
class LLWorkerThread;
+struct apr_dso_handle_t;
+
class LLAppViewer : public LLApp
{
@@ -124,7 +126,7 @@ public:
virtual void forceErrorLLError();
virtual void forceErrorBreakpoint();
virtual void forceErrorBadMemoryAccess();
- virtual void forceErrorInifiniteLoop();
+ virtual void forceErrorInfiniteLoop();
virtual void forceErrorSoftwareException();
virtual void forceErrorDriverCrash();
@@ -210,6 +212,8 @@ private:
void sendLogoutRequest();
void disconnectViewer();
+ void loadEventHostModule(S32 listen_port);
+
// *FIX: the app viewer class should be some sort of singleton, no?
// Perhaps its child class is the singleton and this should be an abstract base.
static LLAppViewer* sInstance;
@@ -255,6 +259,8 @@ private:
LLAllocator mAlloc;
+ std::set<struct apr_dso_handle_t*> mPlugins;
+
public:
//some information for updater
typedef struct
@@ -263,6 +269,8 @@ public:
std::ostringstream mParams;
}LLUpdaterInfo ;
static LLUpdaterInfo *sUpdaterInfo ;
+
+ void launchUpdater();
};
// consts from viewer.h
@@ -278,10 +286,6 @@ extern LLSD gDebugInfo;
extern BOOL gAllowTapTapHoldRun;
extern BOOL gShowObjectUpdates;
-extern BOOL gAcceptTOS;
-extern BOOL gAcceptCriticalMessage;
-
-
typedef enum
{
LAST_EXEC_NORMAL = 0,
diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp
new file mode 100644
index 0000000000..a3af251a3c
--- /dev/null
+++ b/indra/newview/llappviewerlistener.cpp
@@ -0,0 +1,37 @@
+/**
+ * @file llappviewerlistener.cpp
+ * @author Nat Goodspeed
+ * @date 2009-06-23
+ * @brief Implementation for llappviewerlistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "llviewerprecompiledheaders.h"
+// associated header
+#include "llappviewerlistener.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+#include "llappviewer.h"
+
+LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, LLAppViewer* llappviewer):
+ LLDispatchListener(pumpname, "op"),
+ mAppViewer(llappviewer)
+{
+ // add() every method we want to be able to invoke via this event API.
+ add("requestQuit", &LLAppViewerListener::requestQuit);
+}
+
+void LLAppViewerListener::requestQuit(const LLSD& event)
+{
+ if(mAppViewer == NULL)
+ {
+ mAppViewer = LLAppViewer::instance();
+ }
+ mAppViewer->requestQuit();
+}
diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h
new file mode 100644
index 0000000000..d702f605ef
--- /dev/null
+++ b/indra/newview/llappviewerlistener.h
@@ -0,0 +1,34 @@
+/**
+ * @file llappviewerlistener.h
+ * @author Nat Goodspeed
+ * @date 2009-06-18
+ * @brief Wrap subset of LLAppViewer API in event API
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLAPPVIEWERLISTENER_H)
+#define LL_LLAPPVIEWERLISTENER_H
+
+#include "lleventdispatcher.h"
+
+class LLAppViewer;
+class LLSD;
+
+/// Listen on an LLEventPump with specified name for LLAppViewer request events.
+class LLAppViewerListener: public LLDispatchListener
+{
+public:
+ /// Specify the pump name on which to listen, and bind the LLAppViewer
+ /// instance to use (e.g. LLAppViewer::instance()).
+ LLAppViewerListener(const std::string& pumpname, LLAppViewer* llappviewer);
+
+private:
+ void requestQuit(const LLSD& event);
+
+ LLAppViewer* mAppViewer;
+};
+
+#endif /* ! defined(LL_LLAPPVIEWERLISTENER_H) */
diff --git a/indra/newview/llcapabilitylistener.cpp b/indra/newview/llcapabilitylistener.cpp
index 4134e9e0a4..785a647fa2 100644
--- a/indra/newview/llcapabilitylistener.cpp
+++ b/indra/newview/llcapabilitylistener.cpp
@@ -91,6 +91,7 @@ bool LLCapabilityListener::capListener(const LLSD& request)
// This capability is supported by the region to which we're talking.
LLHTTPClient::post(url, payload,
new LLSDMessage::EventResponder(LLEventPumps::instance(),
+ request,
mProvider.getDescription(),
cap, reply, error),
LLSD(), // headers
diff --git a/indra/newview/llclassifiedinfo.cpp b/indra/newview/llclassifiedinfo.cpp
index 5cf1579d0e..5fcafbeca6 100644
--- a/indra/newview/llclassifiedinfo.cpp
+++ b/indra/newview/llclassifiedinfo.cpp
@@ -38,35 +38,19 @@
LLClassifiedInfo::cat_map LLClassifiedInfo::sCategories;
// static
-void LLClassifiedInfo::loadCategories(LLUserAuth::options_t classified_options)
+void LLClassifiedInfo::loadCategories(const LLSD& options)
{
- LLUserAuth::options_t::iterator resp_it;
- for (resp_it = classified_options.begin();
- resp_it != classified_options.end();
- ++resp_it)
+ for(LLSD::array_const_iterator resp_it = options.beginArray(),
+ end = options.endArray(); resp_it != end; ++resp_it)
{
- const LLUserAuth::response_t& response = *resp_it;
-
- LLUserAuth::response_t::const_iterator option_it;
-
- S32 cat_id = 0;
- option_it = response.find("category_id");
- if (option_it != response.end())
+ LLSD name = (*resp_it)["category_name"];
+ if(name.isDefined())
{
- cat_id = atoi(option_it->second.c_str());
+ LLSD id = (*resp_it)["category_id"];
+ if(id.isDefined())
+ {
+ LLClassifiedInfo::sCategories[id.asInteger()] = name.asString();
+ }
}
- else
- {
- continue;
- }
-
- // Add the category id/name pair
- option_it = response.find("category_name");
- if (option_it != response.end())
- {
- LLClassifiedInfo::sCategories[cat_id] = option_it->second;
- }
-
}
-
}
diff --git a/indra/newview/llclassifiedinfo.h b/indra/newview/llclassifiedinfo.h
index cc5a6bf28f..37134c7e5b 100644
--- a/indra/newview/llclassifiedinfo.h
+++ b/indra/newview/llclassifiedinfo.h
@@ -37,7 +37,6 @@
#include "v3dmath.h"
#include "lluuid.h"
-#include "lluserauth.h"
class LLMessageSystem;
@@ -46,7 +45,7 @@ class LLClassifiedInfo
public:
LLClassifiedInfo() {}
- static void loadCategories(LLUserAuth::options_t event_options);
+ static void loadCategories(const LLSD& options);
typedef std::map<U32, std::string> cat_map;
static cat_map sCategories;
diff --git a/indra/newview/lleventinfo.cpp b/indra/newview/lleventinfo.cpp
index d4175b6c84..9be45d18fb 100644
--- a/indra/newview/lleventinfo.cpp
+++ b/indra/newview/lleventinfo.cpp
@@ -87,35 +87,19 @@ void LLEventInfo::unpack(LLMessageSystem *msg)
}
// static
-void LLEventInfo::loadCategories(LLUserAuth::options_t event_options)
+void LLEventInfo::loadCategories(const LLSD& options)
{
- LLUserAuth::options_t::iterator resp_it;
- for (resp_it = event_options.begin();
- resp_it != event_options.end();
- ++resp_it)
+ for(LLSD::array_const_iterator resp_it = options.beginArray(),
+ end = options.endArray(); resp_it != end; ++resp_it)
{
- const LLUserAuth::response_t& response = *resp_it;
-
- LLUserAuth::response_t::const_iterator option_it;
-
- S32 cat_id = 0;
- option_it = response.find("category_id");
- if (option_it != response.end())
+ LLSD name = (*resp_it)["category_name"];
+ if(name.isDefined())
{
- cat_id = atoi(option_it->second.c_str());
+ LLSD id = (*resp_it)["category_id"];
+ if(id.isDefined())
+ {
+ LLEventInfo::sCategories[id.asInteger()] = name.asString();
+ }
}
- else
- {
- continue;
- }
-
- // Add the category id/name pair
- option_it = response.find("category_name");
- if (option_it != response.end())
- {
- LLEventInfo::sCategories[cat_id] = option_it->second;
- }
-
}
-
}
diff --git a/indra/newview/lleventinfo.h b/indra/newview/lleventinfo.h
index 880517a9f4..493c659983 100644
--- a/indra/newview/lleventinfo.h
+++ b/indra/newview/lleventinfo.h
@@ -37,7 +37,6 @@
#include "v3dmath.h"
#include "lluuid.h"
-#include "lluserauth.h"
class LLMessageSystem;
@@ -48,7 +47,7 @@ public:
void unpack(LLMessageSystem *msg);
- static void loadCategories(LLUserAuth::options_t event_options);
+ static void loadCategories(const LLSD& options);
public:
std::string mName;
diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp
index 2c52cf9565..80d4d21166 100644
--- a/indra/newview/lleventnotifier.cpp
+++ b/indra/newview/lleventnotifier.cpp
@@ -95,18 +95,16 @@ void LLEventNotifier::update()
}
}
-void LLEventNotifier::load(const LLUserAuth::options_t& event_options)
+void LLEventNotifier::load(const LLSD& event_options)
{
- LLUserAuth::options_t::const_iterator resp_it;
- for (resp_it = event_options.begin();
- resp_it != event_options.end();
- ++resp_it)
+ for(LLSD::array_const_iterator resp_it = event_options.beginArray(),
+ end = event_options.endArray(); resp_it != end; ++resp_it)
{
- const LLUserAuth::response_t& response = *resp_it;
+ LLSD response = *resp_it;
LLEventNotification *new_enp = new LLEventNotification();
- if (!new_enp->load(response))
+ if(!new_enp->load(response))
{
delete new_enp;
continue;
@@ -210,49 +208,46 @@ bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& r
return false;
}
-BOOL LLEventNotification::load(const LLUserAuth::response_t &response)
+BOOL LLEventNotification::load(const LLSD& response)
{
-
- LLUserAuth::response_t::const_iterator option_it;
BOOL event_ok = TRUE;
- option_it = response.find("event_id");
- if (option_it != response.end())
+ LLSD option = response.get("event_id");
+ if (option.isDefined())
{
- mEventID = atoi(option_it->second.c_str());
+ mEventID = option.asInteger();
}
else
{
event_ok = FALSE;
}
- option_it = response.find("event_name");
- if (option_it != response.end())
+ option = response.get("event_name");
+ if (option.isDefined())
{
- llinfos << "Event: " << option_it->second << llendl;
- mEventName = option_it->second;
+ llinfos << "Event: " << option.asString() << llendl;
+ mEventName = option.asString();
}
else
{
event_ok = FALSE;
}
-
- option_it = response.find("event_date");
- if (option_it != response.end())
+ option = response.get("event_date");
+ if (option.isDefined())
{
- llinfos << "EventDate: " << option_it->second << llendl;
- mEventDateStr = option_it->second;
+ llinfos << "EventDate: " << option.asString() << llendl;
+ mEventDateStr = option.asString();
}
else
{
event_ok = FALSE;
}
- option_it = response.find("event_date_ut");
- if (option_it != response.end())
+ option = response.get("event_date_ut");
+ if (option.isDefined())
{
- llinfos << "EventDate: " << option_it->second << llendl;
- mEventDate = strtoul(option_it->second.c_str(), NULL, 10);
+ llinfos << "EventDate: " << option.asString() << llendl;
+ mEventDate = strtoul(option.asString().c_str(), NULL, 10);
}
else
{
@@ -264,44 +259,44 @@ BOOL LLEventNotification::load(const LLUserAuth::response_t &response)
S32 x_region = 0;
S32 y_region = 0;
- option_it = response.find("grid_x");
- if (option_it != response.end())
+ option = response.get("grid_x");
+ if (option.isDefined())
{
- llinfos << "GridX: " << option_it->second << llendl;
- grid_x= atoi(option_it->second.c_str());
+ llinfos << "GridX: " << option.asInteger() << llendl;
+ grid_x= option.asInteger();
}
else
{
event_ok = FALSE;
}
- option_it = response.find("grid_y");
- if (option_it != response.end())
+ option = response.get("grid_y");
+ if (option.isDefined())
{
- llinfos << "GridY: " << option_it->second << llendl;
- grid_y = atoi(option_it->second.c_str());
+ llinfos << "GridY: " << option.asInteger() << llendl;
+ grid_y = option.asInteger();
}
else
{
event_ok = FALSE;
}
- option_it = response.find("x_region");
- if (option_it != response.end())
+ option = response.get("x_region");
+ if (option.isDefined())
{
- llinfos << "RegionX: " << option_it->second << llendl;
- x_region = atoi(option_it->second.c_str());
+ llinfos << "RegionX: " << option.asInteger() << llendl;
+ x_region = option.asInteger();
}
else
{
event_ok = FALSE;
}
- option_it = response.find("y_region");
- if (option_it != response.end())
+ option = response.get("y_region");
+ if (option.isDefined())
{
- llinfos << "RegionY: " << option_it->second << llendl;
- y_region = atoi(option_it->second.c_str());
+ llinfos << "RegionY: " << option.asInteger() << llendl;
+ y_region = option.asInteger();
}
else
{
diff --git a/indra/newview/lleventnotifier.h b/indra/newview/lleventnotifier.h
index feb734948c..6fdde87646 100644
--- a/indra/newview/lleventnotifier.h
+++ b/indra/newview/lleventnotifier.h
@@ -34,7 +34,6 @@
#define LL_LLEVENTNOTIFIER_H
#include "llframetimer.h"
-#include "lluserauth.h"
#include "v3dmath.h"
class LLEventInfo;
@@ -49,7 +48,7 @@ public:
void update(); // Notify the user of the event if it's coming up
- void load(const LLUserAuth::options_t& event_options); // In the format that it comes in from LLUserAuth
+ void load(const LLSD& event_options); // In the format that it comes in from login
void add(LLEventInfo &event_info); // Add a new notification for an event
void remove(U32 event_id);
@@ -69,7 +68,7 @@ public:
LLEventNotification();
virtual ~LLEventNotification();
- BOOL load(const LLUserAuth::response_t &en); // In the format it comes in from LLUserAuth
+ BOOL load(const LLSD& en); // In the format it comes in from login
BOOL load(const LLEventInfo &event_info); // From existing event_info on the viewer.
//void setEventID(const U32 event_id);
//void setEventName(std::string &event_name);
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 8af3a8b539..8b06947c4e 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -996,8 +996,12 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is)
std::string label = iter->first;
F64 time = iter->second["Time"].asReal();
-
- total_time += time;
+
+ // Skip the total figure
+ if(label.compare("Total") != 0)
+ {
+ total_time += time;
+ }
if (time > 0.0)
{
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 2a8365b3f0..fb724f30e0 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -44,6 +44,7 @@
#include "llgl.h"
#include "llsecondlifeurls.h"
+#include "llappviewer.h"
#include "llviewercontrol.h"
#include "llworld.h"
#include "lldrawpoolterrain.h"
@@ -58,11 +59,6 @@
#include "lldxhardware.h"
#endif
-//
-// externs
-//
-extern LLMemoryInfo gSysMemory;
-extern LLCPUInfo gSysCPU;
#if LL_DARWIN
const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt";
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index caa10e9452..da602d5f27 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -1,257 +1,256 @@
-/**
- * @file llfloaterabout.cpp
- * @author James Cook
- * @brief The about box from Help->About
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llviewerprecompiledheaders.h"
-
-#include "llfloaterabout.h"
-
-#include "llsys.h"
-#include "llgl.h"
-#include "llui.h" // for tr()
-#include "v3dmath.h"
-
-#include "llcurl.h"
-#include "llimagej2c.h"
-#include "llaudioengine.h"
-
-#include "llviewertexteditor.h"
-#include "llviewercontrol.h"
-#include "llagent.h"
-#include "llviewerstats.h"
-#include "llviewerregion.h"
-#include "llversionviewer.h"
-#include "llviewerbuild.h"
-#include "lluictrlfactory.h"
-#include "lluri.h"
-#include "llweb.h"
-#include "llsecondlifeurls.h"
-#include "lltrans.h"
-#include "llappviewer.h"
-#include "llglheaders.h"
-#include "llwindow.h"
-
-#include "llbutton.h"
-
-#if LL_WINDOWS
-#include "lldxhardware.h"
-#endif
-
-extern LLCPUInfo gSysCPU;
-extern LLMemoryInfo gSysMemory;
-extern U32 gPacketsIn;
-
-static std::string get_viewer_release_notes_url();
-
-
-///----------------------------------------------------------------------------
-/// Class LLFloaterAbout
-///----------------------------------------------------------------------------
-
-// Default constructor
-LLFloaterAbout::LLFloaterAbout(const LLSD& key)
-: LLFloater(key)
-{
- //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");
-
-}
-
-// Destroys the object
-LLFloaterAbout::~LLFloaterAbout()
-{
-}
-
-BOOL LLFloaterAbout::postBuild()
-{
- center();
- LLViewerTextEditor *support_widget =
- getChild<LLViewerTextEditor>("support_editor", true);
-
- LLViewerTextEditor *credits_widget =
- getChild<LLViewerTextEditor>("credits_editor", true);
-
- // make sure that we handle hyperlinks in the About text
- support_widget->setParseHTML(TRUE);
-
- // Version string
- std::string version = LLTrans::getString("APP_NAME")
- + llformat(" %d.%d.%d (%d) %s %s (%s)\n",
- LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
- __DATE__, __TIME__,
- gSavedSettings.getString("VersionChannelName").c_str());
-
- std::string support;
- support.append(version);
- support.append("[" + get_viewer_release_notes_url() + " " +
- LLTrans::getString("ReleaseNotes") + "]");
- support.append("\n\n");
-
-#if LL_MSVC
- support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER));
-#endif
-
-#if LL_GNUC
- support.append(llformat("Built with GCC version %d\n\n", GCC_VERSION));
-#endif
-
- // Position
- LLViewerRegion* region = gAgent.getRegion();
- if (region)
- {
- const LLVector3d &pos = gAgent.getPositionGlobal();
- LLUIString pos_text = getString("you_are_at");
- pos_text.setArg("[POSITION]",
- llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
- support.append(pos_text);
-
- LLUIString region_text = getString ("in_region") + " ";
- region_text.setArg("[REGION]", llformat ("%s", gAgent.getRegion()->getName().c_str()));
- support.append(region_text);
-
- std::string buffer;
- buffer = gAgent.getRegion()->getHost().getHostName();
- support.append(buffer);
- support.append(" (");
- buffer = gAgent.getRegion()->getHost().getString();
- support.append(buffer);
- support.append(")\n");
- support.append(gLastVersionChannel);
- support.append("\n");
- support.append("[" + LLWeb::escapeURL(region->getCapability("ServerReleaseNotes")) +
- " " + LLTrans::getString("ReleaseNotes") + "]");
- support.append("\n\n");
- }
-
- // *NOTE: Do not translate text like GPU, Graphics Card, etc -
- // Most PC users that know what these mean will be used to the english versions,
- // and this info sometimes gets sent to support
-
- // CPU
- support.append(getString("CPU") + " ");
- support.append( gSysCPU.getCPUString() );
- support.append("\n");
-
- U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
- // Moved hack adjustment to Windows memory size into llsys.cpp
-
- LLStringUtil::format_map_t args;
- args["[MEM]"] = llformat ("%u", memory);
- support.append(getString("Memory", args) + "\n");
-
- support.append(getString("OSVersion") + " ");
- support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
- support.append("\n");
-
- support.append(getString("GraphicsCardVendor") + " ");
- support.append( (const char*) glGetString(GL_VENDOR) );
- support.append("\n");
-
- support.append(getString("GraphicsCard") + " ");
- support.append( (const char*) glGetString(GL_RENDERER) );
- support.append("\n");
-
-#if LL_WINDOWS
- getWindow()->incBusyCount();
- getWindow()->setCursor(UI_CURSOR_ARROW);
- support.append("Windows Graphics Driver Version: ");
- LLSD driver_info = gDXHardware.getDisplayInfo();
- if (driver_info.has("DriverVersion"))
- {
- support.append(driver_info["DriverVersion"]);
- }
- support.append("\n");
- getWindow()->decBusyCount();
- getWindow()->setCursor(UI_CURSOR_ARROW);
-#endif
-
- support.append(getString("OpenGLVersion") + " ");
- support.append( (const char*) glGetString(GL_VERSION) );
- support.append("\n");
-
- support.append("\n");
-
- support.append(getString("LibCurlVersion") + " ");
- support.append( LLCurl::getVersionString() );
- support.append("\n");
-
- support.append(getString("J2CDecoderVersion") + " ");
- support.append( LLImageJ2C::getEngineInfo() );
- support.append("\n");
-
- support.append(getString("AudioDriverVersion") + " ");
- bool want_fullname = true;
- support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : getString("none") );
- support.append("\n");
-
- // TODO: Implement media plugin version query
-
- support.append(getString("LLQtWebkitVersion") + " ");
- support.append("\n");
-
- if (gPacketsIn > 0)
- {
- args["[LOST]"] = llformat ("%.0f", LLViewerStats::getInstance()->mPacketsLostStat.getCurrent());
- args["[IN]"] = llformat ("%.0f", F32(gPacketsIn));
- args["[PCT]"] = llformat ("%.1f", 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
- support.append(getString ("PacketsLost", args) + "\n");
- }
-
- support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
-
- // Fix views
- support_widget->setCursorPos(0);
- support_widget->setEnabled(FALSE);
-
- credits_widget->setCursorPos(0);
- credits_widget->setEnabled(FALSE);
-
- return TRUE;
-}
-
-
-static std::string get_viewer_release_notes_url()
-{
- std::ostringstream version;
- version << LL_VERSION_MAJOR << "."
- << LL_VERSION_MINOR << "."
- << LL_VERSION_PATCH << "."
- << LL_VERSION_BUILD;
-
- LLSD query;
- query["channel"] = gSavedSettings.getString("VersionChannelName");
- query["version"] = version.str();
-
- std::ostringstream url;
- url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query);
-
- return LLWeb::escapeURL(url.str());
-}
+/**
+ * @file llfloaterabout.cpp
+ * @author James Cook
+ * @brief The about box from Help->About
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llviewerprecompiledheaders.h"
+
+#include "llfloaterabout.h"
+
+#include "llsys.h"
+#include "llgl.h"
+#include "llui.h" // for tr()
+#include "v3dmath.h"
+
+#include "llcurl.h"
+#include "llimagej2c.h"
+#include "llaudioengine.h"
+
+#include "llviewertexteditor.h"
+#include "llviewercontrol.h"
+#include "llagent.h"
+#include "llviewerstats.h"
+#include "llviewerregion.h"
+#include "llversionviewer.h"
+#include "llviewerbuild.h"
+#include "lluictrlfactory.h"
+#include "lluri.h"
+#include "llweb.h"
+#include "llsecondlifeurls.h"
+#include "lltrans.h"
+#include "llappviewer.h"
+#include "llglheaders.h"
+#include "llwindow.h"
+
+#include "llbutton.h"
+
+#if LL_WINDOWS
+#include "lldxhardware.h"
+#endif
+
+extern LLMemoryInfo gSysMemory;
+extern U32 gPacketsIn;
+
+static std::string get_viewer_release_notes_url();
+
+
+///----------------------------------------------------------------------------
+/// Class LLFloaterAbout
+///----------------------------------------------------------------------------
+
+// Default constructor
+LLFloaterAbout::LLFloaterAbout(const LLSD& key)
+: LLFloater(key)
+{
+ //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");
+
+}
+
+// Destroys the object
+LLFloaterAbout::~LLFloaterAbout()
+{
+}
+
+BOOL LLFloaterAbout::postBuild()
+{
+ center();
+ LLViewerTextEditor *support_widget =
+ getChild<LLViewerTextEditor>("support_editor", true);
+
+ LLViewerTextEditor *credits_widget =
+ getChild<LLViewerTextEditor>("credits_editor", true);
+
+ // make sure that we handle hyperlinks in the About text
+ support_widget->setParseHTML(TRUE);
+
+ // Version string
+ std::string version = LLTrans::getString("APP_NAME")
+ + llformat(" %d.%d.%d (%d) %s %s (%s)\n",
+ LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
+ __DATE__, __TIME__,
+ gSavedSettings.getString("VersionChannelName").c_str());
+
+ std::string support;
+ support.append(version);
+ support.append("[" + get_viewer_release_notes_url() + " " +
+ LLTrans::getString("ReleaseNotes") + "]");
+ support.append("\n\n");
+
+#if LL_MSVC
+ support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER));
+#endif
+
+#if LL_GNUC
+ support.append(llformat("Built with GCC version %d\n\n", GCC_VERSION));
+#endif
+
+ // Position
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
+ {
+ const LLVector3d &pos = gAgent.getPositionGlobal();
+ LLUIString pos_text = getString("you_are_at");
+ pos_text.setArg("[POSITION]",
+ llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
+ support.append(pos_text);
+
+ LLUIString region_text = getString ("in_region") + " ";
+ region_text.setArg("[REGION]", llformat ("%s", gAgent.getRegion()->getName().c_str()));
+ support.append(region_text);
+
+ std::string buffer;
+ buffer = gAgent.getRegion()->getHost().getHostName();
+ support.append(buffer);
+ support.append(" (");
+ buffer = gAgent.getRegion()->getHost().getString();
+ support.append(buffer);
+ support.append(")\n");
+ support.append(gLastVersionChannel);
+ support.append("\n");
+ support.append("[" + LLWeb::escapeURL(region->getCapability("ServerReleaseNotes")) +
+ " " + LLTrans::getString("ReleaseNotes") + "]");
+ support.append("\n\n");
+ }
+
+ // *NOTE: Do not translate text like GPU, Graphics Card, etc -
+ // Most PC users that know what these mean will be used to the english versions,
+ // and this info sometimes gets sent to support
+
+ // CPU
+ support.append(getString("CPU") + " ");
+ support.append( gSysCPU.getCPUString() );
+ support.append("\n");
+
+ U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
+ // Moved hack adjustment to Windows memory size into llsys.cpp
+
+ LLStringUtil::format_map_t args;
+ args["[MEM]"] = llformat ("%u", memory);
+ support.append(getString("Memory", args) + "\n");
+
+ support.append(getString("OSVersion") + " ");
+ support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
+ support.append("\n");
+
+ support.append(getString("GraphicsCardVendor") + " ");
+ support.append( (const char*) glGetString(GL_VENDOR) );
+ support.append("\n");
+
+ support.append(getString("GraphicsCard") + " ");
+ support.append( (const char*) glGetString(GL_RENDERER) );
+ support.append("\n");
+
+#if LL_WINDOWS
+ getWindow()->incBusyCount();
+ getWindow()->setCursor(UI_CURSOR_ARROW);
+ support.append("Windows Graphics Driver Version: ");
+ LLSD driver_info = gDXHardware.getDisplayInfo();
+ if (driver_info.has("DriverVersion"))
+ {
+ support.append(driver_info["DriverVersion"]);
+ }
+ support.append("\n");
+ getWindow()->decBusyCount();
+ getWindow()->setCursor(UI_CURSOR_ARROW);
+#endif
+
+ support.append(getString("OpenGLVersion") + " ");
+ support.append( (const char*) glGetString(GL_VERSION) );
+ support.append("\n");
+
+ support.append("\n");
+
+ support.append(getString("LibCurlVersion") + " ");
+ support.append( LLCurl::getVersionString() );
+ support.append("\n");
+
+ support.append(getString("J2CDecoderVersion") + " ");
+ support.append( LLImageJ2C::getEngineInfo() );
+ support.append("\n");
+
+ support.append(getString("AudioDriverVersion") + " ");
+ bool want_fullname = true;
+ support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : getString("none") );
+ support.append("\n");
+
+ // TODO: Implement media plugin version query
+
+ support.append(getString("LLQtWebkitVersion") + " ");
+ support.append("\n");
+
+ if (gPacketsIn > 0)
+ {
+ args["[LOST]"] = llformat ("%.0f", LLViewerStats::getInstance()->mPacketsLostStat.getCurrent());
+ args["[IN]"] = llformat ("%.0f", F32(gPacketsIn));
+ args["[PCT]"] = llformat ("%.1f", 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
+ support.append(getString ("PacketsLost", args) + "\n");
+ }
+
+ support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
+
+ // Fix views
+ support_widget->setCursorPos(0);
+ support_widget->setEnabled(FALSE);
+
+ credits_widget->setCursorPos(0);
+ credits_widget->setEnabled(FALSE);
+
+ return TRUE;
+}
+
+
+static std::string get_viewer_release_notes_url()
+{
+ std::ostringstream version;
+ version << LL_VERSION_MAJOR << "."
+ << LL_VERSION_MINOR << "."
+ << LL_VERSION_PATCH << "."
+ << LL_VERSION_BUILD;
+
+ LLSD query;
+ query["channel"] = gSavedSettings.getString("VersionChannelName");
+ query["version"] = version.str();
+
+ std::ostringstream url;
+ url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query);
+
+ return LLWeb::escapeURL(url.str());
+}
diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h
index 9242f00c91..9c6660c0dc 100644
--- a/indra/newview/llfloaterfriends.h
+++ b/indra/newview/llfloaterfriends.h
@@ -74,6 +74,9 @@ public:
virtual BOOL postBuild();
+ // *HACK Made public to remove friends from LLAvatarIconCtrl context menu
+ static bool handleRemove(const LLSD& notification, const LLSD& response);
+
private:
enum FRIENDS_COLUMN_ORDER
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index 1c3443ae80..8d2d48f1af 100644
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -35,8 +35,6 @@
#include "llfloatertos.h"
// viewer includes
-#include "llappviewer.h"
-#include "llstartup.h"
#include "llviewerstats.h"
#include "llviewerwindow.h"
@@ -50,13 +48,15 @@
#include "lluictrlfactory.h"
#include "llvfile.h"
#include "message.h"
+#include "llstartup.h" // login_alert_done
-LLFloaterTOS::LLFloaterTOS(const LLSD& message)
-: LLModalDialog( message ),
- mMessage(message.asString()),
+LLFloaterTOS::LLFloaterTOS(const LLSD& data)
+: LLModalDialog( data["message"].asString() ),
+ mMessage(data["message"].asString()),
mWebBrowserWindowId( 0 ),
- mLoadCompleteCount( 0 )
+ mLoadCompleteCount( 0 ),
+ mReplyPumpName(data["reply_pump"].asString())
{
}
@@ -193,25 +193,12 @@ void LLFloaterTOS::onContinue( void* userdata )
{
LLFloaterTOS* self = (LLFloaterTOS*) userdata;
llinfos << "User agrees with TOS." << llendl;
- if (self->getInstanceName() == "message_tos")
- {
- gAcceptTOS = TRUE;
- }
- else
- {
- gAcceptCriticalMessage = TRUE;
- }
- // Testing TOS dialog
- #if ! LL_RELEASE_FOR_DOWNLOAD
- if ( LLStartUp::getStartupState() == STATE_LOGIN_WAIT )
+ if(self->mReplyPumpName != "")
{
- LLStartUp::setStartupState( STATE_LOGIN_SHOW );
+ LLEventPumps::instance().obtain(self->mReplyPumpName).post(LLSD(true));
}
- else
- #endif
- LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication
self->closeFloater(); // destroys this object
}
@@ -221,7 +208,12 @@ void LLFloaterTOS::onCancel( void* userdata )
LLFloaterTOS* self = (LLFloaterTOS*) userdata;
llinfos << "User disagrees with TOS." << llendl;
LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done);
- LLStartUp::setStartupState( STATE_LOGIN_SHOW );
+
+ if(self->mReplyPumpName != "")
+ {
+ LLEventPumps::instance().obtain(self->mReplyPumpName).post(LLSD(false));
+ }
+
self->mLoadCompleteCount = 0; // reset counter for next time we come to TOS
self->closeFloater(); // destroys this object
}
@@ -241,3 +233,4 @@ void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev
}
}
}
+
diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h
index 49f982aa80..1d573e8170 100644
--- a/indra/newview/llfloatertos.h
+++ b/indra/newview/llfloatertos.h
@@ -36,6 +36,7 @@
#include "llmodaldialog.h"
#include "llassetstorage.h"
#include "llmediactrl.h"
+#include <boost/function.hpp>
class LLButton;
class LLRadioGroup;
@@ -48,7 +49,7 @@ class LLFloaterTOS :
public LLViewerMediaObserver
{
public:
- LLFloaterTOS(const LLSD& message);
+ LLFloaterTOS(const LLSD& data);
virtual ~LLFloaterTOS();
BOOL postBuild();
@@ -68,6 +69,7 @@ private:
std::string mMessage;
int mWebBrowserWindowId;
int mLoadCompleteCount;
+ std::string mReplyPumpName;
};
#endif // LL_LLFLOATERTOS_H
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 9ef98afe94..a58cca1ba4 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -40,7 +40,7 @@
#include "llerror.h"
#include "llbutton.h"
#include "llhttpclient.h"
-#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "llstring.h"
#include "lluictrlfactory.h"
diff --git a/indra/newview/llinventoryactions.h b/indra/newview/llinventoryactions.h
new file mode 100644
index 0000000000..79247e3abb
--- /dev/null
+++ b/indra/newview/llinventoryactions.h
@@ -0,0 +1,47 @@
+/**
+ * @file llinventoryactions.h
+ * @brief inventory callback functions
+ * class definition
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLINVENTORYACTIONS_H
+#define LL_LLINVENTORYACTIONS_H
+
+#include "lluictrl.h"
+
+class LLPanelInventory;
+class LLInventoryView;
+class LLInventoryPanel;
+
+void init_object_inventory_panel_actions(LLPanelInventory *panel, LLUICtrl::CommitCallbackRegistry::Registrar& registrar);
+void init_inventory_actions(LLInventoryView *floater, LLUICtrl::CommitCallbackRegistry::Registrar& registrar);
+void init_inventory_panel_actions(LLInventoryPanel *panel, LLUICtrl::CommitCallbackRegistry::Registrar& registrar);
+
+#endif // LL_LLINVENTORYACTIONS_H
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 4cbf3e169b..7f91f8f8b2 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1982,63 +1982,56 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const
}
bool LLInventoryModel::loadSkeleton(
- const LLInventoryModel::options_t& options,
+ const LLSD& options,
const LLUUID& owner_id)
{
lldebugs << "importing inventory skeleton for " << owner_id << llendl;
typedef std::set<LLPointer<LLViewerInventoryCategory>, InventoryIDPtrLess> cat_set_t;
cat_set_t temp_cats;
-
- update_map_t child_counts;
-
- LLUUID id;
- LLAssetType::EType preferred_type;
bool rv = true;
- for(options_t::const_iterator it = options.begin(); it < options.end(); ++it)
- {
- LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory(owner_id);
- response_t::const_iterator no_response = (*it).end();
- response_t::const_iterator skel;
- skel = (*it).find("name");
- if(skel == no_response) goto clean_cat;
- cat->rename(std::string((*skel).second));
- skel = (*it).find("folder_id");
- if(skel == no_response) goto clean_cat;
- id.set((*skel).second);
- // if an id is null, it locks the viewer.
- if(id.isNull()) goto clean_cat;
- cat->setUUID(id);
- skel = (*it).find("parent_id");
- if(skel == no_response) goto clean_cat;
- id.set((*skel).second);
- cat->setParent(id);
- skel = (*it).find("type_default");
- if(skel == no_response)
- {
- preferred_type = LLAssetType::AT_NONE;
+
+ for(LLSD::array_const_iterator it = options.beginArray(),
+ end = options.endArray(); it != end; ++it)
+ {
+ LLSD name = (*it)["name"];
+ LLSD folder_id = (*it)["folder_id"];
+ LLSD parent_id = (*it)["parent_id"];
+ LLSD version = (*it)["version"];
+ if(name.isDefined()
+ && folder_id.isDefined()
+ && parent_id.isDefined()
+ && version.isDefined()
+ && folder_id.asUUID().notNull() // if an id is null, it locks the viewer.
+ )
+ {
+ LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory(owner_id);
+ cat->rename(name.asString());
+ cat->setUUID(folder_id.asUUID());
+ cat->setParent(parent_id.asUUID());
+
+ LLAssetType::EType preferred_type = LLAssetType::AT_NONE;
+ LLSD type_default = (*it)["type_default"];
+ if(type_default.isDefined())
+ {
+ preferred_type = (LLAssetType::EType)type_default.asInteger();
+ }
+ cat->setPreferredType(preferred_type);
+ cat->setVersion(version.asInteger());
+ temp_cats.insert(cat);
}
else
{
- S32 t = atoi((*skel).second.c_str());
- preferred_type = (LLAssetType::EType)t;
+ llwarns << "Unable to import near " << name.asString() << llendl;
+ rv = false;
}
- cat->setPreferredType(preferred_type);
- skel = (*it).find("version");
- if(skel == no_response) goto clean_cat;
- cat->setVersion(atoi((*skel).second.c_str()));
- temp_cats.insert(cat);
- continue;
- clean_cat:
- llwarns << "Unable to import near " << cat->getName() << llendl;
- rv = false;
- //delete cat; // automatic when cat is reasigned or destroyed
}
S32 cached_category_count = 0;
S32 cached_item_count = 0;
if(!temp_cats.empty())
{
+ update_map_t child_counts;
cat_array_t categories;
item_array_t items;
cat_set_t invalid_categories; // Used to mark categories that weren't successfully loaded.
@@ -2213,85 +2206,84 @@ bool LLInventoryModel::loadSkeleton(
return rv;
}
-bool LLInventoryModel::loadMeat(
- const LLInventoryModel::options_t& options, const LLUUID& owner_id)
+bool LLInventoryModel::loadMeat(const LLSD& options, const LLUUID& owner_id)
{
llinfos << "importing inventory for " << owner_id << llendl;
- LLPermissions default_perm;
- default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null);
- LLPointer<LLViewerInventoryItem> item;
- LLUUID id;
- LLAssetType::EType type;
- LLInventoryType::EType inv_type;
bool rv = true;
- for(options_t::const_iterator it = options.begin(); it < options.end(); ++it)
- {
- item = new LLViewerInventoryItem;
- response_t::const_iterator no_response = (*it).end();
- response_t::const_iterator meat;
- meat = (*it).find("name");
- if(meat == no_response) goto clean_item;
- item->rename(std::string((*meat).second));
- meat = (*it).find("item_id");
- if(meat == no_response) goto clean_item;
- id.set((*meat).second);
- item->setUUID(id);
- meat = (*it).find("parent_id");
- if(meat == no_response) goto clean_item;
- id.set((*meat).second);
- item->setParent(id);
- meat = (*it).find("type");
- if(meat == no_response) goto clean_item;
- type = (LLAssetType::EType)atoi((*meat).second.c_str());
- item->setType(type);
- meat = (*it).find("inv_type");
- if(meat != no_response)
- {
- inv_type = (LLInventoryType::EType)atoi((*meat).second.c_str());
- item->setInventoryType(inv_type);
- }
- meat = (*it).find("data_id");
- if(meat == no_response) goto clean_item;
- id.set((*meat).second);
- if(LLAssetType::AT_CALLINGCARD == type)
- {
- LLPermissions perm;
- perm.init(id, owner_id, LLUUID::null, LLUUID::null);
- item->setPermissions(perm);
+ for(LLSD::array_const_iterator it = options.beginArray(),
+ end = options.endArray(); it != end; ++it)
+ {
+ LLSD name = (*it)["name"];
+ LLSD item_id = (*it)["item_id"];
+ LLSD parent_id = (*it)["parent_id"];
+ LLSD asset_type = (*it)["type"];
+ LLSD data_id = (*it)["data_id"];
+ if(name.isDefined()
+ && item_id.isDefined()
+ && parent_id.isDefined()
+ && asset_type.isDefined()
+ && data_id.isDefined())
+ {
+ LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem;
+ item->rename(name.asString());
+ item->setUUID(item_id.asUUID());
+ item->setParent(parent_id.asUUID());
+ LLAssetType::EType type = (LLAssetType::EType)asset_type.asInteger();
+ item->setType(type);
+
+ LLSD llsd_inv_type = (*it)["inv_type"];
+ if(llsd_inv_type.isDefined())
+ {
+ LLInventoryType::EType inv_type = (LLInventoryType::EType)llsd_inv_type.asInteger();
+ item->setInventoryType(inv_type);
+ }
+
+ if(LLAssetType::AT_CALLINGCARD == type)
+ {
+ LLPermissions perm;
+ perm.init(data_id.asUUID(), owner_id, LLUUID::null, LLUUID::null);
+ item->setPermissions(perm);
+ }
+ else
+ {
+ LLPermissions default_perm;
+ default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null);
+ LLSD llsd_perm_mask = (*it)["perm_mask"];
+ if(llsd_perm_mask.isDefined())
+ {
+ PermissionMask perm_mask = llsd_perm_mask.asInteger();
+ default_perm.initMasks(
+ perm_mask, perm_mask, perm_mask, perm_mask, perm_mask);
+ }
+ else
+ {
+ default_perm.initMasks(
+ PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE);
+ }
+ item->setPermissions(default_perm);
+ item->setAssetUUID(data_id.asUUID());
+ }
+
+ LLSD flags = (*it)["flags"];
+ if(flags.isDefined())
+ {
+ // Not sure how well LLSD.asInteger() maps to
+ // unsigned long - using strtoul()
+ item->setFlags(strtoul(flags.asString().c_str(), NULL, 0));
+ }
+
+ LLSD time = (*it)["time"];
+ if(time.isDefined())
+ {
+ item->setCreationDate(time.asInteger());
+ }
+ addItem(item);
}
else
{
- meat = (*it).find("perm_mask");
- if(meat != no_response)
- {
- PermissionMask perm_mask = atoi((*meat).second.c_str());
- default_perm.initMasks(
- perm_mask, perm_mask, perm_mask, perm_mask, perm_mask);
- }
- else
- {
- default_perm.initMasks(
- PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE);
- }
- item->setPermissions(default_perm);
- item->setAssetUUID(id);
- }
- meat = (*it).find("flags");
- if(meat != no_response)
- {
- item->setFlags(strtoul((*meat).second.c_str(), NULL, 0));
- }
- meat = (*it).find("time");
- if(meat != no_response)
- {
- item->setCreationDate(atoi((*meat).second.c_str()));
+ llwarns << "Unable to import near " << name.asString() << llendl;
+ rv = false;
}
- addItem(item);
- continue;
- clean_item:
- llwarns << "Unable to import near " << item->getName() << llendl;
- rv = false;
- //delete item; // automatic when item is reassigned or destroyed
}
return rv;
}
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index e3e4f6aca0..3f2e6b624e 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -329,10 +329,8 @@ public:
// methods to load up inventory skeleton & meat. These are used
// during authentication. return true if everything parsed.
- typedef std::map<std::string, std::string> response_t;
- typedef std::vector<response_t> options_t;
- bool loadSkeleton(const options_t& options, const LLUUID& owner_id);
- bool loadMeat(const options_t& options, const LLUUID& owner_id);
+ bool loadSkeleton(const LLSD& options, const LLUUID& owner_id);
+ bool loadMeat(const LLSD& options, const LLUUID& owner_id);
// This is a brute force method to rebuild the entire parent-child
// relations.
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
new file mode 100644
index 0000000000..8bf769a132
--- /dev/null
+++ b/indra/newview/lllogininstance.cpp
@@ -0,0 +1,471 @@
+/**
+ * @file lllogininstance.cpp
+ * @brief Viewer's host for a login connection.
+ *
+ * $LicenseInfo:firstyear=2009&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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llviewerprecompiledheaders.h"
+
+#include "lllogininstance.h"
+
+// llcommon
+#include "llevents.h"
+#include "llmd5.h"
+#include "stringize.h"
+
+// llmessage (!)
+#include "llfiltersd2xmlrpc.h" // for xml_escape_string()
+
+// login
+#include "lllogin.h"
+
+// newview
+#include "llviewernetwork.h"
+#include "llviewercontrol.h"
+#include "llurlsimstring.h"
+#include "llfloaterreg.h"
+#include "llnotifications.h"
+#include "llwindow.h"
+#if LL_LINUX || LL_SOLARIS
+#include "lltrans.h"
+#endif
+
+static const char * const TOS_REPLY_PUMP = "lllogininstance_tos_callback";
+static const char * const TOS_LISTENER_NAME = "lllogininstance_tos";
+
+std::string construct_start_string();
+
+LLLoginInstance::LLLoginInstance() :
+ mLoginModule(new LLLogin()),
+ mNotifications(NULL),
+ mLoginState("offline"),
+ mUserInteraction(true),
+ mSkipOptionalUpdate(false),
+ mAttemptComplete(false),
+ mTransferRate(0.0f)
+{
+ mLoginModule->getEventPump().listen("lllogininstance",
+ boost::bind(&LLLoginInstance::handleLoginEvent, this, _1));
+}
+
+LLLoginInstance::~LLLoginInstance()
+{
+}
+
+void LLLoginInstance::connect(const LLSD& credentials)
+{
+ std::vector<std::string> uris;
+ LLViewerLogin::getInstance()->getLoginURIs(uris);
+ connect(uris.front(), credentials);
+}
+
+void LLLoginInstance::connect(const std::string& uri, const LLSD& credentials)
+{
+ mAttemptComplete = false; // Reset attempt complete at this point!
+ constructAuthParams(credentials);
+ mLoginModule->connect(uri, mRequestData);
+}
+
+void LLLoginInstance::reconnect()
+{
+ // Sort of like connect, only using the pre-existing
+ // request params.
+ std::vector<std::string> uris;
+ LLViewerLogin::getInstance()->getLoginURIs(uris);
+ mLoginModule->connect(uris.front(), mRequestData);
+}
+
+void LLLoginInstance::disconnect()
+{
+ mAttemptComplete = false; // Reset attempt complete at this point!
+ mRequestData.clear();
+ mLoginModule->disconnect();
+}
+
+LLSD LLLoginInstance::getResponse()
+{
+ return mResponseData;
+}
+
+void LLLoginInstance::constructAuthParams(const LLSD& credentials)
+{
+ // Set up auth request options.
+//#define LL_MINIMIAL_REQUESTED_OPTIONS
+ LLSD requested_options;
+ // *Note: this is where gUserAuth used to be created.
+ requested_options.append("inventory-root");
+ requested_options.append("inventory-skeleton");
+ //requested_options.append("inventory-meat");
+ //requested_options.append("inventory-skel-targets");
+#if (!defined LL_MINIMIAL_REQUESTED_OPTIONS)
+ if(FALSE == gSavedSettings.getBOOL("NoInventoryLibrary"))
+ {
+ requested_options.append("inventory-lib-root");
+ requested_options.append("inventory-lib-owner");
+ requested_options.append("inventory-skel-lib");
+ // requested_options.append("inventory-meat-lib");
+ }
+
+ requested_options.append("initial-outfit");
+ requested_options.append("gestures");
+ requested_options.append("event_categories");
+ requested_options.append("event_notifications");
+ requested_options.append("classified_categories");
+ requested_options.append("adult_compliant");
+ //requested_options.append("inventory-targets");
+ requested_options.append("buddy-list");
+ requested_options.append("ui-config");
+#endif
+ requested_options.append("tutorial_setting");
+ requested_options.append("login-flags");
+ requested_options.append("global-textures");
+ if(gSavedSettings.getBOOL("ConnectAsGod"))
+ {
+ gSavedSettings.setBOOL("UseDebugMenus", TRUE);
+ requested_options.append("god-connect");
+ }
+
+ char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
+ LLMD5 hashed_mac;
+ hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES );
+ hashed_mac.finalize();
+ hashed_mac.hex_digest(hashed_mac_string);
+
+ // prepend "$1$" to the password to indicate its the md5'd version.
+ std::string dpasswd("$1$");
+ dpasswd.append(credentials["passwd"].asString());
+
+ // (re)initialize the request params with creds.
+ LLSD request_params(credentials);
+ request_params["passwd"] = dpasswd;
+ request_params["start"] = construct_start_string();
+ request_params["skipoptional"] = mSkipOptionalUpdate;
+ request_params["agree_to_tos"] = false; // Always false here. Set true in
+ request_params["read_critical"] = false; // handleTOSResponse
+ request_params["last_exec_event"] = mLastExecEvent;
+ request_params["mac"] = hashed_mac_string;
+ request_params["version"] = gCurrentVersion; // Includes channel name
+ request_params["channel"] = gSavedSettings.getString("VersionChannelName");
+ request_params["id0"] = mSerialNumber;
+
+ mRequestData.clear();
+ mRequestData["method"] = "login_to_simulator";
+ mRequestData["params"] = request_params;
+ mRequestData["options"] = requested_options;
+}
+
+bool LLLoginInstance::handleLoginEvent(const LLSD& event)
+{
+ std::cout << "LoginListener called!: \n";
+ std::cout << event << "\n";
+
+ if(!(event.has("state") && event.has("progress")))
+ {
+ llerrs << "Unknown message from LLLogin!" << llendl;
+ }
+
+ mLoginState = event["state"].asString();
+ mResponseData = event["data"];
+
+ if(event.has("transfer_rate"))
+ {
+ mTransferRate = event["transfer_rate"].asReal();
+ }
+
+ if(mLoginState == "offline")
+ {
+ handleLoginFailure(event);
+ }
+ else if(mLoginState == "online")
+ {
+ handleLoginSuccess(event);
+ }
+
+ return false;
+}
+
+bool LLLoginInstance::handleLoginFailure(const LLSD& event)
+{
+ // Login has failed.
+ // Figure out why and respond...
+ LLSD response = event["data"];
+ std::string reason_response = response["reason"].asString();
+ std::string message_response = response["message"].asString();
+ if(mUserInteraction)
+ {
+ // For the cases of critical message or TOS agreement,
+ // start the TOS dialog. The dialog response will be handled
+ // by the LLLoginInstance::handleTOSResponse() callback.
+ // The callback intiates the login attempt next step, either
+ // to reconnect or to end the attempt in failure.
+ if(reason_response == "tos")
+ {
+ LLSD data(LLSD::emptyMap());
+ data["message"] = message_response;
+ data["reply_pump"] = TOS_REPLY_PUMP;
+ LLFloaterReg::showInstance("message_tos", data);
+ LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
+ .listen(TOS_LISTENER_NAME,
+ boost::bind(&LLLoginInstance::handleTOSResponse,
+ this, _1, "agree_to_tos"));
+ }
+ else if(reason_response == "critical")
+ {
+ LLSD data(LLSD::emptyMap());
+ data["message"] = message_response;
+ data["reply_pump"] = TOS_REPLY_PUMP;
+ LLFloaterReg::showInstance("message_critical", data);
+ LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
+ .listen(TOS_LISTENER_NAME,
+ boost::bind(&LLLoginInstance::handleTOSResponse,
+ this, _1, "read_critical"));
+ }
+ else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
+ {
+ gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
+ updateApp(true, message_response);
+ }
+ else if(reason_response == "optional")
+ {
+ updateApp(false, message_response);
+ }
+ else
+ {
+ attemptComplete();
+ }
+ }
+ else // no user interaction
+ {
+ attemptComplete();
+ }
+
+ return false;
+}
+
+bool LLLoginInstance::handleLoginSuccess(const LLSD& event)
+{
+ if(gSavedSettings.getBOOL("ForceMandatoryUpdate"))
+ {
+ LLSD response = event["data"];
+ std::string message_response = response["message"].asString();
+
+ // Testing update...
+ gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
+
+ // Don't confuse startup by leaving login "online".
+ mLoginModule->disconnect();
+ updateApp(true, message_response);
+ }
+ else
+ {
+ attemptComplete();
+ }
+ return false;
+}
+
+bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
+{
+ if(accepted)
+ {
+ // Set the request data to true and retry login.
+ mRequestData["params"][key] = true;
+ reconnect();
+ }
+ else
+ {
+ attemptComplete();
+ }
+
+ LLEventPumps::instance().obtain(TOS_REPLY_PUMP).stopListening(TOS_LISTENER_NAME);
+ return true;
+}
+
+
+void LLLoginInstance::updateApp(bool mandatory, const std::string& auth_msg)
+{
+ // store off config state, as we might quit soon
+ gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
+ LLUIColorTable::instance().saveUserSettings();
+
+ std::ostringstream message;
+ std::string msg;
+ if (!auth_msg.empty())
+ {
+ msg = "(" + auth_msg + ") \n";
+ }
+
+ LLSD args;
+ args["MESSAGE"] = msg;
+
+ LLSD payload;
+ payload["mandatory"] = mandatory;
+
+/*
+ We're constructing one of the following 6 strings here:
+ "DownloadWindowsMandatory"
+ "DownloadWindowsReleaseForDownload"
+ "DownloadWindows"
+ "DownloadMacMandatory"
+ "DownloadMacReleaseForDownload"
+ "DownloadMac"
+
+ I've called them out explicitly in this comment so that they can be grepped for.
+
+ Also, we assume that if we're not Windows we're Mac. If we ever intend to support
+ Linux with autoupdate, this should be an explicit #elif LL_DARWIN, but
+ we'd rather deliver the wrong message than no message, so until Linux is supported
+ we'll leave it alone.
+ */
+ std::string notification_name = "Download";
+
+#if LL_WINDOWS
+ notification_name += "Windows";
+#elif LL_DARWIN
+ notification_name += "Mac";
+#else
+ notification_name += "Linux";
+#endif
+
+ if (mandatory)
+ {
+ notification_name += "Mandatory";
+ }
+ else
+ {
+#if LL_RELEASE_FOR_DOWNLOAD
+ notification_name += "ReleaseForDownload";
+#endif
+ }
+
+ if(mNotifications)
+ {
+ mNotifications->add(notification_name, args, payload,
+ boost::bind(&LLLoginInstance::updateDialogCallback, this, _1, _2));
+ }
+
+ /* *NOTE:Mani Experiment with Event API interface.
+ if(!mUpdateAppResponse)
+ {
+ bool make_unique = true;
+ mUpdateAppResponse.reset(new LLEventStream("logininstance_updateapp", make_unique));
+ mUpdateAppResponse->listen("diaupdateDialogCallback",
+ boost::bind(&LLLoginInstance::updateDialogCallback,
+ this, _1
+ )
+ );
+ }
+
+ LLSD event;
+ event["op"] = "requestAdd";
+ event["name"] = notification_name;
+ event["substitutions"] = args;
+ event["payload"] = payload;
+ event["reply"] = mUpdateAppResponse->getName();
+
+ LLEventPumps::getInstance()->obtain("LLNotifications").post(event);
+ */
+}
+
+bool LLLoginInstance::updateDialogCallback(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotification::getSelectedOption(notification, response);
+ std::string update_exe_path;
+ bool mandatory = notification["payload"]["mandatory"].asBoolean();
+
+#if !LL_RELEASE_FOR_DOWNLOAD
+ if (option == 2)
+ {
+ // This condition attempts to skip the
+ // update if using a dev build.
+ // The relog probably won't work if the
+ // update is mandatory. :)
+
+ // *REMOVE:Mani - Saving for reference...
+ //LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
+ mSkipOptionalUpdate = true;
+ reconnect();
+ return false;
+ }
+#endif
+
+ if (option == 1)
+ {
+ // ...user doesn't want to do it
+ if (mandatory)
+ {
+ // Mandatory update, user chose to not to update...
+ // The login attemp is complete, startup should
+ // quit when detecting this.
+ attemptComplete();
+
+ // *REMOVE:Mani - Saving for reference...
+ //LLAppViewer::instance()->forceQuit();
+ // // Bump them back to the login screen.
+ // //reset_login();
+ }
+ else
+ {
+ // Optional update, user chose to skip
+ mSkipOptionalUpdate = true;
+ reconnect();
+ }
+ return false;
+ }
+
+ if(mUpdaterLauncher)
+ {
+ mUpdaterLauncher();
+ }
+
+ attemptComplete();
+
+ return false;
+}
+
+std::string construct_start_string()
+{
+ std::string start;
+ if (LLURLSimString::parse())
+ {
+ // a startup URL was specified
+ std::string unescaped_start =
+ STRINGIZE( "uri:"
+ << LLURLSimString::sInstance.mSimName << "&"
+ << LLURLSimString::sInstance.mX << "&"
+ << LLURLSimString::sInstance.mY << "&"
+ << LLURLSimString::sInstance.mZ);
+ start = xml_escape_string(unescaped_start);
+ }
+ else
+ {
+ start = gSavedSettings.getString("LoginLocation");
+ }
+ return start;
+}
+
diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h
new file mode 100644
index 0000000000..6a2ccf919e
--- /dev/null
+++ b/indra/newview/lllogininstance.h
@@ -0,0 +1,111 @@
+/**
+ * @file lllogininstance.h
+ * @brief A host for the viewer's login connection.
+ *
+ * $LicenseInfo:firstyear=2009&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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLLOGININSTANCE_H
+#define LL_LLLOGININSTANCE_H
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/function.hpp>
+class LLLogin;
+class LLEventStream;
+class LLNotificationsInterface;
+
+// This class hosts the login module and is used to
+// negotiate user authentication attempts.
+class LLLoginInstance : public LLSingleton<LLLoginInstance>
+{
+public:
+ LLLoginInstance();
+ ~LLLoginInstance();
+
+ void connect(const LLSD& credential); // Connect to the current grid choice.
+ void connect(const std::string& uri, const LLSD& credential); // Connect to the given uri.
+ void reconnect(); // reconnect using the current credentials.
+ void disconnect();
+
+ bool authFailure() { return mAttemptComplete && mLoginState == "offline"; }
+ bool authSuccess() { return mAttemptComplete && mLoginState == "online"; }
+
+ const std::string& getLoginState() { return mLoginState; }
+ LLSD getResponse(const std::string& key) { return getResponse()[key]; }
+ LLSD getResponse();
+
+ // Only valid when authSuccess == true.
+ const F64 getLastTransferRateBPS() { return mTransferRate; }
+
+ // Set whether this class will drive user interaction.
+ // If not, login failures like 'need tos agreement' will
+ // end the login attempt.
+ void setUserInteraction(bool state) { mUserInteraction = state; }
+ bool getUserInteraction() { return mUserInteraction; }
+
+ // Whether to tell login to skip optional update request.
+ // False by default.
+ void setSkipOptionalUpdate(bool state) { mSkipOptionalUpdate = state; }
+ void setSerialNumber(const std::string& sn) { mSerialNumber = sn; }
+ void setLastExecEvent(int lee) { mLastExecEvent = lee; }
+
+ void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; }
+
+ typedef boost::function<void()> UpdaterLauncherCallback;
+ void setUpdaterLauncher(const UpdaterLauncherCallback& ulc) { mUpdaterLauncher = ulc; }
+
+private:
+ void constructAuthParams(const LLSD& credentials);
+ void updateApp(bool mandatory, const std::string& message);
+ bool updateDialogCallback(const LLSD& notification, const LLSD& response);
+
+ bool handleLoginEvent(const LLSD& event);
+ bool handleLoginFailure(const LLSD& event);
+ bool handleLoginSuccess(const LLSD& event);
+
+ bool handleTOSResponse(bool v, const std::string& key);
+
+ void attemptComplete() { mAttemptComplete = true; } // In the future an event?
+
+ boost::scoped_ptr<LLLogin> mLoginModule;
+ LLNotificationsInterface* mNotifications;
+
+ std::string mLoginState;
+ LLSD mRequestData;
+ LLSD mResponseData;
+ bool mUserInteraction;
+ bool mSkipOptionalUpdate;
+ bool mAttemptComplete;
+ F64 mTransferRate;
+ std::string mSerialNumber;
+ int mLastExecEvent;
+ UpdaterLauncherCallback mUpdaterLauncher;
+ boost::scoped_ptr<LLEventStream> mUpdateAppResponse;
+};
+
+#endif
diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp
index 1666ec1336..ba5a382f9a 100644
--- a/indra/newview/llmenucommands.cpp
+++ b/indra/newview/llmenucommands.cpp
@@ -67,7 +67,6 @@
#include "llworldmap.h"
#include "llfocusmgr.h"
#include "llnearbychatbar.h"
-
void handle_pay_by_id(const LLUUID& agent_id)
{
const BOOL is_group = FALSE;
diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp
index c6840721a3..61e18195b8 100644
--- a/indra/newview/llpanelplace.cpp
+++ b/indra/newview/llpanelplace.cpp
@@ -58,6 +58,7 @@
//#include "llviewermenu.h" // create_landmark()
#include "llweb.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
LLPanelPlace::LLPanelPlace()
: LLPanel(),
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 7a19b8877e..793c25455d 100644
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -61,6 +61,7 @@
#include "llviewerregion.h"
#include "llviewertexteditor.h"
#include "llworldmap.h"
+#include "llsdutil_math.h"
static LLRegisterPanelClassWrapper<LLPanelPlaceInfo> t_place_info("panel_place_info");
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 44e76a0bc1..1fe7a75be7 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -56,7 +56,6 @@
#include "llcachename.h"
#include "lldir.h"
#include "llerrorcontrol.h"
-#include "llfiltersd2xmlrpc.h"
#include "llfloaterreg.h"
#include "llfocusmgr.h"
#include "llhttpsender.h"
@@ -66,10 +65,11 @@
#include "llmemorystream.h"
#include "llmessageconfig.h"
#include "llmoveview.h"
+#include "llteleporthistory.h"
#include "llregionhandle.h"
#include "llsd.h"
#include "llsdserialize.h"
-#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "llsecondlifeurls.h"
#include "llstring.h"
#include "lluserrelations.h"
@@ -102,7 +102,6 @@
#include "llfloaterland.h"
#include "llfloaterpreference.h"
#include "llfloatertopobjects.h"
-#include "llfloatertos.h"
#include "llfloaterworldmap.h"
#include "llgesturemgr.h"
#include "llgroupmgr.h"
@@ -115,6 +114,7 @@
#include "llfriendcard.h"
#include "llkeyboard.h"
#include "llloginhandler.h" // gLoginHandler, SLURL support
+#include "lllogininstance.h" // Host the login module.
#include "llpanellogin.h"
#include "llmutelist.h"
#include "llnotify.h"
@@ -134,7 +134,6 @@
#include "llsecondlifeurls.h"
#include "llselectmgr.h"
#include "llsky.h"
-#include "llsrv.h"
#include "llstatview.h"
#include "lltrans.h"
#include "llstatusbar.h" // sendMoneyBalanceRequest(), owns L$ balance
@@ -147,7 +146,6 @@
#include "llurlsimstring.h"
#include "llurlhistory.h"
#include "llurlwhitelist.h"
-#include "lluserauth.h"
#include "llvieweraudio.h"
#include "llviewerassetstorage.h"
#include "llviewercamera.h"
@@ -190,6 +188,9 @@
#include "llinventorybridge.h"
#include "llappearancemgr.h"
+#include "lllogin.h"
+#include "llevents.h"
+
#if LL_WINDOWS
#include "llwindebug.h"
#include "lldxhardware.h"
@@ -199,12 +200,12 @@
// exported globals
//
bool gAgentMovementCompleted = false;
-std::string gInitialOutfit;
-std::string gInitialOutfitGender;
std::string SCREEN_HOME_FILENAME = "screen_home.bmp";
std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
+LLPointer<LLViewerTexture> gStartTexture;
+
//
// Imported globals
//
@@ -214,12 +215,6 @@ extern S32 gStartImageHeight;
//
// local globals
//
-
-LLPointer<LLViewerTexture> gStartTexture;
-
-static LLHost gAgentSimHost;
-static BOOL gSkipOptionalUpdate = FALSE;
-
static bool gGotUseCircuitCodeAck = false;
static std::string sInitialOutfit;
static std::string sInitialOutfitGender; // "male" or "female"
@@ -228,6 +223,18 @@ static bool gUseCircuitCallbackCalled = false;
EStartupState LLStartUp::gStartupState = STATE_FIRST;
+// *NOTE:Mani - to reconcile with giab changes...
+static std::string gFirstname;
+static std::string gLastname;
+static std::string gPassword;
+
+static U64 gFirstSimHandle = 0;
+static LLHost gFirstSim;
+static std::string gFirstSimSeedCap;
+static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f);
+static std::string gAgentStartLocation = "safe";
+
+static LLEventStream sStartupStateWatcher("StartupState");
//
// local function declaration
@@ -240,8 +247,6 @@ void show_first_run_dialog();
bool first_run_dialog_callback(const LLSD& notification, const LLSD& response);
void set_startup_status(const F32 frac, const std::string& string, const std::string& msg);
bool login_alert_status(const LLSD& notification, const LLSD& response);
-void update_app(BOOL mandatory, const std::string& message);
-bool update_dialog_callback(const LLSD& notification, const LLSD& response);
void login_packet_failed(void**, S32 result);
void use_circuit_callback(void**, S32 result);
void register_viewer_callbacks(LLMessageSystem* msg);
@@ -251,6 +256,8 @@ void init_start_screen(S32 location_id);
void release_start_screen();
void reset_login();
void apply_udp_blacklist(const std::string& csv);
+bool process_login_success_response();
+void transition_back_to_login_panel(const std::string& emsg);
void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group)
{
@@ -310,9 +317,6 @@ void update_texture_fetch()
gTextureList.updateImages(0.10f);
}
-static std::vector<std::string> sAuthUris;
-static S32 sAuthUriNum = -1;
-
//Copies landmarks from the "Library" to "My Favorites"
void populate_favorites_bar()
{
@@ -384,23 +388,11 @@ bool idle_startup()
// auth/transform loop will do.
static F32 progress = 0.10f;
- static std::string auth_method;
static std::string auth_desc;
static std::string auth_message;
- static std::string firstname;
- static std::string lastname;
- static LLUUID web_login_key;
- static std::string password;
- static std::vector<const char*> requested_options;
-
- static U64 first_sim_handle = 0;
- static LLHost first_sim;
- static std::string first_sim_seed_cap;
static LLVector3 initial_sun_direction(1.f, 0.f, 0.f);
static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server
- static LLVector3 agent_start_look_at(1.0f, 0.f, 0.f);
- static std::string agent_start_location = "safe";
// last location by default
static S32 agent_location_id = START_LOCATION_ID_LAST;
@@ -408,7 +400,7 @@ bool idle_startup()
static bool show_connect_box = true;
- static bool stipend_since_login = false;
+ //static bool stipend_since_login = false;
// HACK: These are things from the main loop that usually aren't done
// until initialization is complete, but need to be done here for things
@@ -429,12 +421,7 @@ bool idle_startup()
LLStringUtil::setLocale (LLTrans::getString(system));
- if (gNoRender)
- {
- // HACK, skip optional updates if you're running drones
- gSkipOptionalUpdate = TRUE;
- }
- else
+ if (!gNoRender)
{
// Update images?
gTextureList.updateImages(0.01f);
@@ -750,24 +737,23 @@ bool idle_startup()
|| !gLoginHandler.getWebLoginKey().isNull() )
{
// We have at least some login information on a SLURL
- firstname = gLoginHandler.getFirstName();
- lastname = gLoginHandler.getLastName();
- web_login_key = gLoginHandler.getWebLoginKey();
+ gFirstname = gLoginHandler.getFirstName();
+ gLastname = gLoginHandler.getLastName();
// Show the login screen if we don't have everything
show_connect_box =
- firstname.empty() || lastname.empty() || web_login_key.isNull();
+ gFirstname.empty() || gLastname.empty();
}
else if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3)
{
LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
- firstname = cmd_line_login[0].asString();
- lastname = cmd_line_login[1].asString();
+ gFirstname = cmd_line_login[0].asString();
+ gLastname = cmd_line_login[1].asString();
LLMD5 pass((unsigned char*)cmd_line_login[2].asString().c_str());
char md5pass[33]; /* Flawfinder: ignore */
pass.hex_digest(md5pass);
- password = md5pass;
+ gPassword = md5pass;
#ifdef USE_VIEWER_AUTH
show_connect_box = true;
@@ -778,9 +764,9 @@ bool idle_startup()
}
else if (gSavedSettings.getBOOL("AutoLogin"))
{
- firstname = gSavedSettings.getString("FirstName");
- lastname = gSavedSettings.getString("LastName");
- password = LLStartUp::loadPasswordFromDisk();
+ gFirstname = gSavedSettings.getString("FirstName");
+ gLastname = gSavedSettings.getString("LastName");
+ gPassword = LLStartUp::loadPasswordFromDisk();
gSavedSettings.setBOOL("RememberPassword", TRUE);
#ifdef USE_VIEWER_AUTH
@@ -793,9 +779,9 @@ bool idle_startup()
{
// if not automatically logging in, display login dialog
// a valid grid is selected
- firstname = gSavedSettings.getString("FirstName");
- lastname = gSavedSettings.getString("LastName");
- password = LLStartUp::loadPasswordFromDisk();
+ gFirstname = gSavedSettings.getString("FirstName");
+ gLastname = gSavedSettings.getString("LastName");
+ gPassword = LLStartUp::loadPasswordFromDisk();
show_connect_box = true;
}
@@ -831,7 +817,7 @@ bool idle_startup()
// Load all the name information out of the login view
// NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't
// show the login view until login_show() is called below.
- // LLPanelLogin::getFields(firstname, lastname, password);
+ // LLPanelLogin::getFields(gFirstname, gLastname, gPassword);
if (gNoRender)
{
@@ -843,7 +829,7 @@ bool idle_startup()
// Show the login dialog
login_show();
// connect dialog is already shown, so fill in the names
- LLPanelLogin::setFields( firstname, lastname, password);
+ LLPanelLogin::setFields( gFirstname, gLastname, gPassword);
LLPanelLogin::giveFocus();
@@ -907,34 +893,34 @@ bool idle_startup()
//reset the values that could have come in from a slurl
if (!gLoginHandler.getWebLoginKey().isNull())
{
- firstname = gLoginHandler.getFirstName();
- lastname = gLoginHandler.getLastName();
- web_login_key = gLoginHandler.getWebLoginKey();
+ gFirstname = gLoginHandler.getFirstName();
+ gLastname = gLoginHandler.getLastName();
+// gWebLoginKey = gLoginHandler.getWebLoginKey();
}
if (show_connect_box)
{
// TODO if not use viewer auth
// Load all the name information out of the login view
- LLPanelLogin::getFields(&firstname, &lastname, &password);
+ LLPanelLogin::getFields(&gFirstname, &gLastname, &gPassword);
// end TODO
// HACK: Try to make not jump on login
gKeyboard->resetKeys();
}
- if (!firstname.empty() && !lastname.empty())
+ if (!gFirstname.empty() && !gLastname.empty())
{
- gSavedSettings.setString("FirstName", firstname);
- gSavedSettings.setString("LastName", lastname);
+ gSavedSettings.setString("FirstName", gFirstname);
+ gSavedSettings.setString("LastName", gLastname);
- LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL;
- gDebugInfo["LoginName"] = firstname + " " + lastname;
+ LL_INFOS("AppInit") << "Attempting login as: " << gFirstname << " " << gLastname << LL_ENDL;
+ gDebugInfo["LoginName"] = gFirstname + " " + gLastname;
}
// create necessary directories
// *FIX: these mkdir's should error check
- gDirUtilp->setLindenUserDir(firstname, lastname);
+ gDirUtilp->setLindenUserDir(gFirstname, gLastname);
LLFile::mkdir(gDirUtilp->getLindenUserDir());
// Set PerAccountSettingsFile to the default value.
@@ -968,7 +954,7 @@ bool idle_startup()
gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
}
- gDirUtilp->setPerAccountChatLogsDir(firstname, lastname);
+ gDirUtilp->setPerAccountChatLogsDir(gFirstname, gLastname);
LLFile::mkdir(gDirUtilp->getChatLogsDir());
LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
@@ -989,13 +975,6 @@ bool idle_startup()
if (show_connect_box)
{
- if ( LLPanelLogin::isGridComboDirty() )
- {
- // User picked a grid from the popup, so clear the
- // stored uris and they will be reacquired from the grid choice.
- sAuthUris.clear();
- }
-
std::string location;
LLPanelLogin::getLocation( location );
LLURLSimString::setString( location );
@@ -1024,7 +1003,7 @@ bool idle_startup()
agent_location_id = START_LOCATION_ID_URL;
// doesn't really matter what location_which is, since
- // agent_start_look_at will be overwritten when the
+ // gAgentStartLookAt will be overwritten when the
// UserLoginLocationReply arrives
location_which = START_LOCATION_ID_LAST;
}
@@ -1057,605 +1036,138 @@ bool idle_startup()
gVFS->pokeFiles();
- // skipping over STATE_UPDATE_CHECK because that just waits for input
LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
return FALSE;
}
- if (STATE_UPDATE_CHECK == LLStartUp::getStartupState())
- {
- // wait for user to give input via dialog box
- return FALSE;
- }
-
if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState())
{
-//#define LL_MINIMIAL_REQUESTED_OPTIONS
gDebugInfo["GridName"] = LLViewerLogin::getInstance()->getGridLabel();
- // *Note: this is where gUserAuth used to be created.
- requested_options.clear();
- requested_options.push_back("inventory-root");
- requested_options.push_back("inventory-skeleton");
- //requested_options.push_back("inventory-meat");
- //requested_options.push_back("inventory-skel-targets");
-#if (!defined LL_MINIMIAL_REQUESTED_OPTIONS)
- if(FALSE == gSavedSettings.getBOOL("NoInventoryLibrary"))
- {
- requested_options.push_back("inventory-lib-root");
- requested_options.push_back("inventory-lib-owner");
- requested_options.push_back("inventory-skel-lib");
- // requested_options.push_back("inventory-meat-lib");
- }
-
- requested_options.push_back("initial-outfit");
- requested_options.push_back("gestures");
- requested_options.push_back("event_categories");
- requested_options.push_back("event_notifications");
- requested_options.push_back("classified_categories");
- requested_options.push_back("adult_compliant");
- //requested_options.push_back("inventory-targets");
- requested_options.push_back("buddy-list");
- requested_options.push_back("ui-config");
-#endif
- requested_options.push_back("tutorial_setting");
- requested_options.push_back("login-flags");
- requested_options.push_back("global-textures");
- if(gSavedSettings.getBOOL("ConnectAsGod"))
- {
- gSavedSettings.setBOOL("UseDebugMenus", TRUE);
- requested_options.push_back("god-connect");
- }
- std::vector<std::string> uris;
- LLViewerLogin::getInstance()->getLoginURIs(uris);
- std::vector<std::string>::const_iterator iter, end;
- for (iter = uris.begin(), end = uris.end(); iter != end; ++iter)
- {
- std::vector<std::string> rewritten;
- rewritten = LLSRV::rewriteURI(*iter);
- sAuthUris.insert(sAuthUris.end(),
- rewritten.begin(), rewritten.end());
- }
- sAuthUriNum = 0;
- auth_method = "login_to_simulator";
-
+ // Update progress status and the display loop.
auth_desc = LLTrans::getString("LoginInProgress");
- LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
- }
-
- if (STATE_LOGIN_AUTHENTICATE == LLStartUp::getStartupState())
- {
- LL_DEBUGS("AppInit") << "STATE_LOGIN_AUTHENTICATE" << LL_ENDL;
set_startup_status(progress, auth_desc, auth_message);
progress += 0.02f;
display_startup();
-
- std::stringstream start;
- if (LLURLSimString::parse())
- {
- // a startup URL was specified
- std::stringstream unescaped_start;
- unescaped_start << "uri:"
- << LLURLSimString::sInstance.mSimName << "&"
- << LLURLSimString::sInstance.mX << "&"
- << LLURLSimString::sInstance.mY << "&"
- << LLURLSimString::sInstance.mZ;
- start << xml_escape_string(unescaped_start.str());
-
- }
- else
- {
- start << gSavedSettings.getString("LoginLocation");
- }
-
- char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
- LLMD5 hashed_mac;
- hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES );
- hashed_mac.finalize();
- hashed_mac.hex_digest(hashed_mac_string);
-
- // TODO if statement here to use web_login_key
- sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1);
- LLUserAuth::getInstance()->authenticate(
- sAuthUris[sAuthUriNum],
- auth_method,
- firstname,
- lastname,
- password, // web_login_key,
- start.str(),
- gSkipOptionalUpdate,
- gAcceptTOS,
- gAcceptCriticalMessage,
- gLastExecEvent,
- requested_options,
- hashed_mac_string,
- LLAppViewer::instance()->getSerialNumber());
-
- // reset globals
- gAcceptTOS = FALSE;
- gAcceptCriticalMessage = FALSE;
- LLStartUp::setStartupState( STATE_LOGIN_NO_DATA_YET );
- return FALSE;
- }
- if(STATE_LOGIN_NO_DATA_YET == LLStartUp::getStartupState())
- {
- LL_DEBUGS("AppInit") << "STATE_LOGIN_NO_DATA_YET" << LL_ENDL;
- // If we get here we have gotten past the potential stall
- // in curl, so take "may appear frozen" out of progress bar. JC
- auth_desc = LLTrans::getString("LoginInProgressNoFrozen");
- set_startup_status(progress, auth_desc, auth_message);
- // Process messages to keep from dropping circuit.
- LLMessageSystem* msg = gMessageSystem;
- while (msg->checkAllMessages(gFrameCount, gServicePump))
+ // Setting initial values...
+ LLLoginInstance* login = LLLoginInstance::getInstance();
+ login->setNotificationsInterface(LLNotifications::getInstance());
+ if(gNoRender)
{
+ // HACK, skip optional updates if you're running drones
+ login->setSkipOptionalUpdate(true);
}
- msg->processAcks();
- LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse();
- if(LLUserAuth::E_NO_RESPONSE_YET == error)
- {
- LL_DEBUGS("AppInit") << "waiting..." << LL_ENDL;
- return FALSE;
- }
- LLStartUp::setStartupState( STATE_LOGIN_DOWNLOADING );
- progress += 0.01f;
- set_startup_status(progress, auth_desc, auth_message);
- return FALSE;
- }
- if(STATE_LOGIN_DOWNLOADING == LLStartUp::getStartupState())
- {
- LL_DEBUGS("AppInit") << "STATE_LOGIN_DOWNLOADING" << LL_ENDL;
- // Process messages to keep from dropping circuit.
- LLMessageSystem* msg = gMessageSystem;
- while (msg->checkAllMessages(gFrameCount, gServicePump))
- {
- }
- msg->processAcks();
- LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse();
- if(LLUserAuth::E_DOWNLOADING == error)
- {
- LL_DEBUGS("AppInit") << "downloading..." << LL_ENDL;
- return FALSE;
- }
+ login->setUserInteraction(show_connect_box);
+ login->setSerialNumber(LLAppViewer::instance()->getSerialNumber());
+ login->setLastExecEvent(gLastExecEvent);
+ login->setUpdaterLauncher(boost::bind(&LLAppViewer::launchUpdater, LLAppViewer::instance()));
+
+ // This call to LLLoginInstance::connect() starts the
+ // authentication process.
+ LLSD credentials;
+ credentials["first"] = gFirstname;
+ credentials["last"] = gLastname;
+ credentials["passwd"] = gPassword;
+ login->connect(credentials);
+
LLStartUp::setStartupState( STATE_LOGIN_PROCESS_RESPONSE );
- progress += 0.01f;
- set_startup_status(progress, LLTrans::getString("LoginProcessingResponse"), auth_message);
return FALSE;
}
- if(STATE_LOGIN_PROCESS_RESPONSE == LLStartUp::getStartupState())
+ if(STATE_LOGIN_PROCESS_RESPONSE == LLStartUp::getStartupState())
{
- LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL;
std::ostringstream emsg;
- bool quit = false;
- bool update = false;
- std::string login_response;
- std::string reason_response;
- std::string message_response;
- bool successful_login = false;
- LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse();
- // reset globals
- gAcceptTOS = FALSE;
- gAcceptCriticalMessage = FALSE;
- switch(error)
- {
- case LLUserAuth::E_OK:
- login_response = LLUserAuth::getInstance()->getResponse("login");
- if(login_response == "true")
- {
- // Yay, login!
- successful_login = true;
- }
- else if(login_response == "indeterminate")
+ emsg << "Login failed.\n";
+ if(LLLoginInstance::getInstance()->authFailure())
+ {
+ LL_INFOS("LLStartup") << "Login failed, LLLoginInstance::getResponse(): "
+ << LLLoginInstance::getInstance()->getResponse() << LL_ENDL;
+ // Still have error conditions that may need some
+ // sort of handling.
+ std::string reason_response = LLLoginInstance::getInstance()->getResponse("reason");
+ std::string message_response = LLLoginInstance::getInstance()->getResponse("message");
+
+ if(!message_response.empty())
{
- LL_INFOS("AppInit") << "Indeterminate login..." << LL_ENDL;
- sAuthUris = LLSRV::rewriteURI(LLUserAuth::getInstance()->getResponse("next_url"));
- sAuthUriNum = 0;
- auth_method = LLUserAuth::getInstance()->getResponse("next_method");
- auth_message = LLUserAuth::getInstance()->getResponse("message");
- if(auth_method.substr(0, 5) == "login")
+ // XUI: fix translation for strings returned during login
+ // We need a generic table for translations
+ std::string big_reason = LLAgent::sTeleportErrorMessages[ message_response ];
+ if ( big_reason.size() == 0 )
{
- auth_desc.assign(LLTrans::getString("LoginAuthenticating"));
+ emsg << message_response;
}
else
{
- auth_desc.assign(LLTrans::getString("LoginMaintenance"));
- }
- // ignoring the duration & options array for now.
- // Go back to authenticate.
- LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
- return FALSE;
- }
- else
- {
- emsg << "Login failed.\n";
- reason_response = LLUserAuth::getInstance()->getResponse("reason");
- message_response = LLUserAuth::getInstance()->getResponse("message");
-
- if (!message_response.empty())
- {
- // XUI: fix translation for strings returned during login
- // We need a generic table for translations
- std::string big_reason = LLAgent::sTeleportErrorMessages[ message_response ];
- if ( big_reason.size() == 0 )
- {
- emsg << message_response;
- }
- else
- {
- emsg << big_reason;
- }
- }
-
- if(reason_response == "tos")
- {
- if (show_connect_box)
- {
- LL_DEBUGS("AppInit") << "Need tos agreement" << LL_ENDL;
- LLStartUp::setStartupState( STATE_UPDATE_CHECK );
- LLFloaterReg::showInstance("message_tos", LLSD(message_response));
- // LLFloaterTOS deletes itself.
- return false;
- }
- else
- {
- quit = true;
- }
+ emsg << big_reason;
}
- if(reason_response == "critical")
- {
- if (show_connect_box)
- {
- LL_DEBUGS("AppInit") << "Need critical message" << LL_ENDL;
- LLStartUp::setStartupState( STATE_UPDATE_CHECK );
- LLFloaterReg::showInstance("message_critical", LLSD(message_response));
- // LLFloaterTOS deletes itself.
- return false;
- }
- else
- {
- quit = true;
- }
- }
- if(reason_response == "key")
- {
- // Couldn't login because user/password is wrong
- // Clear the password
- password = "";
- }
- if(reason_response == "update")
- {
- auth_message = LLUserAuth::getInstance()->getResponse("message");
- update = true;
- }
- if(reason_response == "optional")
- {
- LL_DEBUGS("AppInit") << "Login got optional update" << LL_ENDL;
- auth_message = LLUserAuth::getInstance()->getResponse("message");
- if (show_connect_box)
- {
- update_app(FALSE, auth_message);
- LLStartUp::setStartupState( STATE_UPDATE_CHECK );
- gSkipOptionalUpdate = TRUE;
- return false;
- }
- }
- }
- break;
- case LLUserAuth::E_COULDNT_RESOLVE_HOST:
- case LLUserAuth::E_SSL_PEER_CERTIFICATE:
- case LLUserAuth::E_UNHANDLED_ERROR:
- case LLUserAuth::E_SSL_CACERT:
- case LLUserAuth::E_SSL_CONNECT_ERROR:
- default:
- if (sAuthUriNum >= (int) sAuthUris.size() - 1)
- {
- emsg << "Unable to connect to " << LLAppViewer::instance()->getSecondLifeTitle() << ".\n";
- emsg << LLUserAuth::getInstance()->errorMessage();
- } else {
- sAuthUriNum++;
- std::ostringstream s;
- LLStringUtil::format_map_t args;
- args["[NUMBER]"] = llformat("%d", sAuthUriNum + 1);
- auth_desc = LLTrans::getString("LoginAttempt", args);
- LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
- return FALSE;
- }
- break;
- }
-
- if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
- {
- gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
- update_app(TRUE, auth_message);
- LLStartUp::setStartupState( STATE_UPDATE_CHECK );
- return false;
- }
-
- // Version update and we're not showing the dialog
- if(quit)
- {
- LLUserAuth::getInstance()->reset();
- LLAppViewer::instance()->forceQuit();
- return false;
- }
-
- if(successful_login)
- {
- std::string text;
- text = LLUserAuth::getInstance()->getResponse("udp_blacklist");
- if(!text.empty())
- {
- apply_udp_blacklist(text);
}
- // unpack login data needed by the application
- text = LLUserAuth::getInstance()->getResponse("agent_id");
- if(!text.empty()) gAgentID.set(text);
- gDebugInfo["AgentID"] = text;
-
- text = LLUserAuth::getInstance()->getResponse("session_id");
- if(!text.empty()) gAgentSessionID.set(text);
- gDebugInfo["SessionID"] = text;
-
- text = LLUserAuth::getInstance()->getResponse("secure_session_id");
- if(!text.empty()) gAgent.mSecureSessionID.set(text);
-
- text = LLUserAuth::getInstance()->getResponse("first_name");
- if(!text.empty())
+ if(reason_response == "key")
{
- // Remove quotes from string. Login.cgi sends these to force
- // names that look like numbers into strings.
- firstname.assign(text);
- LLStringUtil::replaceChar(firstname, '"', ' ');
- LLStringUtil::trim(firstname);
+ // Couldn't login because user/password is wrong
+ // Clear the password
+ gPassword = "";
}
- text = LLUserAuth::getInstance()->getResponse("last_name");
- if(!text.empty()) lastname.assign(text);
- gSavedSettings.setString("FirstName", firstname);
- gSavedSettings.setString("LastName", lastname);
- if (gSavedSettings.getBOOL("RememberPassword"))
+ if(reason_response == "update"
+ || reason_response == "optional")
{
- // Successful login means the password is valid, so save it.
- LLStartUp::savePasswordToDisk(password);
+ // In the case of a needed update, quit.
+ // Its either downloading or declined.
+ // If optional was skipped this case shouldn't
+ // be reached.
+ LLLoginInstance::getInstance()->disconnect();
+ LLAppViewer::instance()->forceQuit();
}
else
{
- // Don't leave password from previous session sitting around
- // during this login session.
- LLStartUp::deletePasswordFromDisk();
- }
-
- // this is their actual ability to access content
- text = LLUserAuth::getInstance()->getResponse("agent_access_max");
- if (!text.empty())
- {
- // agent_access can be 'A', 'M', and 'PG'.
- gAgent.setMaturity(text[0]);
- }
-
- // this is the value of their preference setting for that content
- // which will always be <= agent_access_max
- text = LLUserAuth::getInstance()->getResponse("agent_region_access");
- if (!text.empty())
- {
- int preferredMaturity = LLAgent::convertTextToMaturity(text[0]);
- gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
- }
- // During the AO transition, this flag will be true. Then the flag will
- // go away. After the AO transition, this code and all the code that
- // uses it can be deleted.
- text = LLUserAuth::getInstance()->getResponse("ao_transition");
- if (!text.empty())
- {
- if (text == "1")
+ // Don't pop up a notification in the TOS case because
+ // LLFloaterTOS::onCancel() already scolded the user.
+ if (reason_response != "tos")
{
- gAgent.setAOTransition();
- }
- }
-
- text = LLUserAuth::getInstance()->getResponse("start_location");
- if(!text.empty()) agent_start_location.assign(text);
- text = LLUserAuth::getInstance()->getResponse("circuit_code");
- if(!text.empty())
- {
- gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10);
- }
- std::string sim_ip_str = LLUserAuth::getInstance()->getResponse("sim_ip");
- std::string sim_port_str = LLUserAuth::getInstance()->getResponse("sim_port");
- if(!sim_ip_str.empty() && !sim_port_str.empty())
- {
- U32 sim_port = strtoul(sim_port_str.c_str(), NULL, 10);
- first_sim.set(sim_ip_str, sim_port);
- if (first_sim.isOk())
- {
- gMessageSystem->enableCircuit(first_sim, TRUE);
- }
- }
- std::string region_x_str = LLUserAuth::getInstance()->getResponse("region_x");
- std::string region_y_str = LLUserAuth::getInstance()->getResponse("region_y");
- if(!region_x_str.empty() && !region_y_str.empty())
- {
- U32 region_x = strtoul(region_x_str.c_str(), NULL, 10);
- U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
- first_sim_handle = to_region_handle(region_x, region_y);
- }
-
- const std::string look_at_str = LLUserAuth::getInstance()->getResponse("look_at");
- if (!look_at_str.empty())
- {
- size_t len = look_at_str.size();
- LLMemoryStream mstr((U8*)look_at_str.c_str(), len);
- LLSD sd = LLSDSerialize::fromNotation(mstr, len);
- agent_start_look_at = ll_vector3_from_sd(sd);
- }
-
- text = LLUserAuth::getInstance()->getResponse("seed_capability");
- if (!text.empty()) first_sim_seed_cap = text;
-
- text = LLUserAuth::getInstance()->getResponse("seconds_since_epoch");
- if(!text.empty())
- {
- U32 server_utc_time = strtoul(text.c_str(), NULL, 10);
- if(server_utc_time)
- {
- time_t now = time(NULL);
- gUTCOffset = (server_utc_time - now);
- }
- }
-
- std::string home_location = LLUserAuth::getInstance()->getResponse("home");
- if(!home_location.empty())
- {
- size_t len = home_location.size();
- LLMemoryStream mstr((U8*)home_location.c_str(), len);
- LLSD sd = LLSDSerialize::fromNotation(mstr, len);
- S32 region_x = sd["region_handle"][0].asInteger();
- S32 region_y = sd["region_handle"][1].asInteger();
- U64 region_handle = to_region_handle(region_x, region_y);
- LLVector3 position = ll_vector3_from_sd(sd["position"]);
- gAgent.setHomePosRegion(region_handle, position);
- }
-
- gAgent.mMOTD.assign(LLUserAuth::getInstance()->getResponse("message"));
- LLUserAuth::options_t options;
- if(LLUserAuth::getInstance()->getOptions("inventory-root", options))
- {
- LLUserAuth::response_t::iterator it;
- it = options[0].find("folder_id");
- if(it != options[0].end())
- {
- gInventory.setRootFolderID( LLUUID( (*it).second ) );
- }
- }
-
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("login-flags", options))
- {
- LLUserAuth::response_t::iterator it;
- LLUserAuth::response_t::iterator no_flag = options[0].end();
- it = options[0].find("ever_logged_in");
- if(it != no_flag)
- {
- if((*it).second == "N") gAgent.setFirstLogin(TRUE);
- else gAgent.setFirstLogin(FALSE);
- }
- it = options[0].find("stipend_since_login");
- if(it != no_flag)
- {
- if((*it).second == "Y") stipend_since_login = true;
- }
- it = options[0].find("gendered");
- if(it != no_flag)
- {
- if((*it).second == "Y") gAgent.setGenderChosen(TRUE);
- }
- it = options[0].find("daylight_savings");
- if(it != no_flag)
- {
- if((*it).second == "Y") gPacificDaylightTime = TRUE;
- else gPacificDaylightTime = FALSE;
+ LLSD args;
+ args["ERROR_MESSAGE"] = emsg.str();
+ LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL;
+ LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done);
}
//setup map of datetime strings to codes and slt & local time offset from utc
LLStringOps::setupDatetimeInfo (gPacificDaylightTime);
+ transition_back_to_login_panel(emsg.str());
+ show_connect_box = true;
}
- options.clear();
- if (LLUserAuth::getInstance()->getOptions("initial-outfit", options)
- && !options.empty())
- {
- LLUserAuth::response_t::iterator it;
- LLUserAuth::response_t::iterator it_end = options[0].end();
- it = options[0].find("folder_name");
- if(it != it_end)
- {
- // Initial outfit is a folder in your inventory,
- // must be an exact folder-name match.
- sInitialOutfit = (*it).second;
- }
- it = options[0].find("gender");
- if (it != it_end)
- {
- sInitialOutfitGender = (*it).second;
- }
- }
-
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("global-textures", options))
- {
- // Extract sun and moon texture IDs. These are used
- // in the LLVOSky constructor, but I can't figure out
- // how to pass them in. JC
- LLUserAuth::response_t::iterator it;
- LLUserAuth::response_t::iterator no_texture = options[0].end();
- it = options[0].find("sun_texture_id");
- if(it != no_texture)
- {
- gSunTextureID.set((*it).second);
- }
- it = options[0].find("moon_texture_id");
- if(it != no_texture)
- {
- gMoonTextureID.set((*it).second);
- }
- it = options[0].find("cloud_texture_id");
- if(it != no_texture)
- {
- gCloudTextureID.set((*it).second);
- }
- }
-
-
- // JC: gesture loading done below, when we have an asset system
- // in place. Don't delete/clear user_credentials until then.
-
- if(gAgentID.notNull()
- && gAgentSessionID.notNull()
- && gMessageSystem->mOurCircuitCode
- && first_sim.isOk()
- && gInventory.getRootFolderID().notNull())
+ }
+ else if(LLLoginInstance::getInstance()->authSuccess())
+ {
+ if(process_login_success_response())
{
- LLStartUp::setStartupState( STATE_WORLD_INIT );
+ // Pass the user information to the voice chat server interface.
+ gVoiceClient->userAuthorized(gFirstname, gLastname, gAgentID);
+ LLStartUp::setStartupState( STATE_WORLD_INIT);
}
else
{
- if (gNoRender)
- {
- LL_WARNS("AppInit") << "Bad login - missing return values" << LL_ENDL;
- LL_WARNS("AppInit") << emsg << LL_ENDL;
- exit(0);
- }
- // Bounce back to the login screen.
LLSD args;
args["ERROR_MESSAGE"] = emsg.str();
+ LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL;
LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done);
- reset_login();
- gSavedSettings.setBOOL("AutoLogin", FALSE);
+ transition_back_to_login_panel(emsg.str());
show_connect_box = true;
}
-
- // Pass the user information to the voice chat server interface.
- gVoiceClient->userAuthorized(firstname, lastname, gAgentID);
}
- else // if(successful_login)
+ else
{
- if (gNoRender)
- {
- LL_WARNS("AppInit") << "Failed to login!" << LL_ENDL;
- LL_WARNS("AppInit") << emsg << LL_ENDL;
- exit(0);
- }
- // Bounce back to the login screen.
- LLSD args;
- args["ERROR_MESSAGE"] = emsg.str();
- LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done);
- reset_login();
- gSavedSettings.setBOOL("AutoLogin", FALSE);
- show_connect_box = true;
+ // Still waiting for response.
+ // *TODO:Mani - Actually check for login progress.
+ // If we get here we have gotten past the potential stall
+ // in curl, so take "may appear frozen" out of progress bar. JC
+ auth_desc = LLTrans::getString("LoginInProgressNoFrozen");
+ set_startup_status(progress, auth_desc, auth_message);
}
+
return FALSE;
}
@@ -1715,14 +1227,14 @@ bool idle_startup()
// This is necessary because creating objects before this is set will result in a
// bad mPositionAgent cache.
- gAgent.initOriginGlobal(from_region_handle(first_sim_handle));
+ gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle));
- LLWorld::getInstance()->addRegion(first_sim_handle, first_sim);
+ LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
- LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle);
+ LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
- regionp->setSeedCapability(first_sim_seed_cap);
+ regionp->setSeedCapability(gFirstSimSeedCap);
LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
// Set agent's initial region to be the one we just created.
@@ -1861,7 +1373,7 @@ bool idle_startup()
// the coordinates handed to us to fit in the local region.
gAgent.setPositionAgent(agent_start_position_region);
- gAgent.resetAxes(agent_start_look_at);
+ gAgent.resetAxes(gAgentStartLookAt);
gAgent.stopCameraAnimation();
gAgent.resetCamera();
@@ -1900,18 +1412,18 @@ bool idle_startup()
LL_WARNS("AppInit") << "Attempting to connect to simulator with a zero circuit code!" << LL_ENDL;
}
- gUseCircuitCallbackCalled = FALSE;
+ gUseCircuitCallbackCalled = false;
- msg->enableCircuit(first_sim, TRUE);
+ msg->enableCircuit(gFirstSim, TRUE);
// now, use the circuit info to tell simulator about us!
- LL_INFOS("AppInit") << "viewer: UserLoginLocationReply() Enabling " << first_sim << " with code " << msg->mOurCircuitCode << LL_ENDL;
+ LL_INFOS("AppInit") << "viewer: UserLoginLocationReply() Enabling " << gFirstSim << " with code " << msg->mOurCircuitCode << LL_ENDL;
msg->newMessageFast(_PREHASH_UseCircuitCode);
msg->nextBlockFast(_PREHASH_CircuitCode);
msg->addU32Fast(_PREHASH_Code, msg->mOurCircuitCode);
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_ID, gAgent.getID());
msg->sendReliable(
- first_sim,
+ gFirstSim,
MAX_TIMEOUT_COUNT,
FALSE,
TIMEOUT_SECONDS,
@@ -2022,105 +1534,99 @@ bool idle_startup()
LLAgentLanguage::update();
// unpack thin inventory
- LLUserAuth::options_t options;
- options.clear();
+ LLSD response = LLLoginInstance::getInstance()->getResponse();
//bool dump_buffer = false;
-
- if(LLUserAuth::getInstance()->getOptions("inventory-lib-root", options)
- && !options.empty())
+
+ LLSD inv_lib_root = response["inventory-lib-root"];
+ if(inv_lib_root.isDefined())
{
// should only be one
- LLUserAuth::response_t::iterator it;
- it = options[0].find("folder_id");
- if(it != options[0].end())
+ LLSD id = inv_lib_root[0]["folder_id"];
+ if(id.isDefined())
{
- gInventory.setLibraryRootFolderID( LLUUID( (*it).second ) );
+ gInventory.setLibraryRootFolderID(id.asUUID());
}
}
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("inventory-lib-owner", options)
- && !options.empty())
+
+ LLSD inv_lib_owner = response["inventory-lib-owner"];
+ if(inv_lib_owner.isDefined())
{
// should only be one
- LLUserAuth::response_t::iterator it;
- it = options[0].find("agent_id");
- if(it != options[0].end())
+ LLSD id = inv_lib_owner[0]["agent_id"];
+ if(id.isDefined())
{
- gInventory.setLibraryOwnerID( LLUUID( (*it).second ) );
+ gInventory.setLibraryOwnerID( LLUUID(id.asUUID()));
}
}
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("inventory-skel-lib", options)
- && gInventory.getLibraryOwnerID().notNull())
+
+ LLSD inv_skel_lib = response["inventory-skel-lib"];
+ if(inv_skel_lib.isDefined() && gInventory.getLibraryOwnerID().notNull())
{
- if(!gInventory.loadSkeleton(options, gInventory.getLibraryOwnerID()))
+ if(!gInventory.loadSkeleton(inv_skel_lib, gInventory.getLibraryOwnerID()))
{
LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL;
}
}
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("inventory-skeleton", options))
+
+ LLSD inv_skeleton = response["inventory-skeleton"];
+ if(inv_skeleton.isDefined())
{
- if(!gInventory.loadSkeleton(options, gAgent.getID()))
+ if(!gInventory.loadSkeleton(inv_skeleton, gAgent.getID()))
{
LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL;
}
}
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("buddy-list", options))
+ LLSD buddy_list = response["buddy-list"];
+ if(buddy_list.isDefined())
{
- LLUserAuth::options_t::iterator it = options.begin();
- LLUserAuth::options_t::iterator end = options.end();
LLAvatarTracker::buddy_map_t list;
LLUUID agent_id;
S32 has_rights = 0, given_rights = 0;
- for (; it != end; ++it)
+ for(LLSD::array_const_iterator it = buddy_list.beginArray(),
+ end = buddy_list.endArray(); it != end; ++it)
{
- LLUserAuth::response_t::const_iterator option_it;
- option_it = (*it).find("buddy_id");
- if(option_it != (*it).end())
+ LLSD buddy_id = (*it)["buddy_id"];
+ if(buddy_id.isDefined())
{
- agent_id.set((*option_it).second);
+ agent_id = buddy_id.asUUID();
}
- option_it = (*it).find("buddy_rights_has");
- if(option_it != (*it).end())
+
+ LLSD buddy_rights_has = (*it)["buddy_rights_has"];
+ if(buddy_rights_has.isDefined())
{
- has_rights = atoi((*option_it).second.c_str());
+ has_rights = buddy_rights_has.asInteger();
}
- option_it = (*it).find("buddy_rights_given");
- if(option_it != (*it).end())
+
+ LLSD buddy_rights_given = (*it)["buddy_rights_given"];
+ if(buddy_rights_given.isDefined())
{
- given_rights = atoi((*option_it).second.c_str());
+ given_rights = buddy_rights_given.asInteger();
}
+
list[agent_id] = new LLRelationship(given_rights, has_rights, false);
}
LLAvatarTracker::instance().addBuddyList(list);
}
- options.clear();
-
bool show_hud = false;
- if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options))
+ LLSD tutorial_setting = response["tutorial_setting"];
+ if(tutorial_setting.isDefined())
{
- LLUserAuth::options_t::iterator it = options.begin();
- LLUserAuth::options_t::iterator end = options.end();
- for (; it != end; ++it)
+ for(LLSD::array_const_iterator it = tutorial_setting.beginArray(),
+ end = tutorial_setting.endArray(); it != end; ++it)
{
- LLUserAuth::response_t::const_iterator option_it;
- option_it = (*it).find("tutorial_url");
- if(option_it != (*it).end())
+ LLSD tutorial_url = (*it)["tutorial_url"];
+ if(tutorial_url.isDefined())
{
// Tutorial floater will append language code
- gSavedSettings.setString("TutorialURL", option_it->second);
+ gSavedSettings.setString("TutorialURL", tutorial_url.asString());
}
- option_it = (*it).find("use_tutorial");
- if(option_it != (*it).end())
+
+ LLSD use_tutorial = (*it)["use_tutorial"];
+ if(use_tutorial.asString() == "true")
{
- if (option_it->second == "true")
- {
- show_hud = true;
- }
+ show_hud = true;
}
}
}
@@ -2132,19 +1638,22 @@ bool idle_startup()
LLFloaterReg::showInstance("hud", LLSD(), FALSE);
}
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("event_categories", options))
+ LLSD event_categories = response["event_categories"];
+ if(event_categories.isDefined())
{
- LLEventInfo::loadCategories(options);
+ LLEventInfo::loadCategories(event_categories);
}
- if(LLUserAuth::getInstance()->getOptions("event_notifications", options))
+
+ LLSD event_notifications = response["event_notifications"];
+ if(event_notifications.isDefined())
{
- gEventNotifier.load(options);
+ gEventNotifier.load(event_notifications);
}
- options.clear();
- if(LLUserAuth::getInstance()->getOptions("classified_categories", options))
+
+ LLSD classified_categories = response["classified_categories"];
+ if(classified_categories.isDefined())
{
- LLClassifiedInfo::loadCategories(options);
+ LLClassifiedInfo::loadCategories(classified_categories);
}
@@ -2212,7 +1721,7 @@ bool idle_startup()
// This is actually a pessimistic computation, because TCP may not have enough
// time to ramp up on the (small) default inventory file to truly measure max
// bandwidth. JC
- F64 rate_bps = LLUserAuth::getInstance()->getLastTransferRateBPS();
+ F64 rate_bps = LLLoginInstance::getInstance()->getLastTransferRateBPS();
const F32 FAST_RATE_BPS = 600.f * 1024.f;
const F32 FASTER_RATE_BPS = 750.f * 1024.f;
F32 max_bandwidth = gViewerThrottle.getMaxBandwidth();
@@ -2260,34 +1769,20 @@ bool idle_startup()
// JC: Initialize "active" gestures. This may also trigger
// many gesture downloads, if this is the user's first
// time on this machine or -purge has been run.
- LLUserAuth::options_t gesture_options;
- if (LLUserAuth::getInstance()->getOptions("gestures", gesture_options))
+ LLSD gesture_options
+ = LLLoginInstance::getInstance()->getResponse("gestures");
+ if (gesture_options.isDefined())
{
LL_DEBUGS("AppInit") << "Gesture Manager loading " << gesture_options.size()
<< LL_ENDL;
std::vector<LLUUID> item_ids;
- LLUserAuth::options_t::iterator resp_it;
- for (resp_it = gesture_options.begin();
- resp_it != gesture_options.end();
- ++resp_it)
+ for(LLSD::array_const_iterator resp_it = gesture_options.beginArray(),
+ end = gesture_options.endArray(); resp_it != end; ++resp_it)
{
- const LLUserAuth::response_t& response = *resp_it;
- LLUUID item_id;
- LLUUID asset_id;
- LLUserAuth::response_t::const_iterator option_it;
-
- option_it = response.find("item_id");
- if (option_it != response.end())
- {
- const std::string& uuid_string = (*option_it).second;
- item_id.set(uuid_string);
- }
- option_it = response.find("asset_id");
- if (option_it != response.end())
- {
- const std::string& uuid_string = (*option_it).second;
- asset_id.set(uuid_string);
- }
+ // If the id is not specifed in the LLSD,
+ // the LLSD operator[]() will return a null LLUUID.
+ LLUUID item_id = (*resp_it)["item_id"];
+ LLUUID asset_id = (*resp_it)["asset_id"];
if (item_id.notNull() && asset_id.notNull())
{
@@ -2343,8 +1838,8 @@ bool idle_startup()
if (!gAgent.isFirstLogin())
{
bool url_ok = LLURLSimString::sInstance.parse();
- if ((url_ok && agent_start_location == "url") ||
- (!url_ok && ((agent_start_location == gSavedSettings.getString("LoginLocation")))))
+ if ((url_ok && gAgentStartLocation == "url") ||
+ (!url_ok && ((gAgentStartLocation == gSavedSettings.getString("LoginLocation")))))
{
// Start location is OK
// Disabled code to restore camera location and focus if logging in to default location
@@ -2557,8 +2052,10 @@ bool idle_startup()
// then the data is cached for the viewer's lifetime)
LLProductInfoRequestManager::instance();
+ // *FIX:Mani - What do I do here?
+ // Need we really clear the Auth response data?
// Clean up the userauth stuff.
- LLUserAuth::getInstance()->reset();
+ // LLUserAuth::getInstance()->reset();
LLStartUp::setStartupState( STATE_STARTED );
@@ -2848,230 +2345,6 @@ bool login_alert_status(const LLSD& notification, const LLSD& response)
return false;
}
-void update_app(BOOL mandatory, const std::string& auth_msg)
-{
- // store off config state, as we might quit soon
- gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
- LLUIColorTable::instance().saveUserSettings();
- std::ostringstream message;
-
- std::string msg;
- if (!auth_msg.empty())
- {
- msg = "("+ auth_msg + ") \n";
- }
-
- LLSD args;
- args["MESSAGE"] = msg;
-
- LLSD payload;
- payload["mandatory"] = mandatory;
-
-/*
- We're constructing one of the following 6 strings here:
- "DownloadWindowsMandatory"
- "DownloadWindowsReleaseForDownload"
- "DownloadWindows"
- "DownloadMacMandatory"
- "DownloadMacReleaseForDownload"
- "DownloadMac"
-
- I've called them out explicitly in this comment so that they can be grepped for.
-
- Also, we assume that if we're not Windows we're Mac. If we ever intend to support
- Linux with autoupdate, this should be an explicit #elif LL_DARWIN, but
- we'd rather deliver the wrong message than no message, so until Linux is supported
- we'll leave it alone.
- */
- std::string notification_name = "Download";
-
-#if LL_WINDOWS
- notification_name += "Windows";
-#elif LL_DARWIN
- notification_name += "Mac";
-#else
- notification_name += "Linux";
-#endif
-
- if (mandatory)
- {
- notification_name += "Mandatory";
- }
- else
- {
-#if LL_RELEASE_FOR_DOWNLOAD
- notification_name += "ReleaseForDownload";
-#endif
- }
-
- LLNotifications::instance().add(notification_name, args, payload, update_dialog_callback);
-}
-
-bool update_dialog_callback(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotification::getSelectedOption(notification, response);
- std::string update_exe_path;
- bool mandatory = notification["payload"]["mandatory"].asBoolean();
-
-#if !LL_RELEASE_FOR_DOWNLOAD
- if (option == 2)
- {
- LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
- return false;
- }
-#endif
-
- if (option == 1)
- {
- // ...user doesn't want to do it
- if (mandatory)
- {
- LLAppViewer::instance()->forceQuit();
- // Bump them back to the login screen.
- //reset_login();
- }
- else
- {
- LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
- }
- return false;
- }
-
- // if a sim name was passed in via command line parameter (typically through a SLURL)
- if ( LLURLSimString::sInstance.mSimString.length() )
- {
- // record the location to start at next time
- gSavedSettings.setString("NextLoginLocation", LLURLSimString::sInstance.mSimString);
- }
-
- LLSD query_map = LLSD::emptyMap();
- // *TODO place os string in a global constant
-#if LL_WINDOWS
- query_map["os"] = "win";
-#elif LL_DARWIN
- query_map["os"] = "mac";
-#elif LL_LINUX
- query_map["os"] = "lnx";
-#elif LL_SOLARIS
- query_map["os"] = "sol";
-#endif
- // *TODO change userserver to be grid on both viewer and sim, since
- // userserver no longer exists.
- query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel();
- query_map["channel"] = gSavedSettings.getString("VersionChannelName");
- // *TODO constantize this guy
- // *NOTE: This URL is also used in win_setup/lldownloader.cpp
- LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
-
- if(LLAppViewer::sUpdaterInfo)
- {
- delete LLAppViewer::sUpdaterInfo ;
- }
- LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ;
-
-#if LL_WINDOWS
- LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename();
- if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty())
- {
- delete LLAppViewer::sUpdaterInfo ;
- LLAppViewer::sUpdaterInfo = NULL ;
-
- // We're hosed, bail
- LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL;
- LLAppViewer::instance()->forceQuit();
- return false;
- }
-
- LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe";
-
- std::string updater_source = gDirUtilp->getAppRODataDir();
- updater_source += gDirUtilp->getDirDelimiter();
- updater_source += "updater.exe";
-
- LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source
- << " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath
- << LL_ENDL;
-
-
- if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE))
- {
- delete LLAppViewer::sUpdaterInfo ;
- LLAppViewer::sUpdaterInfo = NULL ;
-
- LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL;
- LLAppViewer::instance()->forceQuit();
- return false;
- }
-
- LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\"";
-
- LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL;
-
- //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird.
- LLAppViewer::instance()->removeMarkerFile(); // In case updater fails
-
-#elif LL_DARWIN
- LLAppViewer::sUpdaterInfo->mUpdateExePath = "'";
- LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir();
- LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \"";
- LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString();
- LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \"";
- LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle();
- LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &";
-
- LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
-
- // Run the auto-updater.
- system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
-
-#elif (LL_LINUX || LL_SOLARIS) && LL_GTK
- // we tell the updater where to find the xml containing string
- // translations which it can use for its own UI
- std::string xml_strings_file = "strings.xml";
- std::vector<std::string> xui_path_vec = LLUI::getXUIPaths();
- std::string xml_search_paths;
- std::vector<std::string>::const_iterator iter;
- // build comma-delimited list of xml paths to pass to updater
- for (iter = xui_path_vec.begin(); iter != xui_path_vec.end(); )
- {
- std::string this_skin_dir = gDirUtilp->getDefaultSkinDir()
- + gDirUtilp->getDirDelimiter()
- + (*iter);
- llinfos << "Got a XUI path: " << this_skin_dir << llendl;
- xml_search_paths.append(this_skin_dir);
- ++iter;
- if (iter != xui_path_vec.end())
- xml_search_paths.append(","); // comma-delimit
- }
- // build the overall command-line to run the updater correctly
- update_exe_path =
- gDirUtilp->getExecutableDir() + "/" + "linux-updater.bin" +
- " --url \"" + update_url.asString() + "\"" +
- " --name \"" + LLAppViewer::instance()->getSecondLifeTitle() + "\"" +
- " --dest \"" + gDirUtilp->getAppRODataDir() + "\"" +
- " --stringsdir \"" + xml_search_paths + "\"" +
- " --stringsfile \"" + xml_strings_file + "\"";
-
- LL_INFOS("AppInit") << "Calling updater: "
- << update_exe_path << LL_ENDL;
-
- // *TODO: we could use the gdk equivilant to ensure the updater
- // gets started on the same screen.
- GError *error = NULL;
- if (!g_spawn_command_line_async(update_exe_path.c_str(), &error))
- {
- llerrs << "Failed to launch updater: "
- << error->message
- << llendl;
- }
- if (error)
- g_error_free(error);
-#else
- OSMessageBox(LLTrans::getString("MBNoAutoUpdate"), LLStringUtil::null, OSMB_OK);
-#endif
- LLAppViewer::instance()->forceQuit();
- return false;
-}
void use_circuit_callback(void**, S32 result)
{
@@ -3427,11 +2700,7 @@ std::string LLStartUp::startupStateToString(EStartupState state)
RTNENUM( STATE_LOGIN_SHOW );
RTNENUM( STATE_LOGIN_WAIT );
RTNENUM( STATE_LOGIN_CLEANUP );
- RTNENUM( STATE_UPDATE_CHECK );
RTNENUM( STATE_LOGIN_AUTH_INIT );
- RTNENUM( STATE_LOGIN_AUTHENTICATE );
- RTNENUM( STATE_LOGIN_NO_DATA_YET );
- RTNENUM( STATE_LOGIN_DOWNLOADING );
RTNENUM( STATE_LOGIN_PROCESS_RESPONSE );
RTNENUM( STATE_WORLD_INIT );
RTNENUM( STATE_SEED_GRANTED_WAIT );
@@ -3451,14 +2720,17 @@ std::string LLStartUp::startupStateToString(EStartupState state)
#undef RTNENUM
}
-
// static
void LLStartUp::setStartupState( EStartupState state )
{
LL_INFOS("AppInit") << "Startup state changing from " <<
- startupStateToString(gStartupState) << " to " <<
+ getStartupStateString() << " to " <<
startupStateToString(state) << LL_ENDL;
gStartupState = state;
+ LLSD stateInfo;
+ stateInfo["str"] = getStartupStateString();
+ stateInfo["enum"] = state;
+ sStartupStateWatcher.post(stateInfo);
}
@@ -3572,3 +2844,266 @@ void apply_udp_blacklist(const std::string& csv)
}
+bool process_login_success_response()
+{
+ LLSD response = LLLoginInstance::getInstance()->getResponse();
+
+ std::string text(response["udp_blacklist"]);
+ if(!text.empty())
+ {
+ apply_udp_blacklist(text);
+ }
+
+ // unpack login data needed by the application
+ text = response["agent_id"].asString();
+ if(!text.empty()) gAgentID.set(text);
+ gDebugInfo["AgentID"] = text;
+
+ text = response["session_id"].asString();
+ if(!text.empty()) gAgentSessionID.set(text);
+ gDebugInfo["SessionID"] = text;
+
+ text = response["secure_session_id"].asString();
+ if(!text.empty()) gAgent.mSecureSessionID.set(text);
+
+ text = response["first_name"].asString();
+ if(!text.empty())
+ {
+ // Remove quotes from string. Login.cgi sends these to force
+ // names that look like numbers into strings.
+ gFirstname.assign(text);
+ LLStringUtil::replaceChar(gFirstname, '"', ' ');
+ LLStringUtil::trim(gFirstname);
+ }
+ text = response["last_name"].asString();
+ if(!text.empty())
+ {
+ gLastname.assign(text);
+ }
+ gSavedSettings.setString("FirstName", gFirstname);
+ gSavedSettings.setString("LastName", gLastname);
+
+ if (gSavedSettings.getBOOL("RememberPassword"))
+ {
+ // Successful login means the password is valid, so save it.
+ LLStartUp::savePasswordToDisk(gPassword);
+ }
+ else
+ {
+ // Don't leave password from previous session sitting around
+ // during this login session.
+ LLStartUp::deletePasswordFromDisk();
+ }
+
+ // this is their actual ability to access content
+ text = response["agent_access_max"].asString();
+ if (!text.empty())
+ {
+ // agent_access can be 'A', 'M', and 'PG'.
+ gAgent.setMaturity(text[0]);
+ }
+
+ // this is the value of their preference setting for that content
+ // which will always be <= agent_access_max
+ text = response["agent_region_access"].asString();
+ if (!text.empty())
+ {
+ int preferredMaturity = LLAgent::convertTextToMaturity(text[0]);
+ gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
+ }
+ // During the AO transition, this flag will be true. Then the flag will
+ // go away. After the AO transition, this code and all the code that
+ // uses it can be deleted.
+ text = response["ao_transition"].asString();
+ if (!text.empty())
+ {
+ if (text == "1")
+ {
+ gAgent.setAOTransition();
+ }
+ }
+
+ text = response["start_location"].asString();
+ if(!text.empty())
+ {
+ gAgentStartLocation.assign(text);
+ }
+
+ text = response["circuit_code"].asString();
+ if(!text.empty())
+ {
+ gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10);
+ }
+ std::string sim_ip_str = response["sim_ip"];
+ std::string sim_port_str = response["sim_port"];
+ if(!sim_ip_str.empty() && !sim_port_str.empty())
+ {
+ U32 sim_port = strtoul(sim_port_str.c_str(), NULL, 10);
+ gFirstSim.set(sim_ip_str, sim_port);
+ if (gFirstSim.isOk())
+ {
+ gMessageSystem->enableCircuit(gFirstSim, TRUE);
+ }
+ }
+ std::string region_x_str = response["region_x"];
+ std::string region_y_str = response["region_y"];
+ if(!region_x_str.empty() && !region_y_str.empty())
+ {
+ U32 region_x = strtoul(region_x_str.c_str(), NULL, 10);
+ U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
+ gFirstSimHandle = to_region_handle(region_x, region_y);
+ }
+
+ const std::string look_at_str = response["look_at"];
+ if (!look_at_str.empty())
+ {
+ size_t len = look_at_str.size();
+ LLMemoryStream mstr((U8*)look_at_str.c_str(), len);
+ LLSD sd = LLSDSerialize::fromNotation(mstr, len);
+ gAgentStartLookAt = ll_vector3_from_sd(sd);
+ }
+
+ text = response["seed_capability"].asString();
+ if (!text.empty()) gFirstSimSeedCap = text;
+
+ text = response["seconds_since_epoch"].asString();
+ if(!text.empty())
+ {
+ U32 server_utc_time = strtoul(text.c_str(), NULL, 10);
+ if(server_utc_time)
+ {
+ time_t now = time(NULL);
+ gUTCOffset = (server_utc_time - now);
+ }
+ }
+
+ std::string home_location = response["home"];
+ if(!home_location.empty())
+ {
+ size_t len = home_location.size();
+ LLMemoryStream mstr((U8*)home_location.c_str(), len);
+ LLSD sd = LLSDSerialize::fromNotation(mstr, len);
+ S32 region_x = sd["region_handle"][0].asInteger();
+ S32 region_y = sd["region_handle"][1].asInteger();
+ U64 region_handle = to_region_handle(region_x, region_y);
+ LLVector3 position = ll_vector3_from_sd(sd["position"]);
+ gAgent.setHomePosRegion(region_handle, position);
+ }
+
+ gAgent.mMOTD.assign(response["message"]);
+
+ // Options...
+ // Each 'option' is an array of submaps.
+ // It appears that we only ever use the first element of the array.
+ LLUUID inv_root_folder_id = response["inventory-root"][0]["folder_id"];
+ if(inv_root_folder_id.notNull())
+ {
+ gInventory.setRootFolderID(inv_root_folder_id);
+ //gInventory.mock(gAgent.getInventoryRootID());
+ }
+
+ LLSD login_flags = response["login-flags"][0];
+ if(login_flags.size())
+ {
+ std::string flag = login_flags["ever_logged_in"];
+ if(!flag.empty())
+ {
+ gAgent.setFirstLogin((flag == "N") ? TRUE : FALSE);
+ }
+
+ /* Flag is currently ignored by the viewer.
+ flag = login_flags["stipend_since_login"];
+ if(flag == "Y")
+ {
+ stipend_since_login = true;
+ }
+ */
+
+ flag = login_flags["gendered"].asString();
+ if(flag == "Y")
+ {
+ gAgent.setGenderChosen(TRUE);
+ }
+
+ flag = login_flags["daylight_savings"].asString();
+ if(flag == "Y")
+ {
+ gPacificDaylightTime = (flag == "Y") ? TRUE : FALSE;
+ }
+
+ //setup map of datetime strings to codes and slt & local time offset from utc
+ LLStringOps::setupDatetimeInfo (gPacificDaylightTime);
+ }
+
+ LLSD initial_outfit = response["initial-outfit"][0];
+ if(initial_outfit.size())
+ {
+ std::string flag = initial_outfit["folder_name"];
+ if(!flag.empty())
+ {
+ // Initial outfit is a folder in your inventory,
+ // must be an exact folder-name match.
+ sInitialOutfit = flag;
+ }
+
+ flag = initial_outfit["gender"].asString();
+ if(!flag.empty())
+ {
+ sInitialOutfitGender = flag;
+ }
+ }
+
+ LLSD global_textures = response["global-textures"][0];
+ if(global_textures.size())
+ {
+ // Extract sun and moon texture IDs. These are used
+ // in the LLVOSky constructor, but I can't figure out
+ // how to pass them in. JC
+ LLUUID id = global_textures["sun_texture_id"];
+ if(id.notNull())
+ {
+ gSunTextureID = id;
+ }
+
+ id = global_textures["moon_texture_id"];
+ if(id.notNull())
+ {
+ gMoonTextureID = id;
+ }
+
+ id = global_textures["cloud_texture_id"];
+ if(id.notNull())
+ {
+ gCloudTextureID = id;
+ }
+ }
+
+
+ bool success = false;
+ // JC: gesture loading done below, when we have an asset system
+ // in place. Don't delete/clear user_credentials until then.
+ if(gAgentID.notNull()
+ && gAgentSessionID.notNull()
+ && gMessageSystem->mOurCircuitCode
+ && gFirstSim.isOk()
+ && gInventory.getRootFolderID().notNull())
+ {
+ success = true;
+ }
+
+ return success;
+}
+
+void transition_back_to_login_panel(const std::string& emsg)
+{
+ if (gNoRender)
+ {
+ LL_WARNS("AppInit") << "Failed to login!" << LL_ENDL;
+ LL_WARNS("AppInit") << emsg << LL_ENDL;
+ exit(0);
+ }
+
+ // Bounce back to the login screen.
+ reset_login(); // calls LLStartUp::setStartupState( STATE_LOGIN_SHOW );
+ gSavedSettings.setBOOL("AutoLogin", FALSE);
+}
diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h
index 4532c5e586..7f869d014f 100644
--- a/indra/newview/llstartup.h
+++ b/indra/newview/llstartup.h
@@ -50,11 +50,7 @@ typedef enum {
STATE_LOGIN_SHOW, // Show login screen
STATE_LOGIN_WAIT, // Wait for user input at login screen
STATE_LOGIN_CLEANUP, // Get rid of login screen and start login
- STATE_UPDATE_CHECK, // Wait for user at a dialog box (updates, term-of-service, etc)
STATE_LOGIN_AUTH_INIT, // Start login to SL servers
- STATE_LOGIN_AUTHENTICATE, // Do authentication voodoo
- STATE_LOGIN_NO_DATA_YET, // Waiting for authentication replies to start
- STATE_LOGIN_DOWNLOADING, // Waiting for authentication replies to download
STATE_LOGIN_PROCESS_RESPONSE, // Check authentication reply
STATE_WORLD_INIT, // Start building the world
STATE_MULTIMEDIA_INIT, // Init the rest of multimedia library
@@ -75,8 +71,6 @@ typedef enum {
// exported symbols
extern bool gAgentMovementCompleted;
extern LLPointer<LLViewerTexture> gStartTexture;
-extern std::string gInitialOutfit;
-extern std::string gInitialOutfitGender; // "male" or "female"
class LLStartUp
{
diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp
new file mode 100644
index 0000000000..9c643e78de
--- /dev/null
+++ b/indra/newview/lluilistener.cpp
@@ -0,0 +1,50 @@
+/**
+ * @file lluilistener.cpp
+ * @author Nat Goodspeed
+ * @date 2009-08-18
+ * @brief Implementation for lluilistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "llviewerprecompiledheaders.h"
+// associated header
+#include "lluilistener.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+#include "lluictrl.h"
+#include "llerror.h"
+
+LLUIListener::LLUIListener(const std::string& name):
+ LLDispatchListener(name, "op")
+{
+ add("call", &LLUIListener::call, LLSD().insert("function", LLSD()));
+}
+
+void LLUIListener::call(const LLSD& event) const
+{
+ LLUICtrl::commit_callback_t* func =
+ LLUICtrl::CommitCallbackRegistry::getValue(event["function"]);
+ if (! func)
+ {
+ // This API is intended for use by a script. It's a fire-and-forget
+ // API: we provide no reply. Therefore, a typo in the script will
+ // provide no feedback whatsoever to that script. To rub the coder's
+ // nose in such an error, crump rather than quietly ignoring it.
+ LL_ERRS("LLUIListener") << "function '" << event["function"] << "' not found" << LL_ENDL;
+ }
+ else
+ {
+ // Interestingly, view_listener_t::addMenu() (addCommit(),
+ // addEnable()) constructs a commit_callback_t callable that accepts
+ // two parameters but discards the first. Only the second is passed to
+ // handleEvent(). Therefore we feel completely safe passing NULL for
+ // the first parameter.
+ (*func)(NULL, event["parameter"]);
+ }
+}
diff --git a/indra/newview/lluilistener.h b/indra/newview/lluilistener.h
new file mode 100644
index 0000000000..ea904a99ff
--- /dev/null
+++ b/indra/newview/lluilistener.h
@@ -0,0 +1,29 @@
+/**
+ * @file lluilistener.h
+ * @author Nat Goodspeed
+ * @date 2009-08-18
+ * @brief Engage named functions as specified by XUI
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLUILISTENER_H)
+#define LL_LLUILISTENER_H
+
+#include "lleventdispatcher.h"
+#include <string>
+
+class LLSD;
+
+class LLUIListener: public LLDispatchListener
+{
+public:
+ LLUIListener(const std::string& name);
+
+private:
+ void call(const LLSD& event) const;
+};
+
+#endif /* ! defined(LL_LLUILISTENER_H) */
diff --git a/indra/newview/llviewercontrollistener.cpp b/indra/newview/llviewercontrollistener.cpp
new file mode 100644
index 0000000000..ecba1b8eb0
--- /dev/null
+++ b/indra/newview/llviewercontrollistener.cpp
@@ -0,0 +1,102 @@
+/**
+ * @file llviewercontrollistener.cpp
+ * @author Brad Kittenbrink
+ * @date 2009-07-09
+ * @brief Implementation for llviewercontrollistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llviewercontrollistener.h"
+
+#include "llviewercontrol.h"
+
+LLViewerControlListener gSavedSettingsListener;
+
+LLViewerControlListener::LLViewerControlListener()
+ : LLDispatchListener("LLViewerControl", "group")
+{
+ add("Global", boost::bind(&LLViewerControlListener::set, &gSavedSettings, _1));
+ add("PerAccount", boost::bind(&LLViewerControlListener::set, &gSavedPerAccountSettings, _1));
+ add("Warning", boost::bind(&LLViewerControlListener::set, &gWarningSettings, _1));
+ add("Crash", boost::bind(&LLViewerControlListener::set, &gCrashSettings, _1));
+
+#if 0
+ add(/*"toggleControl",*/ "Global", boost::bind(&LLViewerControlListener::toggleControl, &gSavedSettings, _1));
+ add(/*"toggleControl",*/ "PerAccount", boost::bind(&LLViewerControlListener::toggleControl, &gSavedPerAccountSettings, _1));
+ add(/*"toggleControl",*/ "Warning", boost::bind(&LLViewerControlListener::toggleControl, &gWarningSettings, _1));
+ add(/*"toggleControl",*/ "Crash", boost::bind(&LLViewerControlListener::toggleControl, &gCrashSettings, _1));
+
+ add(/*"setDefault",*/ "Global", boost::bind(&LLViewerControlListener::setDefault, &gSavedSettings, _1));
+ add(/*"setDefault",*/ "PerAccount", boost::bind(&LLViewerControlListener::setDefault, &gSavedPerAccountSettings, _1));
+ add(/*"setDefault",*/ "Warning", boost::bind(&LLViewerControlListener::setDefault, &gWarningSettings, _1));
+ add(/*"setDefault",*/ "Crash", boost::bind(&LLViewerControlListener::setDefault, &gCrashSettings, _1));
+#endif // 0
+}
+
+//static
+void LLViewerControlListener::set(LLControlGroup * controls, LLSD const & event_data)
+{
+ if(event_data.has("key"))
+ {
+ std::string key(event_data["key"]);
+
+ if(controls->controlExists(key))
+ {
+ controls->setUntypedValue(key, event_data["value"]);
+ }
+ else
+ {
+ llwarns << "requested unknown control: \"" << key << '\"' << llendl;
+ }
+ }
+}
+
+//static
+void LLViewerControlListener::toggleControl(LLControlGroup * controls, LLSD const & event_data)
+{
+ if(event_data.has("key"))
+ {
+ std::string key(event_data["key"]);
+
+ if(controls->controlExists(key))
+ {
+ LLControlVariable * control = controls->getControl(key);
+ if(control->isType(TYPE_BOOLEAN))
+ {
+ control->set(!control->get().asBoolean());
+ }
+ else
+ {
+ llwarns << "requested toggle of non-boolean control: \"" << key << "\", type is " << control->type() << llendl;
+ }
+ }
+ else
+ {
+ llwarns << "requested unknown control: \"" << key << '\"' << llendl;
+ }
+ }
+}
+
+//static
+void LLViewerControlListener::setDefault(LLControlGroup * controls, LLSD const & event_data)
+{
+ if(event_data.has("key"))
+ {
+ std::string key(event_data["key"]);
+
+ if(controls->controlExists(key))
+ {
+ LLControlVariable * control = controls->getControl(key);
+ control->resetToDefault();
+ }
+ else
+ {
+ llwarns << "requested unknown control: \"" << key << '\"' << llendl;
+ }
+ }
+}
diff --git a/indra/newview/llviewercontrollistener.h b/indra/newview/llviewercontrollistener.h
new file mode 100644
index 0000000000..cacf97e908
--- /dev/null
+++ b/indra/newview/llviewercontrollistener.h
@@ -0,0 +1,33 @@
+/**
+ * @file llviewercontrollistener.h
+ * @author Brad Kittenbrink
+ * @date 2009-07-09
+ * @brief Event API for subset of LLViewerControl methods
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLVIEWERCONTROLLISTENER_H
+#define LL_LLVIEWERCONTROLLISTENER_H
+
+#include "lleventdispatcher.h"
+
+class LLControlGroup;
+class LLSD;
+
+class LLViewerControlListener : public LLDispatchListener
+{
+public:
+ LLViewerControlListener();
+
+private:
+ static void set(LLControlGroup *controls, LLSD const & event_data);
+ static void toggleControl(LLControlGroup *controls, LLSD const & event_data);
+ static void setDefault(LLControlGroup *controls, LLSD const & event_data);
+};
+
+extern LLViewerControlListener gSavedSettingsListener;
+
+#endif // LL_LLVIEWERCONTROLLISTENER_H
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index f033d66c1f..5289037c7a 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -762,6 +762,11 @@ void LLViewerMediaImpl::navigateStop()
bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask)
{
bool result = false;
+ // *NOTE:Mani - if this doesn't exist llmozlib goes crashy in the debug build.
+ // LLMozlib::init wants to write some files to <exe_dir>/components
+ std::string debug_init_component_dir( gDirUtilp->getExecutableDir() );
+ debug_init_component_dir += "/components";
+ LLAPRFile::makeDir(debug_init_component_dir.c_str());
if (mMediaSource)
{
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 12d5687877..22fe0a043b 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -209,6 +209,7 @@
#include "llwaterparammanager.h"
#include "llfloaternotificationsconsole.h"
#include "llfloatercamera.h"
+#include "lluilistener.h"
#include "lltexlayer.h"
#include "llappearancemgr.h"
@@ -420,6 +421,8 @@ public:
static LLMenuParcelObserver* gMenuParcelObserver = NULL;
+static LLUIListener sUIListener("UI");
+
LLMenuParcelObserver::LLMenuParcelObserver()
{
LLViewerParcelMgr::getInstance()->addObserver(this);
@@ -6967,7 +6970,7 @@ void force_error_bad_memory_access(void *)
void force_error_infinite_loop(void *)
{
- LLAppViewer::instance()->forceErrorInifiniteLoop();
+ LLAppViewer::instance()->forceErrorInfiniteLoop();
}
void force_error_software_exception(void *)
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index 918b15ef09..801c46035a 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -35,6 +35,8 @@
#include "llviewernetwork.h"
#include "llviewercontrol.h"
+#include "llevents.h"
+#include "lllogin.h"
struct LLGridData
{
@@ -155,6 +157,10 @@ LLViewerLogin::LLViewerLogin() :
{
}
+ LLViewerLogin::~LLViewerLogin()
+ {
+ }
+
void LLViewerLogin::setGridChoice(EGridInfo grid)
{
if(grid < 0 || grid >= GRID_INFO_COUNT)
diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h
index 4001ed05c1..edae6dc47b 100644
--- a/indra/newview/llviewernetwork.h
+++ b/indra/newview/llviewernetwork.h
@@ -34,7 +34,10 @@
#ifndef LL_LLVIEWERNETWORK_H
#define LL_LLVIEWERNETWORK_H
+#include <boost/scoped_ptr.hpp>
+
class LLHost;
+class LLLogin;
enum EGridInfo
{
@@ -74,6 +77,7 @@ class LLViewerLogin : public LLSingleton<LLViewerLogin>
{
public:
LLViewerLogin();
+ ~LLViewerLogin();
void setGridChoice(EGridInfo grid);
void setGridChoice(const std::string& grid_name);
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index c5b09403cb..a1db48529e 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -57,6 +57,7 @@
#include "llparcelselection.h"
#include "llresmgr.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
#include "llstatusbar.h"
#include "llui.h"
#include "llviewertexture.h"
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f7fbe96aa7..b4f1b5f4f5 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -32,6 +32,10 @@
#include "llviewerprecompiledheaders.h"
+#if LL_WINDOWS
+#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
+#endif
+
// system library includes
#include <stdio.h>
#include <iostream>
@@ -195,6 +199,7 @@
#include "llfloaternotificationsconsole.h"
#include "llnearbychat.h"
+#include "llviewerwindowlistener.h"
#if LL_WINDOWS
#include <tchar.h> // For Unicode conversion methods
@@ -1200,7 +1205,8 @@ LLViewerWindow::LLViewerWindow(
mResDirty(false),
mStatesDirty(false),
mIsFullscreenChecked(false),
- mCurrResolutionIndex(0)
+ mCurrResolutionIndex(0),
+ mViewerWindowListener(new LLViewerWindowListener("LLViewerWindow", this))
{
LLNotificationChannel::buildChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert"));
LLNotificationChannel::buildChannel("VW_alertmodal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal"));
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index e4f6240fc7..5d54cf1b7f 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -53,6 +53,8 @@
#include <boost/function.hpp>
#include <boost/signals2.hpp>
+#include <boost/scoped_ptr.hpp>
+
class LLView;
class LLViewerObject;
@@ -65,6 +67,7 @@ class LLImageRaw;
class LLHUDIcon;
class LLWindow;
class LLRootView;
+class LLViewerWindowListener;
#define PICK_HALF_WIDTH 5
#define PICK_DIAMETER (2 * PICK_HALF_WIDTH + 1)
@@ -451,6 +454,8 @@ protected:
bool mIsFullscreenChecked; // Did the user check the fullscreen checkbox in the display settings
U32 mCurrResolutionIndex;
+ boost::scoped_ptr<LLViewerWindowListener> mViewerWindowListener;
+
protected:
static std::string sSnapshotBaseName;
static std::string sSnapshotDir;
diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp
new file mode 100644
index 0000000000..317e361c80
--- /dev/null
+++ b/indra/newview/llviewerwindowlistener.cpp
@@ -0,0 +1,87 @@
+/**
+ * @file llviewerwindowlistener.cpp
+ * @author Nat Goodspeed
+ * @date 2009-06-30
+ * @brief Implementation for llviewerwindowlistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "llviewerprecompiledheaders.h"
+// associated header
+#include "llviewerwindowlistener.h"
+// STL headers
+#include <map>
+// std headers
+// external library headers
+// other Linden headers
+#include "llviewerwindow.h"
+
+LLViewerWindowListener::LLViewerWindowListener(const std::string& pumpname, LLViewerWindow* llviewerwindow):
+ LLDispatchListener(pumpname, "op"),
+ mViewerWindow(llviewerwindow)
+{
+ // add() every method we want to be able to invoke via this event API.
+ LLSD saveSnapshotArgs;
+ saveSnapshotArgs["filename"] = LLSD::String();
+ saveSnapshotArgs["reply"] = LLSD::String();
+ // The following are optional, so don't build them into required prototype.
+// saveSnapshotArgs["width"] = LLSD::Integer();
+// saveSnapshotArgs["height"] = LLSD::Integer();
+// saveSnapshotArgs["showui"] = LLSD::Boolean();
+// saveSnapshotArgs["rebuild"] = LLSD::Boolean();
+// saveSnapshotArgs["type"] = LLSD::String();
+ add("saveSnapshot", &LLViewerWindowListener::saveSnapshot, saveSnapshotArgs);
+ add("requestReshape", &LLViewerWindowListener::requestReshape);
+}
+
+void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
+{
+ LLReqID reqid(event);
+ typedef std::map<LLSD::String, LLViewerWindow::ESnapshotType> TypeMap;
+ TypeMap types;
+#define tp(name) types[#name] = LLViewerWindow::SNAPSHOT_TYPE_##name
+ tp(COLOR);
+ tp(DEPTH);
+ tp(OBJECT_ID);
+#undef tp
+ // Our add() call should ensure that the incoming LLSD does in fact
+ // contain our required arguments. Deal with the optional ones.
+ S32 width (mViewerWindow->getWindowDisplayWidth());
+ S32 height(mViewerWindow->getWindowDisplayHeight());
+ if (event.has("width"))
+ width = event["width"].asInteger();
+ if (event.has("height"))
+ height = event["height"].asInteger();
+ // showui defaults to true, requiring special treatment
+ bool showui = true;
+ if (event.has("showui"))
+ showui = event["showui"].asBoolean();
+ bool rebuild(event["rebuild"]); // defaults to false
+ LLViewerWindow::ESnapshotType type(LLViewerWindow::SNAPSHOT_TYPE_COLOR);
+ if (event.has("type"))
+ {
+ TypeMap::const_iterator found = types.find(event["type"]);
+ if (found == types.end())
+ {
+ LL_ERRS("LLViewerWindowListener") << "LLViewerWindowListener::saveSnapshot(): "
+ << "unrecognized type " << event["type"] << LL_ENDL;
+ }
+ type = found->second;
+ }
+ bool ok = mViewerWindow->saveSnapshot(event["filename"], width, height, showui, rebuild, type);
+ LLSD response(reqid.makeResponse());
+ response["ok"] = ok;
+ LLEventPumps::instance().obtain(event["reply"]).post(response);
+}
+
+void LLViewerWindowListener::requestReshape(LLSD const & event_data) const
+{
+ if(event_data.has("w") && event_data.has("h"))
+ {
+ mViewerWindow->reshape(event_data["w"].asInteger(), event_data["h"].asInteger());
+ }
+}
diff --git a/indra/newview/llviewerwindowlistener.h b/indra/newview/llviewerwindowlistener.h
new file mode 100644
index 0000000000..59c636ecec
--- /dev/null
+++ b/indra/newview/llviewerwindowlistener.h
@@ -0,0 +1,35 @@
+/**
+ * @file llviewerwindowlistener.h
+ * @author Nat Goodspeed
+ * @date 2009-06-30
+ * @brief Event API for subset of LLViewerWindow methods
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLVIEWERWINDOWLISTENER_H)
+#define LL_LLVIEWERWINDOWLISTENER_H
+
+#include "lleventdispatcher.h"
+
+class LLViewerWindow;
+class LLSD;
+
+/// Listen on an LLEventPump with specified name for LLViewerWindow request events.
+class LLViewerWindowListener: public LLDispatchListener
+{
+public:
+ /// Specify the pump name on which to listen, and bind the LLViewerWindow
+ /// instance to use (e.g. gViewerWindow).
+ LLViewerWindowListener(const std::string& pumpname, LLViewerWindow* llviewerwindow);
+
+private:
+ void saveSnapshot(const LLSD& event) const;
+ void requestReshape(LLSD const & event_data) const;
+
+ LLViewerWindow* mViewerWindow;
+};
+
+#endif /* ! defined(LL_LLVIEWERWINDOWLISTENER_H) */
diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp
new file mode 100644
index 0000000000..71e2427c99
--- /dev/null
+++ b/indra/newview/llxmlrpclistener.cpp
@@ -0,0 +1,496 @@
+/**
+ * @file llxmlrpclistener.cpp
+ * @author Nat Goodspeed
+ * @date 2009-03-18
+ * @brief Implementation for llxmlrpclistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+
+// Precompiled header
+#include "llviewerprecompiledheaders.h"
+// associated header
+#include "llxmlrpclistener.h"
+// STL headers
+#include <map>
+#include <set>
+// std headers
+// external library headers
+#include <boost/scoped_ptr.hpp>
+#include <boost/range.hpp> // boost::begin(), boost::end()
+// other Linden headers
+#include "llerror.h"
+#include "stringize.h"
+#include "llxmlrpctransaction.h"
+
+#include <xmlrpc-epi/xmlrpc.h>
+
+#if LL_WINDOWS
+#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
+#endif
+
+template <typename STATUS>
+class StatusMapperBase
+{
+ typedef std::map<STATUS, std::string> MapType;
+
+public:
+ StatusMapperBase(const std::string& desc):
+ mDesc(desc)
+ {}
+
+ std::string lookup(STATUS status) const
+ {
+ typename MapType::const_iterator found = mMap.find(status);
+ if (found != mMap.end())
+ {
+ return found->second;
+ }
+ return STRINGIZE("<unknown " << mDesc << " " << status << ">");
+ }
+
+protected:
+ std::string mDesc;
+ MapType mMap;
+};
+
+class StatusMapper: public StatusMapperBase<LLXMLRPCTransaction::Status>
+{
+public:
+ StatusMapper(): StatusMapperBase<LLXMLRPCTransaction::Status>("Status")
+ {
+ mMap[LLXMLRPCTransaction::StatusNotStarted] = "NotStarted";
+ mMap[LLXMLRPCTransaction::StatusStarted] = "Started";
+ mMap[LLXMLRPCTransaction::StatusDownloading] = "Downloading";
+ mMap[LLXMLRPCTransaction::StatusComplete] = "Complete";
+ mMap[LLXMLRPCTransaction::StatusCURLError] = "CURLError";
+ mMap[LLXMLRPCTransaction::StatusXMLRPCError] = "XMLRPCError";
+ mMap[LLXMLRPCTransaction::StatusOtherError] = "OtherError";
+ }
+};
+
+static const StatusMapper sStatusMapper;
+
+class CURLcodeMapper: public StatusMapperBase<CURLcode>
+{
+public:
+ CURLcodeMapper(): StatusMapperBase<CURLcode>("CURLcode")
+ {
+ // from curl.h
+// skip the "CURLE_" prefix for each of these strings
+#define def(sym) (mMap[sym] = #sym + 6)
+ def(CURLE_OK);
+ def(CURLE_UNSUPPORTED_PROTOCOL); /* 1 */
+ def(CURLE_FAILED_INIT); /* 2 */
+ def(CURLE_URL_MALFORMAT); /* 3 */
+ def(CURLE_URL_MALFORMAT_USER); /* 4 - NOT USED */
+ def(CURLE_COULDNT_RESOLVE_PROXY); /* 5 */
+ def(CURLE_COULDNT_RESOLVE_HOST); /* 6 */
+ def(CURLE_COULDNT_CONNECT); /* 7 */
+ def(CURLE_FTP_WEIRD_SERVER_REPLY); /* 8 */
+ def(CURLE_FTP_ACCESS_DENIED); /* 9 a service was denied by the FTP server
+ due to lack of access - when login fails
+ this is not returned. */
+ def(CURLE_FTP_USER_PASSWORD_INCORRECT); /* 10 - NOT USED */
+ def(CURLE_FTP_WEIRD_PASS_REPLY); /* 11 */
+ def(CURLE_FTP_WEIRD_USER_REPLY); /* 12 */
+ def(CURLE_FTP_WEIRD_PASV_REPLY); /* 13 */
+ def(CURLE_FTP_WEIRD_227_FORMAT); /* 14 */
+ def(CURLE_FTP_CANT_GET_HOST); /* 15 */
+ def(CURLE_FTP_CANT_RECONNECT); /* 16 */
+ def(CURLE_FTP_COULDNT_SET_BINARY); /* 17 */
+ def(CURLE_PARTIAL_FILE); /* 18 */
+ def(CURLE_FTP_COULDNT_RETR_FILE); /* 19 */
+ def(CURLE_FTP_WRITE_ERROR); /* 20 */
+ def(CURLE_FTP_QUOTE_ERROR); /* 21 */
+ def(CURLE_HTTP_RETURNED_ERROR); /* 22 */
+ def(CURLE_WRITE_ERROR); /* 23 */
+ def(CURLE_MALFORMAT_USER); /* 24 - NOT USED */
+ def(CURLE_UPLOAD_FAILED); /* 25 - failed upload "command" */
+ def(CURLE_READ_ERROR); /* 26 - could open/read from file */
+ def(CURLE_OUT_OF_MEMORY); /* 27 */
+ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
+ instead of a memory allocation error if CURL_DOES_CONVERSIONS
+ is defined
+ */
+ def(CURLE_OPERATION_TIMEOUTED); /* 28 - the timeout time was reached */
+ def(CURLE_FTP_COULDNT_SET_ASCII); /* 29 - TYPE A failed */
+ def(CURLE_FTP_PORT_FAILED); /* 30 - FTP PORT operation failed */
+ def(CURLE_FTP_COULDNT_USE_REST); /* 31 - the REST command failed */
+ def(CURLE_FTP_COULDNT_GET_SIZE); /* 32 - the SIZE command failed */
+ def(CURLE_HTTP_RANGE_ERROR); /* 33 - RANGE "command" didn't work */
+ def(CURLE_HTTP_POST_ERROR); /* 34 */
+ def(CURLE_SSL_CONNECT_ERROR); /* 35 - wrong when connecting with SSL */
+ def(CURLE_BAD_DOWNLOAD_RESUME); /* 36 - couldn't resume download */
+ def(CURLE_FILE_COULDNT_READ_FILE); /* 37 */
+ def(CURLE_LDAP_CANNOT_BIND); /* 38 */
+ def(CURLE_LDAP_SEARCH_FAILED); /* 39 */
+ def(CURLE_LIBRARY_NOT_FOUND); /* 40 */
+ def(CURLE_FUNCTION_NOT_FOUND); /* 41 */
+ def(CURLE_ABORTED_BY_CALLBACK); /* 42 */
+ def(CURLE_BAD_FUNCTION_ARGUMENT); /* 43 */
+ def(CURLE_BAD_CALLING_ORDER); /* 44 - NOT USED */
+ def(CURLE_INTERFACE_FAILED); /* 45 - CURLOPT_INTERFACE failed */
+ def(CURLE_BAD_PASSWORD_ENTERED); /* 46 - NOT USED */
+ def(CURLE_TOO_MANY_REDIRECTS ); /* 47 - catch endless re-direct loops */
+ def(CURLE_UNKNOWN_TELNET_OPTION); /* 48 - User specified an unknown option */
+ def(CURLE_TELNET_OPTION_SYNTAX ); /* 49 - Malformed telnet option */
+ def(CURLE_OBSOLETE); /* 50 - NOT USED */
+ def(CURLE_SSL_PEER_CERTIFICATE); /* 51 - peer's certificate wasn't ok */
+ def(CURLE_GOT_NOTHING); /* 52 - when this is a specific error */
+ def(CURLE_SSL_ENGINE_NOTFOUND); /* 53 - SSL crypto engine not found */
+ def(CURLE_SSL_ENGINE_SETFAILED); /* 54 - can not set SSL crypto engine as
+ default */
+ def(CURLE_SEND_ERROR); /* 55 - failed sending network data */
+ def(CURLE_RECV_ERROR); /* 56 - failure in receiving network data */
+ def(CURLE_SHARE_IN_USE); /* 57 - share is in use */
+ def(CURLE_SSL_CERTPROBLEM); /* 58 - problem with the local certificate */
+ def(CURLE_SSL_CIPHER); /* 59 - couldn't use specified cipher */
+ def(CURLE_SSL_CACERT); /* 60 - problem with the CA cert (path?) */
+ def(CURLE_BAD_CONTENT_ENCODING); /* 61 - Unrecognized transfer encoding */
+ def(CURLE_LDAP_INVALID_URL); /* 62 - Invalid LDAP URL */
+ def(CURLE_FILESIZE_EXCEEDED); /* 63 - Maximum file size exceeded */
+ def(CURLE_FTP_SSL_FAILED); /* 64 - Requested FTP SSL level failed */
+ def(CURLE_SEND_FAIL_REWIND); /* 65 - Sending the data requires a rewind
+ that failed */
+ def(CURLE_SSL_ENGINE_INITFAILED); /* 66 - failed to initialise ENGINE */
+ def(CURLE_LOGIN_DENIED); /* 67 - user); password or similar was not
+ accepted and we failed to login */
+ def(CURLE_TFTP_NOTFOUND); /* 68 - file not found on server */
+ def(CURLE_TFTP_PERM); /* 69 - permission problem on server */
+ def(CURLE_TFTP_DISKFULL); /* 70 - out of disk space on server */
+ def(CURLE_TFTP_ILLEGAL); /* 71 - Illegal TFTP operation */
+ def(CURLE_TFTP_UNKNOWNID); /* 72 - Unknown transfer ID */
+ def(CURLE_TFTP_EXISTS); /* 73 - File already exists */
+ def(CURLE_TFTP_NOSUCHUSER); /* 74 - No such user */
+ def(CURLE_CONV_FAILED); /* 75 - conversion failed */
+ def(CURLE_CONV_REQD); /* 76 - caller must register conversion
+ callbacks using curl_easy_setopt options
+ CURLOPT_CONV_FROM_NETWORK_FUNCTION);
+ CURLOPT_CONV_TO_NETWORK_FUNCTION); and
+ CURLOPT_CONV_FROM_UTF8_FUNCTION */
+ def(CURLE_SSL_CACERT_BADFILE); /* 77 - could not load CACERT file); missing
+ or wrong format */
+ def(CURLE_REMOTE_FILE_NOT_FOUND); /* 78 - remote file not found */
+ def(CURLE_SSH); /* 79 - error from the SSH layer); somewhat
+ generic so the error message will be of
+ interest when this has happened */
+
+ def(CURLE_SSL_SHUTDOWN_FAILED); /* 80 - Failed to shut down the SSL
+ connection */
+#undef def
+ }
+};
+
+static const CURLcodeMapper sCURLcodeMapper;
+
+LLXMLRPCListener::LLXMLRPCListener(const std::string& pumpname):
+ mBoundListener(LLEventPumps::instance().
+ obtain(pumpname).
+ listen("LLXMLRPCListener", boost::bind(&LLXMLRPCListener::process, this, _1)))
+{
+}
+
+/**
+ * Capture an outstanding LLXMLRPCTransaction and poll it periodically until
+ * done.
+ *
+ * The sequence is:
+ * # Instantiate Poller, which instantiates, populates and initiates an
+ * LLXMLRPCTransaction. Poller self-registers on the LLEventPump named
+ * "mainloop".
+ * # "mainloop" is conventionally pumped once per frame. On each such call,
+ * Poller checks its LLXMLRPCTransaction for completion.
+ * # When the LLXMLRPCTransaction completes, Poller collects results (if any)
+ * and sends notification.
+ * # The tricky part: Poller frees itself (and thus its LLXMLRPCTransaction)
+ * when done. The only external reference to it is the connection to the
+ * "mainloop" LLEventPump.
+ */
+class Poller
+{
+public:
+ /// Validate the passed request for required fields, then use it to
+ /// populate an XMLRPC_REQUEST and an associated LLXMLRPCTransaction. Send
+ /// the request.
+ Poller(const LLSD& command):
+ mReqID(command),
+ mUri(command["uri"]),
+ mMethod(command["method"]),
+ mReplyPump(command["reply"])
+ {
+ // LL_ERRS if any of these are missing
+ const char* required[] = { "uri", "method", "reply" };
+ // optional: "options" (array of string)
+ // Validate the request
+ std::set<std::string> missing;
+ for (const char** ri = boost::begin(required); ri != boost::end(required); ++ri)
+ {
+ // If the command does not contain this required entry, add it to 'missing'.
+ if (! command.has(*ri))
+ {
+ missing.insert(*ri);
+ }
+ }
+ if (! missing.empty())
+ {
+ LL_ERRS("LLXMLRPCListener") << mMethod << " request missing params: ";
+ const char* separator = "";
+ for (std::set<std::string>::const_iterator mi(missing.begin()), mend(missing.end());
+ mi != mend; ++mi)
+ {
+ LL_CONT << separator << *mi;
+ separator = ", ";
+ }
+ LL_CONT << LL_ENDL;
+ }
+
+ // Build the XMLRPC request.
+ XMLRPC_REQUEST request = XMLRPC_RequestNew();
+ XMLRPC_RequestSetMethodName(request, mMethod.c_str());
+ XMLRPC_RequestSetRequestType(request, xmlrpc_request_call);
+ XMLRPC_VALUE xparams = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct);
+ LLSD params(command["params"]);
+ if (params.isMap())
+ {
+ for (LLSD::map_const_iterator pi(params.beginMap()), pend(params.endMap());
+ pi != pend; ++pi)
+ {
+ std::string name(pi->first);
+ LLSD param(pi->second);
+ if (param.isString())
+ {
+ XMLRPC_VectorAppendString(xparams, name.c_str(), param.asString().c_str(), 0);
+ }
+ else if (param.isInteger() || param.isBoolean())
+ {
+ XMLRPC_VectorAppendInt(xparams, name.c_str(), param.asInteger());
+ }
+ else if (param.isReal())
+ {
+ XMLRPC_VectorAppendDouble(xparams, name.c_str(), param.asReal());
+ }
+ else
+ {
+ LL_ERRS("LLXMLRPCListener") << mMethod << " request param "
+ << name << " has unknown type: " << param << LL_ENDL;
+ }
+ }
+ }
+ LLSD options(command["options"]);
+ if (options.isArray())
+ {
+ XMLRPC_VALUE xoptions = XMLRPC_CreateVector("options", xmlrpc_vector_array);
+ for (LLSD::array_const_iterator oi(options.beginArray()), oend(options.endArray());
+ oi != oend; ++oi)
+ {
+ XMLRPC_VectorAppendString(xoptions, NULL, oi->asString().c_str(), 0);
+ }
+ XMLRPC_AddValueToVector(xparams, xoptions);
+ }
+ XMLRPC_RequestSetData(request, xparams);
+
+ mTransaction.reset(new LLXMLRPCTransaction(mUri, request));
+ mPreviousStatus = mTransaction->status(NULL);
+
+ // Free the XMLRPC_REQUEST object and the attached data values.
+ XMLRPC_RequestFree(request, 1);
+
+ // Now ensure that we get regular callbacks to poll for completion.
+ mBoundListener =
+ LLEventPumps::instance().
+ obtain("mainloop").
+ listen(LLEventPump::inventName(), boost::bind(&Poller::poll, this, _1));
+
+ LL_INFOS("LLXMLRPCListener") << mMethod << " request sent to " << mUri << LL_ENDL;
+ }
+
+ /// called by "mainloop" LLEventPump
+ bool poll(const LLSD&)
+ {
+ bool done = mTransaction->process();
+
+ CURLcode curlcode;
+ LLXMLRPCTransaction::Status status;
+ {
+ // LLXMLRPCTransaction::status() is defined to accept int* rather
+ // than CURLcode*. I don't feel the urge to fix the signature, but
+ // we want a CURLcode rather than an int. So fetch it as a local
+ // int, but then assign to a CURLcode for the remainder of this
+ // method.
+ int curlint;
+ status = mTransaction->status(&curlint);
+ curlcode = CURLcode(curlint);
+ }
+
+ LLSD data(mReqID.makeResponse());
+ data["status"] = sStatusMapper.lookup(status);
+ data["errorcode"] = sCURLcodeMapper.lookup(curlcode);
+ data["error"] = "";
+ data["transfer_rate"] = 0.0;
+ LLEventPump& replyPump(LLEventPumps::instance().obtain(mReplyPump));
+ if (! done)
+ {
+ // Not done yet, carry on.
+ if (status == LLXMLRPCTransaction::StatusDownloading
+ && status != mPreviousStatus)
+ {
+ // If a response has been received, send the
+ // 'downloading' status if it hasn't been sent.
+ replyPump.post(data);
+ }
+
+ mPreviousStatus = status;
+ return false;
+ }
+
+ // Here the transaction is complete. Check status.
+ data["error"] = mTransaction->statusMessage();
+ data["transfer_rate"] = mTransaction->transferRate();
+ LL_INFOS("LLXMLRPCListener") << mMethod << " result from " << mUri << ": status "
+ << data["status"].asString() << ", errorcode "
+ << data["errorcode"].asString()
+ << " (" << data["error"].asString() << ")"
+ << LL_ENDL;
+ // In addition to CURLE_OK, LLUserAuth distinguishes different error
+ // values of 'curlcode':
+ // CURLE_COULDNT_RESOLVE_HOST,
+ // CURLE_SSL_PEER_CERTIFICATE,
+ // CURLE_SSL_CACERT,
+ // CURLE_SSL_CONNECT_ERROR.
+ // Given 'message', need we care?
+ if (status == LLXMLRPCTransaction::StatusComplete)
+ {
+ // Success! Parse data.
+ std::string status_string(data["status"]);
+ data["responses"] = parseResponse(status_string);
+ data["status"] = status_string;
+ }
+
+ // whether successful or not, send reply on requested LLEventPump
+ replyPump.post(data);
+
+ // Because mTransaction is a boost::scoped_ptr, deleting this object
+ // frees our LLXMLRPCTransaction object.
+ // Because mBoundListener is an LLTempBoundListener, deleting this
+ // object disconnects it from "mainloop".
+ // *** MUST BE LAST ***
+ delete this;
+ return false;
+ }
+
+private:
+ /// Derived from LLUserAuth::parseResponse() and parseOptionInto()
+ LLSD parseResponse(std::string& status_string)
+ {
+ // Extract every member into data["responses"] (a map of string
+ // values).
+ XMLRPC_REQUEST response = mTransaction->response();
+ if (! response)
+ {
+ LL_DEBUGS("LLXMLRPCListener") << "No response" << LL_ENDL;
+ return LLSD();
+ }
+
+ XMLRPC_VALUE param = XMLRPC_RequestGetData(response);
+ if (! param)
+ {
+ LL_DEBUGS("LLXMLRPCListener") << "Response contains no data" << LL_ENDL;
+ return LLSD();
+ }
+
+ // Now, parse everything
+ return parseValues(status_string, "", param);
+ }
+
+ /**
+ * Parse key/value pairs from a given XMLRPC_VALUE into an LLSD map.
+ * @param key_pfx Used to describe a given key in log messages. At top
+ * level, pass "". When parsing an options array, pass the top-level key
+ * name of the array plus the index of the array entry; to this we'll
+ * append the subkey of interest.
+ * @param param XMLRPC_VALUE iterator. At top level, pass
+ * XMLRPC_RequestGetData(XMLRPC_REQUEST).
+ */
+ LLSD parseValues(std::string& status_string, const std::string& key_pfx, XMLRPC_VALUE param)
+ {
+ LLSD responses;
+ for (XMLRPC_VALUE current = XMLRPC_VectorRewind(param); current;
+ current = XMLRPC_VectorNext(param))
+ {
+ std::string key(XMLRPC_GetValueID(current));
+ LL_DEBUGS("LLXMLRPCListener") << "key: " << key_pfx << key << LL_ENDL;
+ XMLRPC_VALUE_TYPE_EASY type = XMLRPC_GetValueTypeEasy(current);
+ if (xmlrpc_type_string == type)
+ {
+ LLSD::String val(XMLRPC_GetValueString(current));
+ LL_DEBUGS("LLXMLRPCListener") << "val: " << val << LL_ENDL;
+ responses.insert(key, val);
+ }
+ else if (xmlrpc_type_int == type)
+ {
+ LLSD::Integer val(XMLRPC_GetValueInt(current));
+ LL_DEBUGS("LLXMLRPCListener") << "val: " << val << LL_ENDL;
+ responses.insert(key, val);
+ }
+ else if (xmlrpc_type_double == type)
+ {
+ LLSD::Real val(XMLRPC_GetValueDouble(current));
+ LL_DEBUGS("LLXMLRPCListener") << "val: " << val << LL_ENDL;
+ responses.insert(key, val);
+ }
+ else if (xmlrpc_type_array == type)
+ {
+ // We expect this to be an array of submaps. Walk the array,
+ // recursively parsing each submap and collecting them.
+ LLSD array;
+ int i = 0; // for descriptive purposes
+ for (XMLRPC_VALUE row = XMLRPC_VectorRewind(current); row;
+ row = XMLRPC_VectorNext(current), ++i)
+ {
+ // Recursive call. For the lower-level key_pfx, if 'key'
+ // is "foo", pass "foo[0]:", then "foo[1]:", etc. In the
+ // nested call, a subkey "bar" will then be logged as
+ // "foo[0]:bar", and so forth.
+ // Parse the scalar subkey/value pairs from this array
+ // entry into a temp submap. Collect such submaps in 'array'.
+ array.append(parseValues(status_string,
+ STRINGIZE(key_pfx << key << '[' << i << "]:"),
+ row));
+ }
+ // Having collected an 'array' of 'submap's, insert that whole
+ // 'array' as the value of this 'key'.
+ responses.insert(key, array);
+ }
+ else
+ {
+ // whoops - unrecognized type
+ LL_WARNS("LLXMLRPCListener") << "Unhandled xmlrpc type " << type << " for key "
+ << key_pfx << key << LL_ENDL;
+ responses.insert(key, STRINGIZE("<bad XMLRPC type " << type << '>'));
+ status_string = "BadType";
+ }
+ }
+ return responses;
+ }
+
+ const LLReqID mReqID;
+ const std::string mUri;
+ const std::string mMethod;
+ const std::string mReplyPump;
+ LLTempBoundListener mBoundListener;
+ boost::scoped_ptr<LLXMLRPCTransaction> mTransaction;
+ LLXMLRPCTransaction::Status mPreviousStatus; // To detect state changes.
+};
+
+bool LLXMLRPCListener::process(const LLSD& command)
+{
+ // Allocate a new heap Poller, but do not save a pointer to it. Poller
+ // will check its own status and free itself on completion of the request.
+ (new Poller(command));
+ // conventional event listener return
+ return false;
+}
diff --git a/indra/newview/llxmlrpclistener.h b/indra/newview/llxmlrpclistener.h
new file mode 100644
index 0000000000..120c2b329b
--- /dev/null
+++ b/indra/newview/llxmlrpclistener.h
@@ -0,0 +1,35 @@
+/**
+ * @file llxmlrpclistener.h
+ * @author Nat Goodspeed
+ * @date 2009-03-18
+ * @brief LLEventPump API for LLXMLRPCTransaction. This header doesn't
+ * actually define the API; the API is defined by the pump name on
+ * which this class listens, and by the expected content of LLSD it
+ * receives.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_LLXMLRPCLISTENER_H)
+#define LL_LLXMLRPCLISTENER_H
+
+#include "llevents.h"
+
+/// Listen on an LLEventPump with specified name for LLXMLRPCTransaction
+/// request events.
+class LLXMLRPCListener
+{
+public:
+ /// Specify the pump name on which to listen
+ LLXMLRPCListener(const std::string& pumpname);
+
+ /// Handle request events on the event pump specified at construction time
+ bool process(const LLSD& command);
+
+private:
+ LLTempBoundListener mBoundListener;
+};
+
+#endif /* ! defined(LL_LLXMLRPCLISTENER_H) */
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index a2fd0f0d9c..0e1beb377f 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -33,6 +33,7 @@
#include "llviewerprecompiledheaders.h"
#include "llxmlrpctransaction.h"
+#include "llxmlrpclistener.h"
#include "llcurl.h"
#include "llviewercontrol.h"
@@ -42,6 +43,13 @@
#include "llappviewer.h"
+// Static instance of LLXMLRPCListener declared here so that every time we
+// bring in this code, we instantiate a listener. If we put the static
+// instance of LLXMLRPCListener into llxmlrpclistener.cpp, the linker would
+// simply omit llxmlrpclistener.o, and shouting on the LLEventPump would do
+// nothing.
+static LLXMLRPCListener listener("LLXMLRPCTransaction");
+
LLXMLRPCValue LLXMLRPCValue::operator[](const char* id) const
{
return LLXMLRPCValue(XMLRPC_VectorGetValueWithID(mV, id));
@@ -213,6 +221,11 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
XMLRPC_RequestSetData(request, params.getValue());
init(request, useGzip);
+ // DEV-28398: without this XMLRPC_RequestFree() call, it looks as though
+ // the 'request' object is simply leaked. It's less clear to me whether we
+ // should also ask to free request value data (second param 1), since the
+ // data come from 'params'.
+ XMLRPC_RequestFree(request, 1);
}
diff --git a/indra/newview/skins/default/xui/da/floater_avatar_picker.xml b/indra/newview/skins/default/xui/da/floater_avatar_picker.xml
index f93f0a3525..d2c8f3a003 100644
--- a/indra/newview/skins/default/xui/da/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/da/floater_avatar_picker.xml
@@ -1,40 +1,15 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="avatarpicker" title="Vælg beboer">
- <tab_container name="ResidentChooserTabs">
- <panel label="Søg" name="SearchPanel">
- <text name="InstructSearchResidentName">
- Indtast en del af beboerens navn:
- </text>
- <button label="Find" label_selected="Find" name="Find"/>
- </panel>
- <panel label="Visitkort" name="CallingCardsPanel">
- <text name="InstructSelectCallingCard">
- Vælg et visitkort:
- </text>
- </panel>
- <panel label="Nær ved mig" name="NearMePanel">
- <text name="InstructSelectResident">
- Vælg beboere i nærheden:
- </text>
- <button label="Gentegn liste" label_selected="Gentegn liste" name="Refresh"/>
- <slider label="Område" name="near_me_range"/>
- <text name="meters">
- meter
- </text>
- </panel>
- </tab_container>
- <button label="Vælg" label_selected="Vælg" name="Select"/>
- <button label="Annullér" label_selected="Annullér" name="Cancel"/>
- <string name="not_found">
+ <text name="instruct_search_resident_name">
+ Skriv en del eller hele navnet på beboeren:
+ </text>
+ <button label="Find" label_selected="Find" name="Find" />
+ <text name="Or select their calling card:">
+ Eller vælg deres visitkort:
+ </text>
+ <button label="Luk" label_selected="Luk" name="Close" />
+ <button label="Vælg" label_selected="Vælg" name="Select" />
+ <string name="NotFound">
&apos;[TEXT]&apos; ikke fundet
</string>
- <string name="no_one_near">
- Ingen i nærheden
- </string>
- <string name="no_results">
- Ingen resultater
- </string>
- <string name="searching">
- Søger...
- </string>
</floater>
diff --git a/indra/newview/skins/default/xui/da/floater_build_options.xml b/indra/newview/skins/default/xui/da/floater_build_options.xml
index 3b3e14ad64..7e5b61bd84 100644
--- a/indra/newview/skins/default/xui/da/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/da/floater_build_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="build options floater" title="Gitter indstillinger">
- <spinner label="Gitter enhed (meter)" name="GridResolution" width="200" label_width="136"/>
- <spinner label="Gitter rækkevidde (meter)" name="GridDrawSize" width="200" label_width="136"/>
+ <spinner label="Gitter enhed (meter)" name="GridResolution" />
+ <spinner label="Gitter rækkevidde (meter)" name="GridDrawSize" />
<check_box label="Aktiver låsning til under-enheder" name="GridSubUnit" />
<check_box label="Vis &apos;cross sections&apos;" name="GridCrossSection" />
<slider label="Gitter synlighed" name="GridOpacity" />
diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml
index 1c5876572b..da2e7dbd66 100644
--- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml
@@ -63,6 +63,6 @@ og prøv igen.
<button label="Annullér" name="cancel_btn" />
<button label="Køb" name="buy_btn" />
<string name="buy_currency">
- Køb L$ [LINDENS] for ca. US$ [USD]
+ Buy L$ [LINDENS] for approx. US$ [USD]
</string>
</floater>
diff --git a/indra/newview/skins/default/xui/da/floater_inspect.xml b/indra/newview/skins/default/xui/da/floater_inspect.xml
index 56c3f6f784..8361733e23 100644
--- a/indra/newview/skins/default/xui/da/floater_inspect.xml
+++ b/indra/newview/skins/default/xui/da/floater_inspect.xml
@@ -1,11 +1,13 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="inspect" title="Inspecér objekter">
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater name="inspect" >
<scroll_list name="object_list" tool_tip="Vælg et objekt fra listen for at markere det">
- <column label="Objekt navn" name="object_name"/>
- <column label="Objekt ejer" name="owner_name"/>
- <column label="Bygget af" name="creator_name"/>
- <column label="Lavet den " name="creation_date"/>
+ <column label="Objekt navn" name="object_name" />
+ <column label="Objekt ejer" name="owner_name" />
+ <column label="Bygget af" name="creator_name" />
+ <column label="Lavet den " name="creation_date" />
</scroll_list>
- <button label="Se profil for ejer..." label_selected="" name="button owner" tool_tip="Se profilen for ejeren af det markerede objekt på listen"/>
- <button label="Se profil for bygger..." label_selected="" name="button creator" tool_tip="Se profilen for den beboer der har bygget det markerede objekt på listen"/>
+ <button label="Se profil for ejer..." label_selected="" name="button owner"
+ tool_tip="Se profilen for ejeren af det markerede objekt på listen" />
+ <button label="Se profil for bygger..." label_selected="" name="button creator"
+ tool_tip="Se profilen for den beboer der har bygget det markerede objekt på listen" />
</floater>
diff --git a/indra/newview/skins/default/xui/da/floater_joystick.xml b/indra/newview/skins/default/xui/da/floater_joystick.xml
index 7a4d570f85..72439ac4e0 100644
--- a/indra/newview/skins/default/xui/da/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/da/floater_joystick.xml
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="Joystick" title="Joystick opsætning">
<check_box name="enable_joystick">
Aktiver Joystick:
</check_box>
- <spinner label="X akse mapping" name="JoystickAxis1"/>
- <spinner label="Y akse mapping" name="JoystickAxis2"/>
- <spinner label="Z akse mapping" name="JoystickAxis0"/>
- <spinner label="Hældning mapping" name="JoystickAxis4"/>
- <spinner label="Drejning mapping" name="JoystickAxis5"/>
- <spinner label="Rulning mapping" name="JoystickAxis3"/>
- <spinner label="Zoom mapping" name="JoystickAxis6"/>
- <check_box label="Direkte zoom" name="ZoomDirect"/>
- <check_box label="3D Cursor" name="Cursor3D"/>
- <check_box label="Auto opret" name="AutoLeveling"/>
- <text length="1" name="Control Modes:" type="string">
+ <spinner label="X akse mapping" name="JoystickAxis1" />
+ <spinner label="Y akse mapping" name="JoystickAxis2" />
+ <spinner label="Z akse mapping" name="JoystickAxis0" />
+ <spinner label="Hældning mapping" name="JoystickAxis4" />
+ <spinner label="Drejning mapping" name="JoystickAxis5" />
+ <spinner label="Rulning mapping" name="JoystickAxis3" />
+ <spinner label="Zoom mapping" name="JoystickAxis6" />
+ <check_box label="Direkte zoom" name="ZoomDirect" />
+ <check_box label="3D Cursor" name="Cursor3D" />
+ <check_box label="Auto opret" name="AutoLeveling" />
+ <text type="string" length="1" name="Control Modes:">
Kontrollér:
</text>
<check_box name="JoystickAvatarEnabled">
@@ -64,20 +64,18 @@
<text name="Feathering">
Respons
</text>
- <slider label="" name="AvatarFeathering"/>
- <slider label="" name="BuildFeathering"/>
- <slider label="" name="FlycamFeathering"/>
+ <slider label="" name="AvatarFeathering" />
+ <slider label="" name="BuildFeathering" />
+ <slider label="" name="FlycamFeathering" />
<text name="ZoomScale2">
Zoom følsomhed
</text>
- <spinner label="" name="FlycamAxisScale6"/>
+ <spinner label="" name="FlycamAxisScale6" />
<text name="ZoomDeadZone">
Zoom min. udslag
</text>
- <spinner label="" name="FlycamAxisDeadZone6"/>
- <button label="SpaceNavigator Defaults" name="SpaceNavigatorDefaults"/>
- <button label="OK" label_selected="OK" name="ok_btn"/>
- <button label="Annullér" label_selected="Annullér" name="cancel_btn"/>
+ <spinner label="" name="FlycamAxisDeadZone6" />
+ <button label="SpaceNavigator Defaults" name="SpaceNavigatorDefaults" />
<string name="JoystickMonitor">
Joystick Overvågning
</string>
diff --git a/indra/newview/skins/default/xui/da/floater_lagmeter.xml b/indra/newview/skins/default/xui/da/floater_lagmeter.xml
index 7e7c2dc0d3..b2cbebfe52 100644
--- a/indra/newview/skins/default/xui/da/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/da/floater_lagmeter.xml
@@ -1,28 +1,29 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="floater_lagmeter" title="Lag måler">
- <button label="" label_selected="" name="client_lagmeter" tool_tip="Status for klient lag"/>
+ <button label="" label_selected="" name="client_lagmeter" />
<text name="client">
Klient:
</text>
<text name="client_text">
Normal
</text>
- <button label="" label_selected="" name="network_lagmeter" tool_tip="Network lag status"/>
+ <button label="" label_selected="" name="network_lagmeter"
+ tool_tip="Network lag status" />
<text name="network">
Netværk:
</text>
<text name="network_text">
Normal
</text>
- <button label="" label_selected="" name="server_lagmeter" tool_tip="Status for server lag"/>
+ <button label="" label_selected="" name="server_lagmeter" />
<text name="server">
Server:
</text>
<text name="server_text">
Normal
</text>
- <button label="?" name="server_help"/>
- <button label="&gt;&gt;" name="minimize"/>
+ <button label="?" name="server_help" />
+ <button label="&gt;&gt;" name="minimize" />
<string name="max_title_msg">
Lag måler
</string>
@@ -125,6 +126,9 @@
<string name="server_frame_time_normal_msg">
Normal
</string>
+ <string name="server_frame_time_normal_msg">
+ Normal
+ </string>
<string name="server_physics_cause_msg">
Mulig årsag: For mange fysiske objekter
</string>
diff --git a/indra/newview/skins/default/xui/da/floater_land_holdings.xml b/indra/newview/skins/default/xui/da/floater_land_holdings.xml
index bd623e7b75..fcb159664c 100644
--- a/indra/newview/skins/default/xui/da/floater_land_holdings.xml
+++ b/indra/newview/skins/default/xui/da/floater_land_holdings.xml
@@ -1,20 +1,19 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="land holdings floater" title="Mit land">
<scroll_list name="parcel list">
- <column label="Navn" name="name"/>
- <column label="Region" name="location"/>
- <column label="Type" name="type"/>
- <column label="Område" name="area"/>
- <column label="" name="hidden"/>
+ <column label="Navn" name="name" />
+ <column label="Lokation" name="location" />
+ <column label="Område" name="area" />
+ <column label="" name="hidden" />
</scroll_list>
- <button label="Teleport" label_selected="Teleport" name="Teleport" tool_tip="Teleport til centrum på dette land."/>
- <button label="Vis på kort" label_selected="Vis på kort" name="Show on Map" tool_tip="Vis dette land på verdenskortet."/>
+ <button label="Teleport" label_selected="Teleport" name="Teleport" />
+ <button label="Vis på kort" label_selected="Vis på kort" name="Show on Map" />
<text name="contrib_label">
Bidrag til dine grupper:
</text>
<scroll_list name="grant list">
- <column label="Gruppe" name="group"/>
- <column label="Område" name="area"/>
+ <column label="Gruppe" name="group" />
+ <column label="Område" name="area" />
</scroll_list>
<text name="allowed_label">
Tilladt land ifølge nuværende betalingsaftale:
diff --git a/indra/newview/skins/default/xui/da/floater_lsl_guide.xml b/indra/newview/skins/default/xui/da/floater_lsl_guide.xml
index d345409859..07ea6930ea 100644
--- a/indra/newview/skins/default/xui/da/floater_lsl_guide.xml
+++ b/indra/newview/skins/default/xui/da/floater_lsl_guide.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="script ed float" title="LSL Wiki">
<check_box label="Følg markøreren" name="lock_check" />
- <combo_box label="Lås" name="history_combo" left_delta="114" width="70"/>
+ <combo_box label="Lås" name="history_combo" />
<button label="Tilbage" name="back_btn" />
<button label="Frem" name="fwd_btn" />
</floater>
diff --git a/indra/newview/skins/default/xui/da/floater_preview_notecard.xml b/indra/newview/skins/default/xui/da/floater_preview_notecard.xml
index 169172222f..c9bee41b6a 100644
--- a/indra/newview/skins/default/xui/da/floater_preview_notecard.xml
+++ b/indra/newview/skins/default/xui/da/floater_preview_notecard.xml
@@ -1,15 +1,12 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="preview notecard" title="Note:">
- <button label="Gem" label_selected="Gem" name="Save"/>
- <text length="1" name="desc txt" type="string">
+ <button label="Gem" label_selected="Gem" name="Save" />
+ <text type="string" length="1" name="desc txt">
Beskrivelse:
</text>
- <text_editor length="1" name="Notecard Editor" type="string">
+ <text_editor type="string" length="1" name="Notecard Editor">
Indlæser...
</text_editor>
- <string name="no_object">
- Kunne ikke finde objekt der indeholder denne note.
- </string>
<string name="not_allowed">
Du har ikke tilladelse til at læse denne note.
</string>
diff --git a/indra/newview/skins/default/xui/da/floater_sound_preview.xml b/indra/newview/skins/default/xui/da/floater_sound_preview.xml
index 606d290e1d..c0d2f76ea9 100644
--- a/indra/newview/skins/default/xui/da/floater_sound_preview.xml
+++ b/indra/newview/skins/default/xui/da/floater_sound_preview.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<floater name="Sound Preview" title="sound.wav">
+<floater name="Name/Description" title="sound.wav">
<text name="name_label">
Navn:
</text>
diff --git a/indra/newview/skins/default/xui/da/floater_telehub.xml b/indra/newview/skins/default/xui/da/floater_telehub.xml
index cd1fb33831..32c5448508 100644
--- a/indra/newview/skins/default/xui/da/floater_telehub.xml
+++ b/indra/newview/skins/default/xui/da/floater_telehub.xml
@@ -14,15 +14,15 @@
</text>
<button label="Forbind telehub" name="connect_btn" />
<button label="Afslut" name="disconnect_btn" />
- <text name="spawn_points_text" width="300">
+ <text name="spawn_points_text">
Ankomst punkter (positioner, ikke objekter):
</text>
<button label="Tilføj punkt" name="add_spawn_point_btn" />
<button label="Fjern punkt" name="remove_spawn_point_btn" />
<text name="spawn_point_help">
- Vælg objekt og klik på &apos;Tilføj punkt&apos;for at angive
-position. Du kan derefter flytte eller slette
-objektet. Positioner er i forhold til telehub center.
+ Vælg objekt og klik på &apos;Tilføj punkt&apos;for at angive position.
+Du kan derefter flytte eller slette objektet.
+Positioner er i forhold til telehub center.
Vælg emne i listen for at vise position i verden.
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/da/menu_inventory.xml b/indra/newview/skins/default/xui/da/menu_inventory.xml
index fd5ebe5c82..2c47703ef2 100644
--- a/indra/newview/skins/default/xui/da/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/da/menu_inventory.xml
@@ -55,7 +55,6 @@
<menu_item_call label="Aktivér" name="Activate" />
<menu_item_call label="Deaktivér" name="Deactivate" />
<menu_item_call label="Tag af dig selv" name="Detach From Yourself" />
- <menu_item_call label="Tilbage til sidste position" name="Restore to Last Position"/>
<menu_item_call label="Tag på" name="Object Wear" />
<menu label="Vedhæft" name="Attach To" />
<menu label="Vedhæft til HUD" name="Attach To HUD" />
diff --git a/indra/newview/skins/default/xui/da/panel_group_general.xml b/indra/newview/skins/default/xui/da/panel_group_general.xml
index 4281ec6792..393ac49725 100644
--- a/indra/newview/skins/default/xui/da/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/da/panel_group_general.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel label="Generelt" name="general_tab">
<string name="help_text">
Generel-fanen indeholder generel information om
@@ -10,26 +10,28 @@ Bevæg din mus over mulighederne for mere hjælp.
<string name="group_info_unchanged">
Generel gruppeinformation er ændret.
</string>
- <button label="?" label_selected="?" name="help_button"/>
- <line_editor label="Indtast nyt gruppenavn her" name="group_name_editor"/>
+ <button label="?" label_selected="?" name="help_button" />
+ <line_editor label="Indtast nyt gruppenavn her" name="group_name_editor" />
<text name="group_name">
Skriv det nye gruppenavn her
</text>
<text name="prepend_founded_by">
Grundlagt af
</text>
- <text name="founder_name" left_delta="70" >
+ <text name="founder_name">
(venter)
</text>
<text name="group_charter_label">
Gruppens formål
</text>
- <texture_picker label="Gruppe distinktioner" name="insignia" tool_tip="Klik for at vælge et billede"/>
+ <texture_picker label="Gruppe distinktioner" name="insignia"
+ tool_tip="Klik for at vælge et billede" />
<text_editor name="charter">
Gruppens formål
</text_editor>
- <button label="Tilmeld (L$0)" label_selected="Tilmeld (L$0)" name="join_button"/>
- <button label="Detaljeret visning" label_selected="Detaljeret visning" name="info_button"/>
+ <button label="Tilmeld (L$0)" label_selected="Tilmeld (L$0)" name="join_button" />
+ <button label="Detaljeret visning" label_selected="Detaljeret visning"
+ name="info_button" />
<text name="text_owners_and_visible_members">
Ejere &amp; synlige medlemmer
</text>
@@ -37,37 +39,34 @@ Bevæg din mus over mulighederne for mere hjælp.
(Ejere er vist med fed skrift)
</text>
<name_list name="visible_members">
- <column label="Medlemsnavn" name="name"/>
- <column label="Titel" name="title"/>
- <column label="Senest på d." name="online"/>
+ <column label="Medlemsnavn" name="name" />
+ <column label="Titel" name="title" />
+ <column label="Senest på d." name="online" />
</name_list>
<text name="text_group_preferences">
Gruppeindstillinger
</text>
<panel name="preferences_container">
- <check_box label="Vis i søgning" name="show_in_group_list" tool_tip="Lad folk se denne gruppe i søgeresultater."/>
- <check_box label="Åben tilmelding" name="open_enrollement" tool_tip="Angiver om denne gruppe tillader nye medlemmer at tilmelde sig, uden de er inviteret."/>
- <check_box label="Tilmeldingsgebyr: L$" name="check_enrollment_fee" tool_tip="Angiver om der kræves et gebyr, for at tilmelde sig gruppen."/>
- <spinner name="spin_enrollment_fee" tool_tip="Nye medlemmer skal betale dette gebyr for at tilmelde sig gruppen, når Tilmeldingsgebyr er valgt." width="60" left_delta="130"/>
- <combo_box name="group_mature_check" tool_tip="Angiver om din gruppes information anses som &apos;mature&apos;." width="150">
- <combo_item name="select_mature">
- - Vælg indholdsrating -
- </combo_item>
- <combo_item name="mature">
- Mature indhold
- </combo_item>
- <combo_item name="pg">
- PG indhold
- </combo_item>
- </combo_box>
+ <check_box label="Vis i søgning" name="show_in_group_list"
+ tool_tip="Lad folk se denne gruppe i søgeresultater." />
+ <check_box label="Åben tilmelding" name="open_enrollement"
+ tool_tip="Angiver om denne gruppe tillader nye medlemmer at tilmelde sig, uden de er inviteret." />
+ <check_box label="Tilmeldingsgebyr: L$" name="check_enrollment_fee"
+ tool_tip="Angiver om der kræves et gebyr, for at tilmelde sig gruppen." />
+ <spinner name="spin_enrollment_fee"
+ tool_tip="Nye medlemmer skal betale dette gebyr for at tilmelde sig gruppen, når Tilmeldingsgebyr er valgt." />
+
<panel name="title_container">
<text name="active_title_label">
Min aktive titel
</text>
- <combo_box length="150" name="active_title" tool_tip="Angiver den titel der vises i din avatars navnefelt, når denne gruppe er aktiv."/>
+ <combo_box length="150" name="active_title"
+ tool_tip="Angiver den titel der vises i din avatars navnefelt, når denne gruppe er aktiv." />
</panel>
- <check_box label="Modtag gruppeinformationer" name="receive_notices" tool_tip="Angiver om du vil modtage informationer fra denne gruppe. Fjern markeringen i boksen hvis gruppen spammer dig."/>
- <check_box label="Vis gruppen i min profil" name="list_groups_in_profile" tool_tip="Angiver om du vil vise denne gruppe i dine profilinformationer"/>
+ <check_box label="Modtag gruppeinformationer" name="receive_notices"
+ tool_tip="Angiver om du vil modtage informationer fra denne gruppe. Fjern markeringen i boksen hvis gruppen spammer dig." />
+ <check_box label="Vis gruppen i min profil" name="list_groups_in_profile"
+ tool_tip="Angiver om du vil vise denne gruppe i dine profilinformationer" />
</panel>
<string name="incomplete_member_data_str">
Henter medlemsinformationer
diff --git a/indra/newview/skins/default/xui/da/panel_group_invite.xml b/indra/newview/skins/default/xui/da/panel_group_invite.xml
index 813007aee0..6efc93daac 100644
--- a/indra/newview/skins/default/xui/da/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/da/panel_group_invite.xml
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel label="Invitér et medlem" name="invite_panel">
<text name="help_text">
- Du kan invitere flere beboere ad
-gangen til at blive medlem af din
-gruppe. Klik &apos;Åben personvælger&apos; for
-at begynde.
+ Du kan invitere flere beboere til at
+blive medlem af din gruppe. Klik &apos;Åben
+personvælger&apos; for at begynde.
</text>
- <button label="Åben personvælger" name="add_button" bottom_delta="-30"/>
+ <button label="Åben personvælger" name="add_button" />
<name_list name="invitee_list"
tool_tip="Hold Ctrl-tasten nede og klik på beboere for at vælge flere." />
<button label="Fjern valgte fra listen" name="remove_button"
diff --git a/indra/newview/skins/default/xui/da/panel_group_land_money.xml b/indra/newview/skins/default/xui/da/panel_group_land_money.xml
index 029922c413..2ab8935609 100644
--- a/indra/newview/skins/default/xui/da/panel_group_land_money.xml
+++ b/indra/newview/skins/default/xui/da/panel_group_land_money.xml
@@ -1,9 +1,10 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel label="Land &amp; L$" name="land_money_tab">
<string name="help_text">
- Grunde ejet af gruppen er vist sammen med bidragsdetaljer. En advarsel vises indtil Total land i brug er mindre end eller lig med det totale bidrag. Planlægning, detaljer og salgsfaneblade viser information om gruppens økonomi.
+ Grunde ejet af gruppen er vist sammen med bidragsdetaljer. En advarsel vises indtil Total land i brug er mindre end eller lig med det totale
+bidrag. Planlægning, detaljer og salgsfaneblade viser information om gruppens økonomi.
</string>
- <button label="?" name="help_button"/>
+ <button label="?" name="help_button" />
<string name="cant_view_group_land_text">
Du har ikke tilladelse til at se gruppeejet land.
</string>
@@ -17,30 +18,29 @@
Gruppeejet land
</text>
<scroll_list name="group_parcel_list">
- <column label="Grundens navn" name="name"/>
- <column label="Region" name="location"/>
- <column label="Type" name="type"/>
- <column label="Område" name="area"/>
- <column label="" name="hidden"/>
+ <column label="Grundens navn" name="name" />
+ <column label="Region" name="location" />
+ <column label="Område" name="area" />
+ <column label="" name="hidden" />
</scroll_list>
- <button label="Vis på kort" label_selected="Vis på kort" name="map_button"/>
+ <button label="Vis på kort" label_selected="Vis på kort" name="map_button" />
<text name="total_contributed_land_label">
Total bidrag:
</text>
<text name="total_contributed_land_value">
- [AREA] m²
+ [AREA] kvadratmeter
</text>
<text name="total_land_in_use_label">
Total land i brug:
</text>
<text name="total_land_in_use_value">
- [AREA] m²
+ [AREA] kvadratmeter
</text>
<text name="land_available_label">
Tilgængeligt land:
</text>
<text name="land_available_value">
- [AREA] m²
+ [AREA] kvadratmeter
</text>
<text name="your_contribution_label">
Dit bidrag:
@@ -49,34 +49,32 @@
Ikke muligt at lave dit bidrag til landet.
</string>
<text name="your_contribution_max_value">
- m² ([AMOUNT] maks.)
+ kvadratmeter ([AMOUNT] maks.)
</text>
<text name="group_over_limit_text">
- Gruppemedlemmer må bidrag med mere, for at understøtte
-med det land der bliver brugt.
+ Gruppemedlemmer må bidrag med mere, for at understøtte med det land der bliver brugt.
</text>
<text name="group_money_heading">
Gruppe L$
</text>
<tab_container name="group_money_tab_container">
- <panel label="Planlægning" name="group_money_planning_tab">
- <text_editor name="group_money_planning_text">
- Beregner...
- </text_editor>
- </panel>
<panel label="Detaljer" name="group_money_details_tab">
<text_editor name="group_money_details_text">
Beregner...
</text_editor>
- <button label="&lt; Før" label_selected="&lt; Før" name="earlier_details_button" tool_tip="Gå tilbage i tid"/>
- <button label="Efter &gt;" label_selected="Efter &gt;" name="later_details_button" tool_tip="Gå frem i tid"/>
+ <button label="&lt; Før" label_selected="&lt; Før" name="earlier_details_button"
+ tool_tip="Gå tilbage i tid" />
+ <button label="Efter &gt;" label_selected="Efter &gt;" name="later_details_button"
+ tool_tip="Gå frem i tid" />
</panel>
<panel label="Salg" name="group_money_sales_tab">
<text_editor name="group_money_sales_text">
Beregner...
</text_editor>
- <button label="&lt; Før" label_selected="&lt; Før" name="earlier_sales_button" tool_tip="Gå tilbage i tid"/>
- <button label="Efter &gt;" label_selected="Efter &gt;" name="later_sales_button" tool_tip="Gå frem i tid"/>
+ <button label="&lt; Før" label_selected="&lt; Før" name="earlier_sales_button"
+ tool_tip="Gå tilbage i tid" />
+ <button label="Efter &gt;" label_selected="Efter &gt;" name="later_sales_button"
+ tool_tip="Gå frem i tid" />
</panel>
</tab_container>
</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_group_roles.xml b/indra/newview/skins/default/xui/da/panel_group_roles.xml
index 5c2fd356d8..2af84858a1 100644
--- a/indra/newview/skins/default/xui/da/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/da/panel_group_roles.xml
@@ -11,7 +11,7 @@
<text name="static">
Medlemmer &amp; roller
</text>
- <text name="static2" width="400">
+ <text name="static2">
Gruppemedlemmer får tildelt roller med rettigheder. Disse indstillinger kan
let tilpasses efter ønske, så gruppen kan vokse og blive mere fleksibel.
</text>
@@ -20,10 +20,10 @@ let tilpasses efter ønske, så gruppen kan vokse og blive mere fleksibel.
<text name="static">
Roller
</text>
- <text name="role_properties_modifiable" width="400">
- Vælg en rolle nedenfor. Du kan ændre dens navn, beskrivelse og medlemstitel.
+ <text name="role_properties_modifiable">
+ Vælg en rolle nedenfor. Du kan ændre dens navn, beskrivelse og medlemstitel.
</text>
- <text name="role_properties_not_modifiable" width="400">
+ <text name="role_properties_not_modifiable">
Vælg rolle forneden for at se dens egenskaber, medlemmer og rettigheder.
</text>
<text name="role_actions_modifiable">
@@ -51,7 +51,7 @@ der har denne rettighed.
<column label="Doneret leje" name="donated" />
<column label="Sidst på den" name="online" />
</name_list>
- <button label="Invitér nyt medlem..." name="member_invite"/>
+ <button label="Inviter ny person ..." name="member_invite" />
<button label="Udmeld" name="member_eject" />
<string name="help_text">
Du kan tilføje eller fjerne roller, der er tildelt medlemmerne.
@@ -67,7 +67,7 @@ klik på deres navne.
<column label="Titel" name="title" />
<column label="Medlemmer" name="members" />
</scroll_list>
- <button label="Opret ny rolle..." name="role_create" />
+ <button label="Opret ny rolle ..." name="role_create" />
<button label="Slet rolle" name="role_delete" />
<string name="help_text">
Roller har en titel og en tilladelsesliste med rettigheder,
diff --git a/indra/newview/skins/default/xui/da/panel_groups.xml b/indra/newview/skins/default/xui/da/panel_groups.xml
index 4c7b924bcc..b3a09b0082 100644
--- a/indra/newview/skins/default/xui/da/panel_groups.xml
+++ b/indra/newview/skins/default/xui/da/panel_groups.xml
@@ -3,10 +3,10 @@
<scroll_list name="group list">
<column label="" name="name" />
</scroll_list>
- <text type="string" length="1" name="groupdesc" width="300">
+ <text type="string" length="1" name="groupdesc">
Din nuværende aktive gruppe er fremhævet i listen.
</text>
- <text type="string" length="1" name="groupcount" width="300">
+ <text type="string" length="1" name="groupcount">
Du er medlem i [COUNT] grupper (ud af maksimalt [MAX]).
</text>
<button label="IM/Opkald" name="IM" tool_tip="Åbner IM session" />
diff --git a/indra/newview/skins/default/xui/da/panel_region_covenant.xml b/indra/newview/skins/default/xui/da/panel_region_covenant.xml
index 394664f1f1..63a2f90e36 100644
--- a/indra/newview/skins/default/xui/da/panel_region_covenant.xml
+++ b/indra/newview/skins/default/xui/da/panel_region_covenant.xml
@@ -1,67 +1,39 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel label="Covenant" name="Covenant">
- <text name="estate_section_lbl">
- Estate:
- </text>
- <text name="estate_name_lbl">
- Navn:
- </text>
- <text name="estate_name_text">
- mainland
- </text>
- <text name="estate_owner_lbl">
- Ejer:
- </text>
- <text name="estate_owner_text">
- (ingen)
- </text>
- <text name="covenant_timestamp_text">
- Sidst ændret Ons Dec 31 16:00:00 1969
- </text>
- <button label="?" name="covenant_help"/>
- <text_editor name="covenant_editor">
- Der er ikke angivet nogen regler for denne estate.
- </text_editor>
- <button label="Reset" name="reset_covenant"/>
<text name="covenant_help_text">
- Ændringer i regler vil blive vist i alle parceller til denne estate.
- </text>
- <text name="covenant_instructions">
- Træk og slip et notecard her for at ændre regler for denne estate.
- </text>
- <text name="region_section_lbl">
- Region:
+ Ændringer i regel information vil blive vist i alle parceller til denne estate.
</text>
<text name="region_name_lbl">
- Navn:
+ Region:
</text>
<text name="region_name_text">
- leyla
- </text>
- <text name="region_landtype_lbl">
- Type:
+ (ukendt)
</text>
- <text name="region_landtype_text">
- Mainland / Homestead
+ <text name="estate_name_lbl">
+ Estate:
</text>
- <text name="region_maturity_lbl">
- Rating:
+ <text name="estate_name_text">
+ (ukendt)
</text>
- <text name="region_maturity_text">
- Adult
+ <text name="estate_owner_lbl">
+ Estate ejer:
</text>
- <text name="resellable_lbl">
- Videresalg:
+ <text name="estate_owner_text">
+ (ukendt)
</text>
<text name="resellable_clause">
- Land i denne region må ikke sælges videre.
- </text>
- <text name="changeable_lbl">
- Opdel:
+ Valgfrit om købt land i denne region må sælges videre
</text>
<text name="changeable_clause">
- Land i denne region må ikke deles eller samles.
+ Valgfrit om købt land i denne region må deles eller samles.
</text>
+ <text name="covenent_instructions">
+ Træk og slip et notecard her for at ændre regler for dette estate.
+ </text>
+ <text_editor name="covenant_editor">
+ Henter...
+ </text_editor>
+ <button label="Reset" name="reset_covenant" />
<string name="can_resell">
Købt land i denne region må sælges videre
</string>
@@ -74,4 +46,5 @@
<string name="can_not_change">
Købt land i denne region må ikke deles eller samles.
</string>
+ <button label="?" name="covenant_help" />
</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_region_estate.xml b/indra/newview/skins/default/xui/da/panel_region_estate.xml
index 0a439f8c62..108763d544 100644
--- a/indra/newview/skins/default/xui/da/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/da/panel_region_estate.xml
@@ -34,7 +34,7 @@ regioner i dette estate.
<button label="?" name="voice_chat_help" />
<check_box label="Tillad direkte teleport" name="allow_direct_teleport" />
<button label="?" name="allow_direct_teleport_help" />
- <text name="abuse_email_text" width="260">
+ <text name="abuse_email_text">
Send beskeder misbrug til email adresse:
</text>
<string name="email_unsupported">
diff --git a/indra/newview/skins/default/xui/da/panel_region_general.xml b/indra/newview/skins/default/xui/da/panel_region_general.xml
index e4b722c20d..5f0e71f63d 100644
--- a/indra/newview/skins/default/xui/da/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/da/panel_region_general.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel label="Region" name="General">
<text name="region_text_lbl">
Region:
@@ -12,48 +12,35 @@
<text name="version_channel_text">
ukendt
</text>
- <text name="region_type_lbl">
- Type:
- </text>
- <text name="region_type">
- ukendt
- </text>
- <check_box label="Blokér for redigering af terræn" name="block_terraform_check"/>
- <button label="?" name="terraform_help"/>
- <check_box label="Blokér for flyvning" name="block_fly_check"/>
- <button label="?" name="fly_help"/>
- <check_box label="Tillad skader" name="allow_damage_check"/>
- <button label="?" name="damage_help"/>
- <check_box label="Begræns skubning" name="restrict_pushobject"/>
- <button label="?" name="restrict_pushobject_help"/>
- <check_box label="Tillad at sælge land" name="allow_land_resell_check"/>
- <button label="?" name="land_resell_help"/>
- <check_box label="Tillad at samle/dele land" name="allow_parcel_changes_check"/>
- <button label="?" name="parcel_changes_help"/>
- <check_box label="Blokér visning af land i Søgning" name="block_parcel_search_check" tool_tip="Lad beboere se denne region og dens parceller i søgeresultater"/>
- <button label="?" name="parcel_search_help"/>
- <spinner label="Max besøgende" name="agent_limit_spin"/>
- <button label="?" name="agent_limit_help"/>
- <spinner label="Objekt bonus" name="object_bonus_spin"/>
- <button label="?" name="object_bonus_help"/>
+ <check_box label="Blokér for redigering af terræn" name="block_terraform_check" />
+ <button label="?" name="terraform_help" />
+ <check_box label="Blokér for flyvning" name="block_fly_check" />
+ <button label="?" name="fly_help" />
+ <check_box label="Tillad skader" name="allow_damage_check" />
+ <button label="?" name="damage_help" />
+ <check_box label="Begræns skubning" name="restrict_pushobject" />
+ <button label="?" name="restrict_pushobject_help" />
+ <check_box label="Tillad at sælge land" name="allow_land_resell_check" />
+ <button label="?" name="land_resell_help" />
+ <check_box label="Tillad at samle/dele land" name="allow_parcel_changes_check" />
+ <button label="?" name="parcel_changes_help" />
+ <check_box label="Blokér visning af land i Søgning" name="block_parcel_search_check"
+ tool_tip="Lad beboere se denne region og dens parceller i søgeresultater" />
+ <button label="?" name="parcel_search_help" />
+ <spinner label="Max besøgende" name="agent_limit_spin" />
+ <button label="?" name="agent_limit_help" />
+ <spinner label="Objekt bonus" name="object_bonus_spin" />
+ <button label="?" name="object_bonus_help" />
<text label="Indhold" name="access_text">
- Rating:
+ Indhold:
</text>
- <combo_box label="Mature" name="access_combo">
- <combo_item name="Adult">
- Adult
- </combo_item>
- <combo_item name="Mature">
- Mature
- </combo_item>
- <combo_item name="PG">
- PG
- </combo_item>
- </combo_box>
- <button label="?" name="access_help"/>
- <button label="Gem" name="apply_btn"/>
- <button label="Send en beboer hjem ..." name="kick_btn"/>
- <button label="Send alle beboere hjem..." name="kick_all_btn"/>
- <button label="Send besked til region..." name="im_btn"/>
- <button label="Vedligehold telehub..." name="manage_telehub_btn"/>
+
+
+
+ <button label="?" name="access_help" />
+ <button label="Gem" name="apply_btn" />
+ <button label="Send en beboer hjem ..." name="kick_btn" />
+ <button label="Send alle beboere hjem..." name="kick_all_btn" />
+ <button label="Send besked til region..." name="im_btn" />
+ <button label="Vedligehold telehub..." name="manage_telehub_btn" />
</panel>
diff --git a/indra/newview/skins/default/xui/da/panel_region_terrain.xml b/indra/newview/skins/default/xui/da/panel_region_terrain.xml
index 14ef0060b1..4ff81112d3 100644
--- a/indra/newview/skins/default/xui/da/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/da/panel_region_terrain.xml
@@ -13,9 +13,9 @@
<spinner label="Max sænkning af land" name="terrain_lower_spin" />
<button label="?" name="terrain_lower_help" />
<check_box label="Benyt solopsætning fra estate" name="use_estate_sun_check" />
- <button label="?" name="use_estate_sun_help" left="430"/>
+ <button label="?" name="use_estate_sun_help" />
<check_box label="Fast sol-position" name="fixed_sun_check" />
- <button label="?" name="fixed_sun_help" left="430"/>
+ <button label="?" name="fixed_sun_help" />
<slider label="Fase" name="sun_hour_slider" />
<button label="Gem" name="apply_btn" />
<button label="Download RAW terræn fil..." name="download_raw_btn"
diff --git a/indra/newview/skins/default/xui/da/teleport_strings.xml b/indra/newview/skins/default/xui/da/teleport_strings.xml
index cc75abbb26..78052b4ef5 100644
--- a/indra/newview/skins/default/xui/da/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/da/teleport_strings.xml
@@ -2,18 +2,21 @@
<teleport_messages>
<message_set name="errors">
<message name="invalid_tport">
- Der er problemer med at håndtere din teleport. Det kan være nødvendigt at logge ud og ind for at kunne skifte teleportere.
+ Der er problemer med at håndtere din teleport.
+Det kan være nødvendigt at logge ud og ind for at kunne skifte teleportere.
Hvis du bliver ved med at have problemet kan du checke teknisk support på:
-www.secondlife.com/support
+www.secondlife.com/support.
</message>
<message name="invalid_region_handoff">
- Problem registreret i forbindelse med skift til ny region. Det kan være nødvendigt at logge ud og ind for at kunne skifte regioner.
+ Problem registreret i forbindelse med skift til ny region.
+Det kan være nødvendigt at logge ud og ind for at kunne skifte regioner.
Hvis du bliver ved med at have problemet kan du checke teknisk support på:
-www.secondlife.com/support
+www.secondlife.com/support.
</message>
<message name="blocked_tport">
Beklager, teleport er blokeret lige nu. Prøv igen senere.
-Hvis du stadig ikke kan teleporte, prøv venligst at logge ud og ligge ind for at løse dette problem.
+Hvis du stadig ikke kan teleporte, prøv venligst at logge ud og ligge
+ind for at løse dette problem.
</message>
<message name="nolandmark_tport">
Beklager, systemet kunne ikke finde landmærke destinationen.
@@ -26,20 +29,24 @@ Prøv igen om lidt.
Beklager, du har ikke adgang til denne teleport destination.
</message>
<message name="missing_attach_tport">
- Dine vedhæng er ikke ankommet endnu. Prøv at vente lidt endnu eller log ud og ind igen før du prøver at teleporte igen.
+ Dine vedhæng er ikke ankommet endnu. Prøv at vente lidt endnu
+eller log ud og ind igen før du prøver at teleporte igen.
</message>
<message name="too_many_uploads_tport">
Tekniske problemer hindrer at din teleport kan gennemføres.
Prøv venligst igen om lidt eller vælg et mindre travlt område.
</message>
<message name="expired_tport">
- Beklager, men systemet kunne ikke fuldføre din teleport i rimelig tid. Prøv venligst igen om lidt.
+ Beklager, men systemet kunne ikke fuldføre din teleport
+i rimelig tid. Prøv venligst igen om lidt.
</message>
<message name="expired_region_handoff">
- Beklager, men systemet kunne ikke fuldføre skift til anden region i rimelig tid. Prøv venligst igen om lidt.
+ Beklager, men systemet kunne ikke fuldføre skift til anden region
+i rimelig tid. Prøv venligst igen om lidt.
</message>
<message name="no_host">
- Ikke muligt at fine teleport destination. Destinationen kan være midlertidig utilgængelig eller findes ikke mere.
+ Ikke muligt at fine teleport destination. Destinationen kan
+være midlertidig utilgængelig eller findes ikke mere.
Prøv evt. igen om lidt.
</message>
<message name="no_inventory_host">
diff --git a/indra/newview/skins/default/xui/de/floater_mute_object.xml b/indra/newview/skins/default/xui/de/floater_mute_object.xml
index 60c6ff008c..02eafbcb68 100644
--- a/indra/newview/skins/default/xui/de/floater_mute_object.xml
+++ b/indra/newview/skins/default/xui/de/floater_mute_object.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="mute by name" title="Objekt nach Name stummschalten">
<text name="message">
- Stummschalten nach Name betrifft nur Chat und IM, keine
-Sounds. Sie müssen den Objektnamen exakt angeben.
+ Stummschalten nach Name betrifft nur Chat und IM, keine Sounds.
+Sie müssen den Objektnamen exakt angeben.
</text>
<line_editor name="object_name">
Objektname
diff --git a/indra/newview/skins/default/xui/de/floater_snapshot.xml b/indra/newview/skins/default/xui/de/floater_snapshot.xml
index 401aa74084..e94e22d9b8 100644
--- a/indra/newview/skins/default/xui/de/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/de/floater_snapshot.xml
@@ -21,12 +21,12 @@
<button label="Senden" name="send_btn"/>
<button label="Speichern ([AMOUNT] L$)" name="upload_btn"/>
<flyout_button label="Speichern" name="save_btn" tool_tip="Bild als Datei speichern">
- <flyout_button_item name="save_item">
- Speichern
- </flyout_button_item>
- <flyout_button_item name="saveas_item">
- Speichern unter...
- </flyout_button_item>
+ <flyout_button.item name="save_item">
+ Speichern
+ </flyout_button.item>
+ <flyout_button.item name="saveas_item">
+ Speichern unter...
+ </flyout_button.item>
</flyout_button>
<button label="Abbrechen" name="discard_btn"/>
<button label="Mehr &gt;&gt;" name="more_btn" tool_tip="Erweiterte Optionen"/>
@@ -38,75 +38,33 @@
Format
</text>
<combo_box label="Auflösung" name="postcard_size_combo">
- <combo_item name="CurrentWindow">
- Aktuelles Fenster
- </combo_item>
- <combo_item name="640x480">
- 640x480
- </combo_item>
- <combo_item name="800x600">
- 800x600
- </combo_item>
- <combo_item name="1024x768">
- 1024x768
- </combo_item>
- <combo_item name="Custom">
- Benutzerdefiniert
- </combo_item>
+ <combo_box.item name="CurrentWindow" label="Aktuelles Fenster" />
+ <combo_box.item name="640x480" label="640x480" />
+ <combo_box.item name="800x600" label="800x600" />
+ <combo_box.item name="1024x768" label="1024x768" />
+ <combo_box.item name="Custom" label="Benutzerdefiniert" />
</combo_box>
<combo_box label="Auflösung" name="texture_size_combo">
- <combo_item name="CurrentWindow">
- Aktuelles Fenster
- </combo_item>
- <combo_item name="Small(128x128)">
- Klein (128x128)
- </combo_item>
- <combo_item name="Medium(256x256)">
- Mittel (256x256)
- </combo_item>
- <combo_item name="Large(512x512)">
- Groß (512x512)
- </combo_item>
- <combo_item name="Custom">
- Benutzerdefiniert
- </combo_item>
+ <combo_box.item name="CurrentWindow" label="Aktuelles Fenster" />
+ <combo_box.item name="Small(128x128)" label="Klein (128x128)" />
+ <combo_box.item name="Medium(256x256)" label="Mittel (256x256)" />
+ <combo_box.item name="Large(512x512)" label="Groß (512x512)" />
+ <combo_box.item name="Custom" label="Benutzerdefiniert" />
</combo_box>
<combo_box label="Auflösung" name="local_size_combo">
- <combo_item name="CurrentWindow">
- Aktuelles Fenster
- </combo_item>
- <combo_item name="320x240">
- 320x240
- </combo_item>
- <combo_item name="640x480">
- 640x480
- </combo_item>
- <combo_item name="800x600">
- 800x600
- </combo_item>
- <combo_item name="1024x768">
- 1024x768
- </combo_item>
- <combo_item name="1280x1024">
- 1280x1024
- </combo_item>
- <combo_item name="1600x1200">
- 1600x1200
- </combo_item>
- <combo_item name="Custom">
- Benutzerdefiniert
- </combo_item>
+ <combo_box.item name="CurrentWindow" label="Aktuelles Fenster" />
+ <combo_box.item name="320x240" label="320x240" />
+ <combo_box.item name="640x480" label="640x480" />
+ <combo_box.item name="800x600" label="800x600" />
+ <combo_box.item name="1024x768" label="1024x768" />
+ <combo_box.item name="1280x1024" label="1280x1024" />
+ <combo_box.item name="1600x1200" label="1600x1200" />
+ <combo_box.item name="Custom" label="Benutzerdefiniert" />
</combo_box>
<combo_box label="Format" name="local_format_combo">
- <combo_item name="PNG">
- PNG
- </combo_item>
- <combo_item name="JPEG">
- JPEG
- </combo_item>
- <combo_item name="BMP">
- BMP
- </combo_item>
+ <combo_box.item name="PNG" label="PNG" />
+ <combo_box.item name="JPEG" label="JPEG" />
+ <combo_box.item name="BMP" label="BMP" />
</combo_box>
<spinner label="Breite" name="snapshot_width"/>
<spinner label="Höhe" name="snapshot_height"/>
@@ -116,15 +74,9 @@
Aufnehmen:
</text>
<combo_box label="Bildlayer" name="layer_types" width="132" left="73">
- <combo_item name="Colors">
- Farben
- </combo_item>
- <combo_item name="Depth">
- Tiefe
- </combo_item>
- <combo_item name="ObjectMattes">
- Objektmasken
- </combo_item>
+ <combo_box.item name="Colors" label="Farben" />
+ <combo_box.item name="Depth" label="Tiefe" />
+ <combo_box.item name="ObjectMattes" label="Objektmasken" />
</combo_box>
<check_box label="Interface auf Foto anzeigen" name="ui_check"/>
<check_box label="HUD-Objekte auf Foto anzeigen" name="hud_check"/>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_general.xml b/indra/newview/skins/default/xui/de/panel_preferences_general.xml
index 40b4909e84..92b45bf5a5 100644
--- a/indra/newview/skins/default/xui/de/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_general.xml
@@ -10,15 +10,9 @@
</radio_group>
<check_box label="Startposition auf Anmeldebildschirm anzeigen" name="show_location_checkbox"/>
<combo_box name="fade_out_combobox">
- <combo_item name="Never">
- Nie
- </combo_item>
- <combo_item name="Show Temporarily">
- Temporär anzeigen
- </combo_item>
- <combo_item name="Always">
- Immer
- </combo_item>
+ <combo_box.item name="Never" label="Nie" />
+ <combo_box.item name="Show Temporarily" label="Temporär anzeigen" />
+ <combo_box.item name="Always" label="Immer" />
</combo_box>
<check_box label="Kleine Avatarnamen" name="small_avatar_names_checkbox"/>
<check_box label="Meinen Namen auf meinem Bildschirm ausblenden" name="show_my_name_checkbox"/>
@@ -80,49 +74,29 @@ Alterseinstufung zugreifen:
&lt;Region eingeben&gt;
</string>
<combo_box name="crash_behavior_combobox" width="166">
- <combo_item name="Askbeforesending">
- Vor dem Senden fragen
- </combo_item>
- <combo_item name="Alwayssend">
- Immer senden
- </combo_item>
- <combo_item name="Neversend">
- Nie senden
- </combo_item>
+ <combo_box.item name="Askbeforesending" label="Vor dem Senden fragen" />
+ <combo_box.item name="Alwayssend" label="Immer senden" />
+ <combo_box.item name="Neversend" label="Nie senden" />
</combo_box>
<combo_box name="language_combobox" width="166">
- <combo_item name="System Default Language">
- Betriebssystem-Einstellung
- </combo_item>
- <combo_item name="English">
- English (Englisch)
- </combo_item>
- <combo_item name="Danish">
- Danks (Dänisch) - Beta
- </combo_item>
- <combo_item name="Deutsch(German)">
- Deutsch - Beta
- </combo_item>
- <combo_item name="Spanish">
- Español (Spanisch) - Beta
- </combo_item>
- <combo_item name="French">
- Français (Französisch) - Beta
- </combo_item>
+ <combo_box.item name="System Default Language" label="Betriebssystem-Einstellung" />
+ <combo_box.item name="English" label="English (Englisch)" />
+ <combo_box.item name="Danish" label="Danks (Dänisch) - Beta" />
+ <combo_box.item name="Deutsch(German)" label="Deutsch - Beta" />
+ <combo_box.item name="Spanish" label="Español (Spanisch) - Beta" />
+ <combo_box.item name="French" label="Français (Französisch) - Beta" />
+ <combo_box.item name="Hungarian" label="Magyar (Ungarisch) - Beta" />
+ <combo_box.item name="Polish" label="Polski (Polnisch) - Beta" />
+ <combo_box.item name="Portugese" label="Português (Portugiesisch) - Beta" />
+ <combo_box.item name="Chinese" label="中文 (简体) (Chinesisch) - Beta" />
+ <combo_box.item name="(Japanese)" label="日本語 (Japanisch) - Beta" />
+ <combo_box.item name="(Korean)" label="한국어 (Koreanisch) - Beta" />
<combo_item name="Italian">
Italiano (Italienisch) - Beta
</combo_item>
- <combo_item name="Hungarian">
- Magyar (Ungarisch) - Beta
- </combo_item>
<combo_item name="Dutch">
Nederlands (Niederländisch) - Beta
</combo_item>
- <combo_item name="Polish">
- Polski (Polnisch) - Beta
- </combo_item>
- <combo_item name="Portugese">
- Português (Portugiesisch) - Beta
</combo_item>
<combo_item name="Russian">
Русский (Russian) - Beta
@@ -132,16 +106,6 @@ Alterseinstufung zugreifen:
</combo_item>
<combo_item name="Ukrainian">
Українська (Ukrainisch) - Beta
- </combo_item>
- <combo_item name="Chinese">
- 中文 (简体) (Chinesisch) - Beta
- </combo_item>
- <combo_item name="(Japanese)">
- 日本語 (Japanisch) - Beta
- </combo_item>
- <combo_item name="(Korean)">
- 한국어 (Koreanisch) - Beta
- </combo_item>
</combo_box>
<check_box label="Objekten Sprache mitteilen" name="language_is_public" tool_tip="In-Welt-Objekten wird Ihre bevorzugte Spracheinstellung mitgeteilt."/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml
index 0e256bd8b8..3e3b8df646 100644
--- a/indra/newview/skins/default/xui/es/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/es/floater_about_land.xml
@@ -47,13 +47,13 @@
<text length="1" name="For sale to" type="string">
En venta a: [BUYER]
</text>
- <text width="216" length="1" name="Sell with landowners objects in parcel." type="string">
+ <text length="1" name="Sell with landowners objects in parcel." type="string">
Los objetos se incluyen en la venta.
</text>
- <text width="216" length="1" name="Selling with no objects in parcel." type="string">
+ <text length="1" name="Selling with no objects in parcel." type="string">
Los objetos no se incluyen en la venta.
</text>
- <button font="SansSerifSmall" bottom="-245" left="275" width="165" label="Cancelar la venta del terreno" label_selected="Cancelar la venta del terreno" name="Cancel Land Sale"/>
+ <button font="SansSerifSmall" left="275" width="165" label="Cancelar la venta del terreno" label_selected="Cancelar la venta del terreno" name="Cancel Land Sale"/>
<text length="1" name="Claimed:" type="string">
Reclamada:
</text>
@@ -194,7 +194,7 @@ Vaya al menú Mundo &gt; Acerca del terreno o seleccione otra parcela para ver s
<text length="1" name="Simulator primitive usage:" type="string">
Simulador de uso de prims:
</text>
- <text name="objects_available" left="204" width="250" >
+ <text name="objects_available" left="214" width="230" >
[COUNT] de un máximo de [MAX] ([AVAILABLE] disponibles)
</text>
<string name="objects_available_text">
@@ -206,19 +206,19 @@ Vaya al menú Mundo &gt; Acerca del terreno o seleccione otra parcela para ver s
<text length="1" name="Primitives parcel supports:" type="string" width="200">
Prims que admite la parcela:
</text>
- <text name="object_contrib_text" left="204" width="152">
+ <text name="object_contrib_text" left="214" width="152">
[COUNT]
</text>
<text length="1" name="Primitives on parcel:" type="string">
Prims en la parcela:
</text>
- <text name="total_objects_text" left="204" width="48">
+ <text name="total_objects_text" left="214" width="48">
[COUNT]
</text>
<text length="1" name="Owned by parcel owner:" type="string" left="14" width="180" >
Del propietario de la parcela:
</text>
- <text name="owner_objects_text" left="204" width="48">
+ <text name="owner_objects_text" left="214" width="48">
[COUNT]
</text>
<button label="Mostrar" label_selected="Mostrar" name="ShowOwner" right="-135" width="60"/>
@@ -226,7 +226,7 @@ Vaya al menú Mundo &gt; Acerca del terreno o seleccione otra parcela para ver s
<text length="1" name="Set to group:" type="string" left="14" width="180">
Del grupo:
</text>
- <text name="group_objects_text" left="204" width="48">
+ <text name="group_objects_text" left="214" width="48">
[COUNT]
</text>
<button label="Mostrar" label_selected="Mostrar" name="ShowGroup" right="-135" width="60"/>
@@ -234,7 +234,7 @@ Vaya al menú Mundo &gt; Acerca del terreno o seleccione otra parcela para ver s
<text length="1" name="Owned by others:" type="string" left="14" width="128">
Propiedad de otros:
</text>
- <text name="other_objects_text" left="204" width="48">
+ <text name="other_objects_text" left="214" width="48">
[COUNT]
</text>
<button label="Mostrar" label_selected="Mostrar" name="ShowOther" right="-135" width="60"/>
@@ -242,7 +242,7 @@ Vaya al menú Mundo &gt; Acerca del terreno o seleccione otra parcela para ver s
<text length="1" name="Selected / sat upon:" type="string" left="14" width="193" >
Seleccionados / con gente sentada:
</text>
- <text name="selected_objects_text" left="204" width="48">
+ <text name="selected_objects_text" left="214" width="48">
[COUNT]
</text>
<text name="Autoreturn" left="4" width="412" >
@@ -299,7 +299,7 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
<string name="search_disabled_permissions_tooltip">
Esta opción no esta activada porque usted no puede modificar las opciones de la parcela.
</string>
- <combo_box name="land category with adult" left="282" width="140">
+ <combo_box name="land category with adult">
<combo_item name="AnyCategory">
Cualquier categoría
</combo_item>
@@ -340,45 +340,21 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
Otra
</combo_item>
</combo_box>
- <combo_box name="land category" left="282" width="140">
- <combo_item name="AnyCategory">
- Cualquier categoría
- </combo_item>
- <combo_item name="LindenLocation">
- Localización Linden
- </combo_item>
- <combo_item name="Arts&amp;Culture">
- Arte y Cultura
- </combo_item>
- <combo_item name="Business">
- Negocios
- </combo_item>
- <combo_item name="Educational">
- Educativo
- </combo_item>
- <combo_item name="Gaming">
- Juegos de azar
- </combo_item>
- <combo_item name="Hangout">
- Entretenimiento
- </combo_item>
- <combo_item name="NewcomerFriendly">
- Para recién llegados
- </combo_item>
- <combo_item name="Parks&amp;Nature">
- Parques y Naturaleza
- </combo_item>
- <combo_item name="Residential">
- Residencial
- </combo_item>
- <combo_item name="Shopping">
- Compras
- </combo_item>
- <combo_item name="Other">
- Otra
- </combo_item>
+ <combo_box name="land category">
+ <combo_box.item name="AnyCategory" label="Cualquier categoría"/>
+ <combo_box.item name="LindenLocation" label="Localización Linden"/>
+ <combo_box.item name="Arts&amp;Culture" label="Arte y Cultura"/>
+ <combo_box.item name="Business" label="Negocios"/>
+ <combo_box.item name="Educational" label="Educativo"/>
+ <combo_box.item name="Gaming" label="Juegos de azar"/>
+ <combo_box.item name="Hangout" label="Entretenimiento"/>
+ <combo_box.item name="NewcomerFriendly" label="Para recién llegados"/>
+ <combo_box.item name="Parks&amp;Nature" label="Parques y Naturaleza"/>
+ <combo_box.item name="Residential" label="Residencial"/>
+ <combo_box.item name="Shopping" label="Compras"/>
+ <combo_box.item name="Other" label="Otra"/>
</combo_box>
- <button label="?" label_selected="?" name="?" left="427"/>
+ <button label="?" label_selected="?" name="?"/>
<check_box label="Contenido &apos;Mature&apos;" name="MatureCheck" tool_tip=""/>
<string name="mature_check_mature">
Contenido &apos;Mature&apos;
@@ -408,15 +384,9 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda.
Punto de teleporte:
</text>
<combo_box name="landing type" tool_tip="Punto de teleporte: defina cómo manejar en su terreno los teleportes.">
- <combo_item length="1" name="Blocked" type="string">
- Bloqueado
- </combo_item>
- <combo_item length="1" name="LandingPoint" type="string">
- Punto de llegada
- </combo_item>
- <combo_item length="1" name="Anywhere" type="string">
- Cualquiera
- </combo_item>
+ <combo_box.item length="1" name="Blocked" type="string" label="Bloqueado"/>
+ <combo_box.item length="1" name="LandingPoint" type="string" label="Punto de llegada"/>
+ <combo_box.item length="1" name="Anywhere" type="string" label="Cualquiera"/>
</combo_box>
<string name="push_restrict_text">
Sin &apos;empujones&apos;
@@ -497,12 +467,8 @@ música:
<check_box label="Acceso permitido al grupo: [GROUP]" name="GroupCheck" tool_tip="Elija el grupo en la pestaña General."/>
<check_box label="Vender pases a:" name="PassCheck" tool_tip="Permitir acceso temporal a esta parcela"/>
<combo_box name="pass_combo">
- <combo_item name="Anyone">
- Cualquiera
- </combo_item>
- <combo_item name="Group">
- Grupo
- </combo_item>
+ <combo_box.item name="Anyone" label="Cualquiera"/>
+ <combo_box.item name="Group" label="Grupo"/>
</combo_box>
<spinner label="Precio en L$:" name="PriceSpin"/>
<spinner label="Horas de acceso:" name="HoursSpin"/>
diff --git a/indra/newview/skins/default/xui/es/floater_avatar_picker.xml b/indra/newview/skins/default/xui/es/floater_avatar_picker.xml
index 68a56ac678..105111f29f 100644
--- a/indra/newview/skins/default/xui/es/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/es/floater_avatar_picker.xml
@@ -14,15 +14,13 @@
</panel>
<panel label="Cercanos" name="NearMePanel">
<text name="InstructSelectResident">
- Seleccionar un
-residente cercano:
+ Seleccionar un residente cercano:
</text>
- <button font="SansSerifSmall" left_delta="1" width="115" label="Actualizar la lista" label_selected="Actualizar la lista" name="Refresh"/>
- <slider label="Alcance" name="near_me_range" bottom_delta="-36"/>
+ <button label="Actualizar la lista" label_selected="Actualizar la lista" name="Refresh"/>
+ <slider label="Alcance" name="near_me_range"/>
<text name="meters">
Metros
</text>
- <scroll_list bottom_delta="-169" height="159" name="NearMe" />
</panel>
</tab_container>
<button label="Elegir" label_selected="Elegir" name="Select"/>
diff --git a/indra/newview/skins/default/xui/es/floater_build_options.xml b/indra/newview/skins/default/xui/es/floater_build_options.xml
index c3e4acacf0..bbb5b0e36d 100644
--- a/indra/newview/skins/default/xui/es/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/es/floater_build_options.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="build options floater" title="Opciones de la cuadrícula">
- <spinner label="Unidad de la cuadrícula (metros)" name="GridResolution" width="250" label_width="192"/>
- <spinner label="Graduación de la cuadrícula (metros)" name="GridDrawSize" width="250" label_width="192"/>
+ <spinner label="Unidad de la cuadrícula (metros)" name="GridResolution"/>
+ <spinner label="Graduación de la cuadrícula (metros)" name="GridDrawSize"/>
<check_box label="Activar subunidades" name="GridSubUnit"/>
<check_box label="Ver la sección transversal" name="GridCrossSection"/>
- <slider label="Opacidad de la cuadrícula" name="GridOpacity" width="250"/>
+ <slider label="Opacidad de la cuadrícula" name="GridOpacity"/>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_buy_contents.xml b/indra/newview/skins/default/xui/es/floater_buy_contents.xml
index 2346798f94..e93b8bce2d 100644
--- a/indra/newview/skins/default/xui/es/floater_buy_contents.xml
+++ b/indra/newview/skins/default/xui/es/floater_buy_contents.xml
@@ -6,7 +6,7 @@
<text name="buy_text">
¿Comprar por [AMOUNT] L$ a [NAME]?
</text>
- <button label="Cancelar" label_selected="Cancelar" name="cancel_btn" width="73"/>
+ <button label="Cancelar" label_selected="Cancelar" name="cancel_btn"/>
<button label="Comprar" label_selected="Comprar" name="buy_btn"/>
<check_box label="Vestirse ahora la ropa" name="wear_check"/>
<string name="no_copy_text">
diff --git a/indra/newview/skins/default/xui/es/floater_buy_currency.xml b/indra/newview/skins/default/xui/es/floater_buy_currency.xml
index a01e07e694..b26a9c7494 100644
--- a/indra/newview/skins/default/xui/es/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/es/floater_buy_currency.xml
@@ -22,14 +22,14 @@
<text name="buy_action">
[NAME] [PRICE] L$
</text>
- <text name="currency_action" width="50">
- Comprar
+ <text name="currency_action">
+ Comprar L$
</text>
- <line_editor name="currency_amt" width="65" left_delta="50">
+ <line_editor name="currency_amt">
1234
</line_editor>
- <text name="currency_est" width="138" left_delta="68">
- L$ por, aprox., [USD] US$
+ <text name="currency_est">
+ por, aprox., [USD] US$
</text>
<text name="getting_data">
Obteniendo los datos...
@@ -63,6 +63,6 @@ Aumente la cantidad a comprar.
<button label="Cancelar" name="cancel_btn"/>
<button label="Comprar" name="buy_btn"/>
<string name="buy_currency">
- Compre [LINDENS] L$ por, aprox., [USD] US$
+ Comprar L$ [LINDENS] por, aprox., [USD] U$D
</string>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_color_picker.xml b/indra/newview/skins/default/xui/es/floater_color_picker.xml
index c220c48cb0..238853c58d 100644
--- a/indra/newview/skins/default/xui/es/floater_color_picker.xml
+++ b/indra/newview/skins/default/xui/es/floater_color_picker.xml
@@ -25,7 +25,6 @@
Color actual:
</text>
<text name="(Drag below to save.)">
- (Arrástrelo abajo
- para guardarlo.)
+ (Arrástrelo abajo para guardarlo)
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/es/floater_day_cycle_options.xml
index 9ee7fc3ead..dd74505239 100644
--- a/indra/newview/skins/default/xui/es/floater_day_cycle_options.xml
+++ b/indra/newview/skins/default/xui/es/floater_day_cycle_options.xml
@@ -57,9 +57,9 @@
<text name="WL12amHash2">
|
</text>
- <button font="SansSerifSmall" width="96" left="546" label="Añadir un punto" label_selected="Añadir un punto" name="WLAddKey"/>
- <button font="SansSerifSmall" width="96" left="546" label="Quitar un punto" label_selected="Quitar un punto" name="WLDeleteKey"/>
- <text font="SansSerifSmall" name="WLCurKeyFrameText" width="190">
+ <button label="Añadir un punto" label_selected="Añadir un punto" name="WLAddKey"/>
+ <button label="Quitar un punto" label_selected="Quitar un punto" name="WLDeleteKey"/>
+ <text name="WLCurKeyFrameText">
Configuración del fotograma clave:
</text>
<text name="WLCurKeyTimeText">
@@ -86,9 +86,9 @@
</text>
<button label="Probar" label_selected="Probar" name="WLAnimSky"/>
<button label="Parar" label_selected="Parar" name="WLStopAnimSky"/>
- <button width="150" font="SansSerifSmall" label="Usar el horario del estado" label_selected="Ir al horario del estado" name="WLUseLindenTime"/>
- <button left="440" width="180" font="SansSerifSmall" label="Guardar este tipo de día" label_selected="Guardar este tipo de día" name="WLSaveDayCycle"/>
- <button left="440" width="180" font="SansSerifSmall" label="Cargar y probar un tipo de día" label_selected="Cargar y probar un tipo de día" name="WLLoadDayCycle"/>
+ <button label="Usar el horario del estado" label_selected="Ir al horario del estado" name="WLUseLindenTime"/>
+ <button label="Guardar este tipo de día" label_selected="Guardar este tipo de día" name="WLSaveDayCycle"/>
+ <button label="Cargar y probar un tipo de día" label_selected="Cargar y probar un tipo de día" name="WLLoadDayCycle"/>
</panel>
</tab_container>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_env_settings.xml b/indra/newview/skins/default/xui/es/floater_env_settings.xml
index 65710fc5ed..8b9bfe7362 100644
--- a/indra/newview/skins/default/xui/es/floater_env_settings.xml
+++ b/indra/newview/skins/default/xui/es/floater_env_settings.xml
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Environment Editor Floater" title="Editor del entorno">
<text name="EnvTimeText">
- Duración de
-un día
+ Duración de un día
</text>
<text name="EnvTimeText2">
12:00 PM
@@ -11,16 +10,14 @@ un día
Nubosidad
</text>
<text name="EnvWaterColorText">
- Color del
-agua
+ Color del agua
</text>
<color_swatch label="" name="EnvWaterColor" tool_tip="Pulse para abrir el selector de color"/>
<text name="EnvWaterFogText">
- Claridad del
-agua
+ Claridad del agua
</text>
- <button bottom="-144" label="Usar el horario del estado" name="EnvUseEstateTimeButton" width="155"/>
- <button label="Cielo avanzado" name="EnvAdvancedSkyButton" width="155" left="167" />
- <button label="Agua avanzada" name="EnvAdvancedWaterButton" width="155" left="326"/>
+ <button label="Usar el horario del estado" name="EnvUseEstateTimeButton"/>
+ <button label="Cielo avanzado" name="EnvAdvancedSkyButton"/>
+ <button label="Agua avanzada" name="EnvAdvancedWaterButton"/>
<button label="?" name="EnvSettingsHelpButton"/>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_gesture.xml b/indra/newview/skins/default/xui/es/floater_gesture.xml
index e7f1a7aca2..4f19286d01 100644
--- a/indra/newview/skins/default/xui/es/floater_gesture.xml
+++ b/indra/newview/skins/default/xui/es/floater_gesture.xml
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="gestures" title="Gestos disponibles">
<text name="help_label">
- Pulse dos veces en un gesto para reproducir las animaciones
-y sonidos.
+ Pulse dos veces en un gesto para reproducir las animaciones y sonidos.
</text>
- <scroll_list bottom_delta="-385" height="360" name="gesture_list">
+ <scroll_list name="gesture_list">
<column label="Botón" name="trigger"/>
<column label="Tecla" name="shortcut"/>
<column label="Nombre" name="name"/>
diff --git a/indra/newview/skins/default/xui/es/floater_inspect.xml b/indra/newview/skins/default/xui/es/floater_inspect.xml
index 026081bc04..7a9f76de0f 100644
--- a/indra/newview/skins/default/xui/es/floater_inspect.xml
+++ b/indra/newview/skins/default/xui/es/floater_inspect.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="inspect" title="Examinar objetos" min_width="450">
+<floater name="inspect" title="Examinar objetos">
<scroll_list name="object_list" tool_tip="Seleccione un objeto de esta lista para realzarlo en el mundo">
<column label="Nombre del objeto" name="object_name"/>
- <column label="Propietario" name="owner_name"/>
- <column label="Creador" name="creator_name"/>
+ <column label="Nombre del propietario" name="owner_name"/>
+ <column label="Nombre del creador" name="creator_name"/>
<column label="Fecha de creación" name="creation_date"/>
</scroll_list>
- <button width="185" label="Ver el perfil del propietario..." label_selected="" name="button owner" tool_tip="Ver el perfil del propietario del objeto realzado"/>
- <button width="165" left="205" label="Ver el perfil del creador..." label_selected="" name="button creator" tool_tip="Ver el perfil del creador original del objeto realzado"/>
+ <button label="Ver el perfil del propietario..." label_selected="" name="button owner" tool_tip="Ver el perfil del propietario del objeto realzado"/>
+ <button label="Ver el perfil del creadir..." label_selected="" name="button creator" tool_tip="Ver el perfil del creador original del objeto realzado"/>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/es/floater_inventory_view_finder.xml
index d0283afa38..d341de17e9 100644
--- a/indra/newview/skins/default/xui/es/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/es/floater_inventory_view_finder.xml
@@ -11,14 +11,14 @@
<check_box label="Sonidos" name="check_sound"/>
<check_box label="Texturas" name="check_texture"/>
<check_box label="Fotos" name="check_snapshot"/>
- <button label="Todo" label_selected="Todo" name="All" width="70"/>
- <button label="Nada" label_selected="Nada" name="None" width="70" bottom_delta="0" left="83"/>
- <check_box label="Mostrar siempre las&#10;carpetas" name="check_show_empty"/>
- <check_box label="Desde el fin de sesión" name="check_since_logoff" bottom_delta="-36"/>
+ <button label="Todo" label_selected="Todo" name="All"/>
+ <button label="Nada" label_selected="Nada" name="None"/>
+ <check_box label="Mostrar siempre las carpetas" name="check_show_empty"/>
+ <check_box label="Desde el fin de sesión" name="check_since_logoff"/>
<text length="1" name="- OR -" type="string">
- O -
</text>
<spinner label="horas atrás" name="spin_hours_ago"/>
<spinner label="días atrás" name="spin_days_ago"/>
- <button label="Cerrar" label_selected="Cerrar" name="Close" bottom_delta="-30"/>
+ <button label="Cerrar" label_selected="Cerrar" name="Close"/>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_lagmeter.xml b/indra/newview/skins/default/xui/es/floater_lagmeter.xml
index 1af0bb065c..7d499750de 100644
--- a/indra/newview/skins/default/xui/es/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/es/floater_lagmeter.xml
@@ -4,26 +4,23 @@
<text name="client">
Cliente:
</text>
- <text name="client_text" font="SansSerifSmall">
+ <text name="client_text">
Normal
</text>
- <text left="30" name="client_lag_cause" right="-10" />
<button label="" label_selected="" name="network_lagmeter" tool_tip="Estado del lag de la red"/>
<text name="network">
Red:
</text>
- <text name="network_text" font="SansSerifSmall">
+ <text name="network_text">
Normal
</text>
- <text left="30" name="network_lag_cause" right="-10" />
<button label="" label_selected="" name="server_lagmeter" tool_tip="Estado del lag del servidor"/>
<text name="server">
Servidor:
</text>
- <text name="server_text" font="SansSerifSmall">
+ <text name="server_text">
Normal
</text>
- <text left="30" name="server_lag_cause" right="-32" />
<button label="?" name="server_help"/>
<button label="&gt;&gt;" name="minimize"/>
<string name="max_title_msg">
@@ -120,10 +117,10 @@
20
</string>
<string name="server_frame_time_critical_msg">
- Frecuencia (framerate) por debajo de [SERVER_FRAME_RATE_CRITICAL]
+ Frecuencia del simulador -framerate- por debajo de [SERVER_FRAME_RATE_CRITICAL]
</string>
<string name="server_frame_time_warning_msg">
- Frecuencia (framerate) entre [SERVER_FRAME_RATE_CRITICAL] y [SERVER_FRAME_RATE_WARNING]
+ Frecuencia del simulador -framerate- entre [SERVER_FRAME_RATE_CRITICAL] y [SERVER_FRAME_RATE_WARNING]
</string>
<string name="server_frame_time_normal_msg">
Normal
diff --git a/indra/newview/skins/default/xui/es/floater_land_holdings.xml b/indra/newview/skins/default/xui/es/floater_land_holdings.xml
index 5df319905d..5c08b04055 100644
--- a/indra/newview/skins/default/xui/es/floater_land_holdings.xml
+++ b/indra/newview/skins/default/xui/es/floater_land_holdings.xml
@@ -8,7 +8,7 @@
<column label="" name="hidden"/>
</scroll_list>
<button label="Teleportar" label_selected="Teleportar" name="Teleport" tool_tip="Teleportar al centro de este terreno."/>
- <button width="130" label="Mostrar en el mapa" label_selected="Mostrar en el mapa" name="Show on Map" tool_tip="Mostrar este terreno en el mapa del mundo."/>
+ <button label="Mostrar en el mapa" label_selected="Mostrar en el mapa" name="Show on Map" tool_tip="Mostrar este terreno en el mapa del mundo."/>
<text name="contrib_label">
Contribuciones a sus grupos:
</text>
diff --git a/indra/newview/skins/default/xui/es/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/es/floater_live_lsleditor.xml
index 226c3482af..00a6995575 100644
--- a/indra/newview/skins/default/xui/es/floater_live_lsleditor.xml
+++ b/indra/newview/skins/default/xui/es/floater_live_lsleditor.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="script ed float" title="Script: script nuevo">
<button label="Reiniciar" label_selected="Reiniciar" name="Reset"/>
- <check_box label="Ejecutándose" name="running" left="4"/>
- <check_box label="Mono" name="mono" left="106"/>
+ <check_box label="Ejecutándose" name="running"/>
+ <check_box label="Mono" name="mono"/>
<string name="not_allowed">
No está autorizado para ver este script.
</string>
diff --git a/indra/newview/skins/default/xui/es/floater_lsl_guide.xml b/indra/newview/skins/default/xui/es/floater_lsl_guide.xml
index 859a2d3812..c1e431f274 100644
--- a/indra/newview/skins/default/xui/es/floater_lsl_guide.xml
+++ b/indra/newview/skins/default/xui/es/floater_lsl_guide.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="script ed float" title="Wiki de LSL">
<check_box label="Seguir al cursor" name="lock_check"/>
- <combo_box label="Bloquear" name="history_combo" left_delta="120" width="70"/>
- <button label="Atrás" name="back_btn" left_delta="75"/>
+ <combo_box label="Bloquear" name="history_combo"/>
+ <button label="Atrás" name="back_btn"/>
<button label="Adelante" name="fwd_btn"/>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_media_browser.xml b/indra/newview/skins/default/xui/es/floater_media_browser.xml
index 79c8980c02..9b60b28537 100644
--- a/indra/newview/skins/default/xui/es/floater_media_browser.xml
+++ b/indra/newview/skins/default/xui/es/floater_media_browser.xml
@@ -2,11 +2,10 @@
<floater name="floater_about" title="Navegador">
<layout_stack name="stack1">
<layout_panel name="nav_controls">
- <button label="Atrás" name="back" width="75"/>
- <button label="Adelante" name="forward" left_delta="75" width="70"/>
- <button label="Actualizar" name="reload" left_delta="75"/>
- <combo_box left_delta="75" name="address" width="510"/>
- <button label="Ir" name="go" left_delta="515"/>
+ <button label="Atrás" name="back"/>
+ <button label="Adelante" name="forward"/>
+ <button label="Actualizar" name="reload"/>
+ <button label="Ir" name="go"/>
</layout_panel>
<layout_panel name="parcel_owner_controls">
<button label="Enviar a la parcela la URL actual" name="assign"/>
diff --git a/indra/newview/skins/default/xui/es/floater_mute_object.xml b/indra/newview/skins/default/xui/es/floater_mute_object.xml
index 0cf38c09ee..a2b87b67ab 100644
--- a/indra/newview/skins/default/xui/es/floater_mute_object.xml
+++ b/indra/newview/skins/default/xui/es/floater_mute_object.xml
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="mute by name" title="Ignorar un objeto según su nombre">
- <text name="message" bottom_delta="-40">
- Ignorar según el nombre sólo afecta al chat y los MI del
-objeto, no a sus sonidos.
+ <text name="message">
+ Ignorar según el nombre sólo afecta al chat y los MI del objeto, no a sus sonidos.
Debe escribir exactamente el nombre del objeto.
</text>
- <line_editor name="object_name" bottom_delta="-58">
+ <line_editor name="object_name">
Nombre del objeto
</line_editor>
<button label="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/es/floater_pay.xml b/indra/newview/skins/default/xui/es/floater_pay.xml
index 136e6a6f01..9770e90bf4 100644
--- a/indra/newview/skins/default/xui/es/floater_pay.xml
+++ b/indra/newview/skins/default/xui/es/floater_pay.xml
@@ -6,17 +6,16 @@
<button label="20 L$" label_selected="20 L$" name="fastpay 20"/>
<button label="Pagar" label_selected="Pagar" name="pay btn"/>
<button label="Cancelar" label_selected="Cancelar" name="cancel btn"/>
- <text length="1" name="payee_label" type="string" left="5" width="105">
+ <text length="1" name="payee_label" type="string">
Pagar al residente:
</text>
- <text length="1" name="payee_name" type="string" left="115">
+ <text length="1" name="payee_name" type="string">
[FIRST] [LAST]
</text>
- <text length="1" name="fastpay text" type="string" width="100" halign="left">
+ <text length="1" name="fastpay text" type="string">
Pago rápido:
</text>
- <text length="1" name="amount text" type="string" left="4" >
+ <text length="1" name="amount text" type="string">
Cantidad:
</text>
- <line_editor left="60" name="amount" width="55"/>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_pay_object.xml b/indra/newview/skins/default/xui/es/floater_pay_object.xml
index 770ecc6ae5..86b3af76f8 100644
--- a/indra/newview/skins/default/xui/es/floater_pay_object.xml
+++ b/indra/newview/skins/default/xui/es/floater_pay_object.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Give Money" title="">
- <text length="1" name="payee_group" type="string" left="5" width="110">
+ <text length="1" name="payee_group" type="string">
Pagar al grupo:
</text>
- <text length="1" name="payee_resident" type="string" left="5" width="110">
+ <text length="1" name="payee_resident" type="string">
Pagar al residente:
</text>
- <text length="1" name="payee_name" type="string" left="120" width="180">
+ <text length="1" name="payee_name" type="string">
[FIRST] [LAST]
</text>
- <text length="1" name="object_name_label" type="string" left="5" width="110">
+ <text length="1" name="object_name_label" type="string">
A través del objeto:
</text>
- <text length="1" name="object_name_text" type="string" left="120" width="180">
+ <text length="1" name="object_name_text" type="string">
...
</text>
<text length="1" name="fastpay text" type="string">
diff --git a/indra/newview/skins/default/xui/es/floater_preferences.xml b/indra/newview/skins/default/xui/es/floater_preferences.xml
index df7fc93dd9..56e99e2285 100644
--- a/indra/newview/skins/default/xui/es/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/es/floater_preferences.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Preferences" title="Preferencias" min_width="350" width="646">
+<floater name="Preferences" title="Preferencias">
<button label="OK" label_selected="OK" name="OK"/>
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
<button label="Aplicar" label_selected="Aplicar" name="Apply"/>
- <button label="Acerca de..." label_selected="Acerca de..." name="About..." />
+ <button label="Acerca de" label_selected="Acerca de" name="About..."/>
<button label="Ayuda" label_selected="Ayuda" name="Help"/>
- <tab_container name="pref core" tab_width="146" width="646" />
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_preview_animation.xml b/indra/newview/skins/default/xui/es/floater_preview_animation.xml
index 0f2762022a..cea2273089 100644
--- a/indra/newview/skins/default/xui/es/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/es/floater_preview_animation.xml
@@ -3,6 +3,6 @@
<text length="1" name="desc txt" type="string">
Descripción:
</text>
- <button left="12" width="142" label="Ejecutarla en el mundo" label_selected="Parar" name="Anim play btn" tool_tip="Ejecutar esta animación de modo que puedan verla los demás."/>
- <button left="156" width="136" label="Ejecutarla para usted" label_selected="Parar" name="Anim audition btn" tool_tip="Ejecutar esta animación de modo que sólo la vea usted."/>
+ <button label="Ejecutarla en el mundo" label_selected="Parar" name="Anim play btn" tool_tip="Ejecutar esta animación de modo que puedan verla los demás."/>
+ <button label="Ejecutarla para usted" label_selected="Parar" name="Anim audition btn" tool_tip="Ejecutar esta animación de modo que sólo la vea usted."/>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_script_search.xml b/indra/newview/skins/default/xui/es/floater_script_search.xml
index dc05370c2b..9cabed9e36 100644
--- a/indra/newview/skins/default/xui/es/floater_script_search.xml
+++ b/indra/newview/skins/default/xui/es/floater_script_search.xml
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="script search" title="Buscar en el script" width="320">
- <check_box label="Indiferente mays./mins." name="case_text" left="75"/>
- <button label="Buscar" label_selected="Buscar" name="search_btn" width="85"/>
- <button label="Reemplazar" label_selected="Reemplazar" name="replace_btn" left="100" width="85"/>
- <button label="Reemplazar todos" label_selected="Reemplazar todos" name="replace_all_btn" left="190" width="122"/>
- <text length="1" name="txt" type="string" width="65">
+<floater name="script search" title="Buscar en el script">
+ <check_box label="Indiferente mays./mins." name="case_text"/>
+ <button label="Buscar" label_selected="Buscar" name="search_btn"/>
+ <button label="Reemplazar" label_selected="Reemplazar" name="replace_btn"/>
+ <button label="Reemplazar todos" label_selected="Reemplazar todos" name="replace_all_btn"/>
+ <text length="1" name="txt" type="string">
Buscar
</text>
- <text length="1" name="txt2" type="string" width="65">
+ <text length="1" name="txt2" type="string">
Reemplazar
</text>
- <line_editor left="75" name="search_text" width="240" />
- <line_editor left="75" name="replace_text" width="240" />
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_select_key.xml b/indra/newview/skins/default/xui/es/floater_select_key.xml
index 9c889df63a..132985864c 100644
--- a/indra/newview/skins/default/xui/es/floater_select_key.xml
+++ b/indra/newview/skins/default/xui/es/floater_select_key.xml
@@ -2,6 +2,6 @@
<floater name="modal container" title="">
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
<text name="Save item as:">
- Pulse una tecla para seleccionarla
+ Pulse una tecla para seleccionar
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_telehub.xml b/indra/newview/skins/default/xui/es/floater_telehub.xml
index 74084e9db9..921577751a 100644
--- a/indra/newview/skins/default/xui/es/floater_telehub.xml
+++ b/indra/newview/skins/default/xui/es/floater_telehub.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="telehub" title="Punto de Teleporte" min_height="310" height="310">
+<floater name="telehub" title="Punto de Teleporte">
<text name="status_text_connected">
Punto de Teleporte conectado al objeto [OBJECT]
</text>
@@ -9,24 +9,20 @@
<text name="help_text_connected">
Para quitar, pulse Desconectar.
</text>
- <text name="help_text_not_connected" height="38" bottom_delta="-18">
- Seleccione el objeto y pulse Conectar el Punto
-de Teleporte.
+ <text name="help_text_not_connected">
+ Seleccione el objeto y pulse Conectar el Punto de Teleporte.
</text>
<button label="Conectar el Punto de Teleporte" name="connect_btn"/>
<button label="Desconectar" name="disconnect_btn"/>
<text name="spawn_points_text">
- Sucursales (posiciónes, no objetos):
+ Spawn Points (positions, not objects):
</text>
<button label="Añadir sucursales" name="add_spawn_point_btn"/>
<button label="Quitar sucursales" name="remove_spawn_point_btn"/>
<text name="spawn_point_help">
- Seleccione el objeto y pulse Añadir para
-especificar la posición.
+ Seleccione el objeto y pulse Añadir para especificar la posición.
Hecho eso, puede mover o borrar el objeto.
-Las posiciones son relativas al centro del
-Punto de Teleporte.
-Seleccione un ítem de la lista para mostrar su
-posición en el mundo.
+Las posiciones son relativas al centro del Punto de Teleporte.
+Seleccione un ítem de la lista para mostrar su posición en el mundo.
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml
index 477d546806..8c3882f0c8 100644
--- a/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml
@@ -9,8 +9,8 @@
<text length="1" name="unknown" type="string">
Dimensiones: [DIMENSIONS]
</text>
- <button label="Por defecto" label_selected="Por defecto" name="Default" width="84"/>
- <button label="Ninguna" label_selected="Ninguna" name="None" left="90"/>
+ <button label="Por defecto" label_selected="Por defecto" name="Default"/>
+ <button label="Ninguna" label_selected="Ninguna" name="None"/>
<button label="Blanca" label_selected="Blanca" name="Blank"/>
<check_box label="Ver las carpetas" name="show_folders_check"/>
<search_editor label="Escriba aquí para buscar una" name="inventory search editor"/>
diff --git a/indra/newview/skins/default/xui/es/floater_tools.xml b/indra/newview/skins/default/xui/es/floater_tools.xml
index e6ff6b0fa5..15c66c8366 100644
--- a/indra/newview/skins/default/xui/es/floater_tools.xml
+++ b/indra/newview/skins/default/xui/es/floater_tools.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="toolbox floater" title="" short_title="Construir" width="288">
+<floater name="toolbox floater" title="">
<button label="" label_selected="" name="button focus" tool_tip="Visión"/>
<button label="" label_selected="" name="button move" tool_tip="Mover"/>
<button label="" label_selected="" name="button edit" tool_tip="Editar"/>
@@ -19,7 +19,7 @@
<text name="text ruler mode">
Ajuste:
</text>
- <combo_box name="combobox grid mode" width="82">
+ <combo_box name="combobox grid mode">
<combo_item name="World">
Mundo
</combo_item>
@@ -34,8 +34,8 @@
<check_box label="Estirar las texturas" name="checkbox stretch textures"/>
<check_box label="Usar la cuadrícula" name="checkbox snap to grid"/>
<button label="Opciones..." label_selected="Opciones..." name="Options..."/>
- <text name="text status" width="280">
- Arrastrar para mover, Mayús.+arrastrar para copiar
+ <text name="text status">
+ Arrastrar para mover, arrastrar + Mayús. para copiar
</text>
<button label="" label_selected="" name="ToolCube" tool_tip="Cubo"/>
<button label="" label_selected="" name="ToolPrism" tool_tip="Prisma"/>
@@ -63,7 +63,7 @@
<check_box label="Suavizar" name="radio smooth"/>
<check_box label="Escarpar" name="radio noise"/>
<check_box label="Restablecer" name="radio revert"/>
- <button label="Aplicar" label_selected="Aplicar" name="button apply to selection" tool_tip="Modificar el terreno seleccionado" left="146"/>
+ <button label="Aplicar" label_selected="Aplicar" name="button apply to selection" tool_tip="Modificar el terreno seleccionado"/>
<text name="Bulldozer:">
Bulldozer:
</text>
@@ -73,13 +73,13 @@
<text name="Strength:">
Fuerza
</text>
- <text name="obj_count" left="134">
+ <text name="obj_count">
Objetos seleccionados: [COUNT]
</text>
- <text name="prim_count" left="134">
+ <text name="prim_count">
primitivas: [COUNT]
</text>
- <tab_container name="Object Info Tabs" tab_max_width="62" tab_min_width="30" width="288">
+ <tab_container name="Object Info Tabs">
<panel label="General" name="General">
<text name="Name:">
Nombre:
@@ -144,12 +144,12 @@
El próximo propietario puede:
</text>
<check_box label="Modificarlo" name="checkbox next owner can modify"/>
- <check_box label="Copiarlo" name="checkbox next owner can copy" left_delta="80"/>
- <check_box label="Revenderlo/Darlo" name="checkbox next owner can transfer" left_delta="67"/>
- <text name="label click action" width="180">
+ <check_box label="Copiarlo" name="checkbox next owner can copy"/>
+ <check_box label="Revenderlo/Darlo" name="checkbox next owner can transfer"/>
+ <text name="label click action">
Al pulsarlo con el botón izquierdo:
</text>
- <combo_box name="clickaction" width="192">
+ <combo_box name="clickaction">
<combo_item name="Touch/grab(default)">
Tocar/Agarrar (por defecto)
</combo_item>
@@ -206,7 +206,7 @@
Debe seleccionar todo el objeto para definir los permisos.
</string>
<string name="Cost Default">
- Precio: L$
+ Precio: L$
</string>
<string name="Cost Total">
Precio total: L$
@@ -223,7 +223,7 @@
</panel>
<panel label="Objeto" name="Object">
<text name="select_single">
- Seleccione un sólo prim para editarlo.
+ Seleccione un único prim para editar los parámetros.
</text>
<text name="edit_object">
Modificar los parámetros del objeto:
@@ -277,7 +277,7 @@
</combo_item>
</combo_box>
<text name="label basetype">
- Tipo de objeto a construir
+ Tipo de objeto para construir
</text>
<combo_box name="comboBaseType">
<combo_item name="Box">
@@ -334,7 +334,7 @@
</combo_item>
</combo_box>
<text name="text twist">
- Torsión: Inicio y Fin
+ La torsión: Inicio y Fin
</text>
<spinner label="I" name="Twist Begin"/>
<spinner label="F" name="Twist End"/>
@@ -397,9 +397,9 @@
</combo_item>
</combo_box>
</panel>
- <panel label="Caracter." name="Features">
+ <panel label="Características" name="Features">
<text name="select_single">
- Seleccione un sólo prim para editarlo.
+ Seleccione un sólo prim para editar las características.
</text>
<text name="edit_object">
Editar las características del objeto:
@@ -431,11 +431,11 @@
<text name="glow label">
Resplandor
</text>
- <check_box label="Brillo al &#10;máximo" name="checkbox fullbright" bottom_delta="-21"/>
+ <check_box label="Brillo al máximo" name="checkbox fullbright"/>
<text name="tex gen">
Detallado
</text>
- <combo_box name="combobox texgen" width="86">
+ <combo_box name="combobox texgen">
<combo_item name="Default">
Por defecto
</combo_item>
@@ -530,29 +530,27 @@
Rotación (grados)
</text>
<string name="string repeats per meter">
- Repeticiones por m.
+ Repeticiones por metro
</string>
<string name="string repeats per face">
Repeticiones por cara
</string>
<text name="rpt">
- Repeticiones por m.
+ Repeticiones por metro
</text>
- <spinner left="118" name="TexRot" width="62" />
- <spinner left="118" name="rptctrl" width="62" />
- <button label="Aplicar" label_selected="Aplicar" name="button apply" left_delta="72"/>
+ <button label="Aplicar" label_selected="Aplicar" name="button apply"/>
<text name="tex offset">
Desplazar
</text>
<spinner label="Horizontal (U)" name="TexOffsetU"/>
<spinner label="Vertical (V)" name="TexOffsetV"/>
- <text name="textbox autofix" width="180">
+ <text name="textbox autofix">
Centrar la textura para los media
(primero debe subirla)
</text>
- <button label="Alinear" label_selected="Alinear" name="button align" left="180"/>
+ <button label="Alinear" label_selected="Alinear" name="button align"/>
</panel>
- <panel label="Contenido " name="Contents">
+ <panel label="Contenido" name="Contents">
<button label="Script nuevo" label_selected="Script nuevo" name="button new script"/>
<button label="Permisos..." name="button permissions"/>
</panel>
@@ -567,19 +565,19 @@
<text name="label_area">
Superficie: [AREA] m²
</text>
- <button label="Acerca del terreno..." label_selected="Acerca del terreno..." name="button about land" width="140"/>
+ <button label="Acerca del terreno..." label_selected="Acerca del terreno..." name="button about land"/>
<check_box label="Mostrar los propietarios" name="checkbox show owners" tool_tip="El color de las parcelas es según su propietario"/>
- <button label="?" label_selected="?" name="button show owners help" left_delta="150"/>
+ <button label="?" label_selected="?" name="button show owners help"/>
<text name="label_parcel_modify">
Modificar la parcela
</text>
- <button label="Subdividir..." label_selected="Subdividir..." name="button subdivide land" width="140"/>
- <button label="Unir..." label_selected="Unir..." name="button join land" width="140"/>
+ <button label="Subdividir..." label_selected="Subdividir..." name="button subdivide land"/>
+ <button label="Unir..." label_selected="Unir..." name="button join land"/>
<text name="label_parcel_trans">
Transacciones de terreno
</text>
- <button label="Comprar terreno..." label_selected="Comprar terreno..." name="button buy land" width="140"/>
- <button label="Abandonar el terreno..." label_selected="Abandonar el terreno..." name="button abandon land" width="140"/>
+ <button label="Comprar terreno..." label_selected="Comprar terreno..." name="button buy land"/>
+ <button label="Abandonar el terreno..." label_selected="Abandonar el terreno..." name="button abandon land"/>
</panel>
<string name="status_rotate">
Arrastre las bandas de color para girar el objeto
@@ -588,7 +586,7 @@
Pulse y arrastre para estirar el lado seleccionado
</string>
<string name="status_move">
- Arrastrar para mover, Mayús.+arrastrar para copiar
+ Arrastrar para mover, arrastrar + Mayús. para copiar
</string>
<string name="status_modifyland">
Mantenga pulsado para modificar el terreno
diff --git a/indra/newview/skins/default/xui/es/floater_top_objects.xml b/indra/newview/skins/default/xui/es/floater_top_objects.xml
index 95f2c39d42..ce0c22062b 100644
--- a/indra/newview/skins/default/xui/es/floater_top_objects.xml
+++ b/indra/newview/skins/default/xui/es/floater_top_objects.xml
@@ -11,26 +11,23 @@
<column label="Tiempo" name="time"/>
<column label="Tiempo en Mono" name="mono_time"/>
</scroll_list>
- <line_editor font="SansSerifSmall" left="140" name="id_editor" width="280"/>
- <line_editor font="SansSerifSmall" left="140" name="object_name_editor" width="280"/>
- <line_editor font="SansSerifSmall" left="140" name="owner_name_editor" width="280"/>
<text name="id_text">
ID del objeto:
</text>
- <button label="Mostrar la baliza" name="show_beacon_btn" width="115"/>
+ <button label="Mostrar la baliza" name="show_beacon_btn"/>
<text name="obj_name_text">
Nombre del objeto:
</text>
- <button label="Filtro" name="filter_object_btn" width="115"/>
- <text name="owner_name_text" width="130">
+ <button label="Filtro" name="filter_object_btn"/>
+ <text name="owner_name_text">
Nombre del propietario:
</text>
- <button label="Filtro" name="filter_owner_btn" width="115"/>
- <button label="Devolver lo seleccionado" name="return_selected_btn" width="170"/>
- <button label="Devolver todo" name="return_all_btn" left="190"/>
- <button label="Desactivar lo seleccionado" name="disable_selected_btn" width="170"/>
- <button label="Desactivar todo" name="disable_all_btn" left="190"/>
- <button label="Actualizar" name="refresh_btn" width="115"/>
+ <button label="Filtro" name="filter_owner_btn"/>
+ <button label="Devolver lo seleccionado" name="return_selected_btn"/>
+ <button label="Devolver todo" name="return_all_btn"/>
+ <button label="Desactivar lo seleccionado" name="disable_selected_btn"/>
+ <button label="Desactivar todo" name="disable_all_btn"/>
+ <button label="Actualizar" name="refresh_btn"/>
<string name="top_scripts_title">
Scripts según su uso
</string>
diff --git a/indra/newview/skins/default/xui/es/floater_url_entry.xml b/indra/newview/skins/default/xui/es/floater_url_entry.xml
index f7c85ff068..abdd69b090 100644
--- a/indra/newview/skins/default/xui/es/floater_url_entry.xml
+++ b/indra/newview/skins/default/xui/es/floater_url_entry.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="url_entry" title="">
<text name="media_label">
- URL del media:
+ URL para media:
</text>
- <combo_box left="106" name="media_entry" width="354" />
<button label="OK" name="ok_btn"/>
<button label="Cancelar" name="cancel_btn"/>
<button label="Limpiar" name="clear_btn"/>
diff --git a/indra/newview/skins/default/xui/es/floater_water.xml b/indra/newview/skins/default/xui/es/floater_water.xml
index 934fc7882b..5a759af5ff 100644
--- a/indra/newview/skins/default/xui/es/floater_water.xml
+++ b/indra/newview/skins/default/xui/es/floater_water.xml
@@ -11,20 +11,20 @@
<text name="BHText">
Color del agua
</text>
- <button label="?" name="WaterFogColorHelp" left="175" />
+ <button label="?" name="WaterFogColorHelp"/>
<color_swatch label="" name="WaterFogColor" tool_tip="Pulse para abrir el selector de color"/>
<text name="WaterFogDensText">
Transparencia
</text>
- <button label="?" name="WaterFogDensityHelp" left="175" />
+ <button label="?" name="WaterFogDensityHelp"/>
<text name="WaterUnderWaterFogModText">
Modificar la claridad del agua
</text>
- <button label="?" name="WaterUnderWaterFogModHelp" left="175" />
+ <button label="?" name="WaterUnderWaterFogModHelp"/>
<text name="BDensText">
Tamaño de las ondulaciones
</text>
- <button label="?" name="WaterNormalScaleHelp" left="405"/>
+ <button label="?" name="WaterNormalScaleHelp"/>
<text name="BHText2">
1
</text>
@@ -37,29 +37,29 @@
<text name="HDText">
Escala de Fresnel
</text>
- <button label="?" name="WaterFresnelScaleHelp" left="405"/>
+ <button label="?" name="WaterFresnelScaleHelp"/>
<text name="FresnelOffsetText">
Coeficiente de reflexión
</text>
- <button label="?" name="WaterFresnelOffsetHelp" left="405"/>
+ <button label="?" name="WaterFresnelOffsetHelp"/>
<text name="DensMultText">
Refracción de la superficie
</text>
- <button label="?" name="WaterScaleAboveHelp" left="640"/>
+ <button label="?" name="WaterScaleAboveHelp"/>
<text name="WaterScaleBelowText">
Refracción bajo la superficie
</text>
- <button label="?" name="WaterScaleBelowHelp" left="640"/>
+ <button label="?" name="WaterScaleBelowHelp"/>
<text name="MaxAltText">
Desenfoque
</text>
- <button label="?" name="WaterBlurMultiplierHelp" left="640"/>
+ <button label="?" name="WaterBlurMultiplierHelp"/>
</panel>
<panel label="Imagen" name="Waves">
<text name="BHText">
Sentido de la onda grande
</text>
- <button label="?" name="WaterWave1Help" left="170"/>
+ <button label="?" name="WaterWave1Help"/>
<text name="WaterWave1DirXText">
X
</text>
@@ -69,7 +69,7 @@
<text name="BHText2">
Sentido de la onda pequeña
</text>
- <button label="?" name="WaterWave2Help" left="170"/>
+ <button label="?" name="WaterWave2Help"/>
<text name="WaterWave2DirXText">
X
</text>
diff --git a/indra/newview/skins/default/xui/es/floater_windlight_options.xml b/indra/newview/skins/default/xui/es/floater_windlight_options.xml
index e240dea0b5..79b70d4d59 100644
--- a/indra/newview/skins/default/xui/es/floater_windlight_options.xml
+++ b/indra/newview/skins/default/xui/es/floater_windlight_options.xml
@@ -6,7 +6,7 @@
<button label="Nuevo" label_selected="Nuevo" name="WLNewPreset"/>
<button label="Guardar" label_selected="Guardar" name="WLSavePreset"/>
<button label="Borrar" label_selected="Borrar" name="WLDeletePreset"/>
- <button font="SansSerifSmall" width="150" left_delta="90" label="Editor del ciclo de un día" label_selected="Editor del ciclo de un día" name="WLDayCycleMenuButton"/>
+ <button label="Editor del ciclo de un día" label_selected="Editor del ciclo de un día" name="WLDayCycleMenuButton"/>
<tab_container name="WindLight Tabs">
<panel label="Atmósfera" name="Atmosphere">
<text name="BHText">
@@ -122,7 +122,7 @@
<text name="WLCloudColorText">
Color de las nubes
</text>
- <button label="?" name="WLCloudColorHelp" left="190" />
+ <button label="?" name="WLCloudColorHelp"/>
<text name="BHText">
R
</text>
@@ -138,7 +138,7 @@
<text name="WLCloudColorText2">
Posición/Densidad de las nubes
</text>
- <button label="?" name="WLCloudDensityHelp" left="190"/>
+ <button label="?" name="WLCloudDensityHelp"/>
<text name="BHText5">
X
</text>
@@ -156,12 +156,11 @@
Altitud de las nubes
</text>
<button label="?" name="WLCloudScaleHelp"/>
- <text name="WLCloudDetailText" font="SansSerifSmall">
- Detalle de las nubes
-(Posición/Densidad)
+ <text name="WLCloudDetailText">
+ Detalle de las nubes (Posición/Densidad)
</text>
<button label="?" name="WLCloudDetailHelp"/>
- <text name="BHText8" bottom="-113">
+ <text name="BHText8">
X
</text>
<text name="BHText9">
@@ -170,19 +169,18 @@
<text name="BHText10">
D
</text>
- <slider bottom="-127" name="WLCloudDetailX"/>
<text name="WLCloudScrollXText">
- Velocidad de X
+ Velocidad de las nubes: X
</text>
<button label="?" name="WLCloudScrollXHelp"/>
<check_box label="Bloquear" name="WLCloudLockX"/>
<text name="WLCloudScrollYText">
- Velocidad de Y
+ Velocidad de las nubes: Y
</text>
<button label="?" name="WLCloudScrollYHelp"/>
<check_box label="Bloquear" name="WLCloudLockY"/>
<check_box label="Incluir nubes clásicas" name="DrawClassicClouds"/>
- <button label="?" name="WLClassicCloudsHelp" left="618"/>
+ <button label="?" name="WLClassicCloudsHelp"/>
</panel>
</tab_container>
<string name="WLDefaultSkyNames">
diff --git a/indra/newview/skins/default/xui/es/panel_group_general.xml b/indra/newview/skins/default/xui/es/panel_group_general.xml
index 68245ffb70..e5fd4b3aae 100644
--- a/indra/newview/skins/default/xui/es/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_general.xml
@@ -37,9 +37,9 @@ Ponga su ratón sobre las opciones para más información.
(los propietarios aparecen en negrilla)
</text>
<name_list name="visible_members">
- <column label="Nombre del miembro" name="name" relwidth="0.40"/>
- <column label="Etiqueta" name="title" relwidth="0.25"/>
- <column label="Última conexión" name="online" relwidth="0.35"/>
+ <column label="Nombre del miembro" name="name"/>
+ <column label="Etiqueta" name="title"/>
+ <column label="Última conexión" name="online"/>
</name_list>
<text name="text_group_preferences">
Preferencias del grupo
@@ -47,9 +47,9 @@ Ponga su ratón sobre las opciones para más información.
<panel name="preferences_container">
<check_box label="Mostrar en la búsqueda" name="show_in_group_list" tool_tip="Dejar que la gente vea este grupo en los resultados de la búsqueda."/>
<check_box label="Inscripción libre" name="open_enrollement" tool_tip="Definir si se admiten al grupo nuevos miembros sin que sea preciso invitárseles."/>
- <check_box label="Cuota de inscripción&#10; en L$:" name="check_enrollment_fee" tool_tip="Define si se requiere una cuota para entrar al grupo."/>
- <spinner width="60" left_delta="130" name="spin_enrollment_fee" tool_tip="Cuando está marcado &apos;Cuota de inscripción&apos;, los miembros nuevos deben pagar esta cuota para entrar al grupo."/>
- <combo_box bottom_delta="-38" width="150" name="group_mature_check" tool_tip="Establece si la información de su grupo es &apos;mature&apos;.">
+ <check_box label="Cuota de inscripción en L$" name="check_enrollment_fee" tool_tip="Define si se requiere una cuota para entrar al grupo."/>
+ <spinner name="spin_enrollment_fee" tool_tip="Cuando está marcado &apos;Cuota de inscripción&apos;, los miembros nuevos deben pagar esta cuota para entrar al grupo."/>
+ <combo_box name="group_mature_check" tool_tip="Establece si la información de su grupo es &apos;mature&apos;.">
<combo_item name="select_mature">
- Elegir Calificación -
</combo_item>
diff --git a/indra/newview/skins/default/xui/es/panel_group_invite.xml b/indra/newview/skins/default/xui/es/panel_group_invite.xml
index f66f0c473a..5f5f2c6e2e 100644
--- a/indra/newview/skins/default/xui/es/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_invite.xml
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Invitar a un miembro" name="invite_panel" width="224">
- <text name="help_text" height="72" bottom_delta="-96" width="214">
- Puede seleccionar a varios residentes
-para invitarles a su grupo. Para
-empezar, pulse &apos;Abrir el selector de
-residentes&apos;.
+<panel label="Invitar a un miembro" name="invite_panel">
+ <text name="help_text">
+ Puede seleccionar a varios residentes para
+invitarles a su grupo. Para empezar, pulse
+&apos;Abrir el selector de residentes&apos;.
</text>
- <button bottom_delta="-10" label="Abrir el selector de residentes" name="add_button" tool_tip=""/>
- <name_list height="156" bottom_delta="-160" name="invitee_list" tool_tip="Para seleccionar a varios residentes, mantenga pulsada la tecla Ctrl y vaya pulsando sus nombres."/>
- <button left_delta="-7" width="214" label="Eliminar de la lista a los seleccionados" name="remove_button" tool_tip="Elimina los residentes seleccionados de la lista de invitaciones."/>
+ <button label="Abrir el selector de residentes" name="add_button" tool_tip=""/>
+ <name_list name="invitee_list" tool_tip="Para seleccionar a varios residentes, mantenga pulsada la tecla Ctrl y vaya pulsando sus nombres."/>
+ <button label="Eliminar de la lista a los seleccionados" name="remove_button" tool_tip="Elimina los residentes seleccionados de la lista de invitaciones."/>
<text name="role_text">
Elegir qué rol asignarles:
</text>
diff --git a/indra/newview/skins/default/xui/es/panel_group_land_money.xml b/indra/newview/skins/default/xui/es/panel_group_land_money.xml
index b4ea0dbeda..32473b8133 100644
--- a/indra/newview/skins/default/xui/es/panel_group_land_money.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_land_money.xml
@@ -13,17 +13,17 @@
<string name="loading_txt">
Cargando...
</string>
- <text name="group_land_heading" width="250">
+ <text name="group_land_heading">
Terreno propiedad del grupo
</text>
<scroll_list name="group_parcel_list">
- <column label="Parcela" name="name" width="100"/>
- <column label="Región" name="location" width="100"/>
- <column label="Tipo" name="type" width="100"/>
- <column label="Superficie" name="area" width="81"/>
+ <column label="Parcela" name="name"/>
+ <column label="Región" name="location"/>
+ <column label="Tipo" name="type"/>
+ <column label="Superficie" name="area"/>
<column label="" name="hidden"/>
</scroll_list>
- <button label="Mostrar en el mapa" label_selected="Mostrar en el mapa" name="map_button" left="282" width="130"/>
+ <button label="Mostrar en el mapa" label_selected="Mostrar en el mapa" name="map_button"/>
<text name="total_contributed_land_label">
Contribución total:
</text>
@@ -52,8 +52,7 @@
m² ([AMOUNT] máx.)
</text>
<text name="group_over_limit_text">
- Los miembros del grupo deben contribuir con más créditos de terreno
-para mantener el terreno en uso.
+ Los miembros del grupo deben contribuir con más créditos de terreno para mantener el terreno en uso.
</text>
<text name="group_money_heading">
L$ del grupo
diff --git a/indra/newview/skins/default/xui/es/panel_group_notices.xml b/indra/newview/skins/default/xui/es/panel_group_notices.xml
index 1ca673332b..8215575362 100644
--- a/indra/newview/skins/default/xui/es/panel_group_notices.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_notices.xml
@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Avisos" name="notices_tab">
<text name="help_text">
- Los avisos son una forma rápida de comunicación dentro de un grupo, difundiendo un mensaje y, si se quiere, añadiéndole un ítem. Los avisos sólo los reciben los miembros del grupo cuyo rol tiene adjudicada tal habilidad. Puede desactivar los avisos en la pestaña General.
+ Los avisos son una forma rápida de comunicación dentro
+de un grupo, difundiendo un mensaje y,
+si se quiere, añadiéndole un ítem. Los avisos sólo
+los reciben los miembros del grupo cuyo rol
+tiene adjudicada tal habilidad. Puede desactivar
+los avisos en la pestaña General
</text>
<text name="no_notices_text">
No hay avisos pasados.
@@ -11,9 +16,9 @@
Archivo de avisos del grupo
</text>
<text name="lbl2">
- Los avisos se mantienen durante 14 días. Pulse en la lista de abajo el que
-quiere ver. Pulse el botón &apos;Actualizar&apos; para comprobar si se han recibido avisos
-nuevos. Las listas de avisos tienen un límite de 200 avisos por día.
+ Los avisos se mantienen durante 14 días. Pulse en la lista de abajo el que quiere ver.
+Pulse el botón &apos;Actualizar&apos; para comprobar si se han recibido avisos nuevos.
+Las listas de avisos tienen un límite de 200 avisos por día.
</text>
<scroll_list name="notice_list">
<column label="Asunto" name="subject"/>
@@ -30,8 +35,8 @@ nuevos. Las listas de avisos tienen un límite de 200 avisos por día.
Crear un aviso
</text>
<text name="lbl2">
- Para enviar un aviso, debe escribir un asunto. Puede añadir un
-ítem al aviso arrastrándolo desde su inventario a este panel.
+ Para enviar un aviso, debe escribir un asunto. Puede añadir un ítem
+al aviso arrastrándolo desde su inventario a este panel.
Los ítems anexados deben ser copiables y transferibles,
y no se puede enviar una carpeta.
</text>
diff --git a/indra/newview/skins/default/xui/es/panel_group_roles.xml b/indra/newview/skins/default/xui/es/panel_group_roles.xml
index 2739a3da5e..8cc1a4ba9d 100644
--- a/indra/newview/skins/default/xui/es/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_roles.xml
@@ -12,9 +12,7 @@
Miembros y Roles
</text>
<text name="static2">
- Los miembros del grupo tienen asignados roles con distintas capacidades.
-Estas configuraciones son fácilmente personalizables, para facilitar una
-mayor flexibilidad y organización.
+ Los miembros del grupo tienen asignados roles con distintas capacidades. Estas configuraciones son fácilmente personalizables, para facilitar una mayor flexibilidad y organización.
</text>
</panel>
<panel name="roles_header">
@@ -22,14 +20,12 @@ mayor flexibilidad y organización.
Roles
</text>
<text name="role_properties_modifiable">
- Elija un rol de los de abajo. Puede modificar su nombre, su
-descripción, y la etiqueta de los miembros.
+ Elija un rol de los de abajo. Puede modificar su nombre, su descripción, y la etiqueta de los miembros.
</text>
<text name="role_properties_not_modifiable">
- Elija un rol de los de abajo para ver sus propiedades, miembros, y qué
-capacidades tiene asignadas.
+ Elija un rol de los de abajo para ver sus propiedades, miembros, y qué capacidades tiene asignadas.
</text>
- <text bottom_delta="-28" name="role_actions_modifiable">
+ <text name="role_actions_modifiable">
También puede asignar capacidades al rol.
</text>
<text name="role_actions_not_modifiable">
@@ -41,32 +37,29 @@ capacidades tiene asignadas.
Capacidades
</text>
<text name="static2">
- Puede ver una descripción de la capacidad, y qué miembros y roles pueden
-realizarla.
+ Puede ver una descripción de la capacidad, y qué miembros y roles pueden realizarla.
</text>
</panel>
- <tab_container height="164" name="roles_tab_container">
- <panel height="148" label="Miembros" name="members_sub_tab" tool_tip="Miembros">
- <line_editor bottom="127" name="search_text"/>
- <button label="Buscar" name="search_button" width="75"/>
- <button label="Verlos todos" name="show_all_button" left_delta="80"/>
- <name_list name="member_list" bottom_delta="-105" height="104" >
+ <tab_container name="roles_tab_container">
+ <panel label="Miembros" name="members_sub_tab" tool_tip="Miembros">
+ <button label="Buscar" name="search_button"/>
+ <button label="Verlos todos" name="show_all_button"/>
+ <name_list name="member_list">
<column label="Nombre del miembro" name="name"/>
<column label="Cuotas donadas" name="donated"/>
<column label="Última conexión" name="online"/>
</name_list>
- <button label="Invitar a un nuevo miembro..." name="member_invite" width="175"/>
+ <button label="Invitar a un nuevo miembro..." name="member_invite"/>
<button label="Expulsar del grupo" name="member_eject"/>
<string name="help_text">
Puede añadir o quitar los roles asignados a los miembros.
Seleccione varios nombres manteniendo pulsada la tecla Ctrl y pulsando en cada uno de ellos.
</string>
</panel>
- <panel height="148" label="Roles" name="roles_sub_tab">
- <line_editor bottom="127" name="search_text"/>
- <button label="Buscar" name="search_button" width="75"/>
- <button label="Verlos todos" name="show_all_button" left_delta="80"/>
- <scroll_list name="role_list" bottom_delta="-104" height="104">
+ <panel label="Roles" name="roles_sub_tab">
+ <button label="Buscar" name="search_button"/>
+ <button label="Verlos todos" name="show_all_button"/>
+ <scroll_list name="role_list">
<column label="Nombre del rol" name="name"/>
<column label="Etiqueta" name="title"/>
<column label="Miembros" name="members"/>
@@ -80,11 +73,10 @@ Seleccione varios nombres manteniendo pulsada la tecla Ctrl y pulsando en cada u
Los roles de &apos;Todos&apos; y &apos;Propietarios&apos; son especiales, y no pueden eliminarse.
</string>
</panel>
- <panel height="148" label="Capacidades" name="actions_sub_tab">
- <line_editor bottom="127" name="search_text"/>
- <button label="Buscar" name="search_button" width="75"/>
- <button label="Verlos todos" name="show_all_button" left_delta="80"/>
- <scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Elija una capacidad para verla más en detalle.">
+ <panel label="Capacidades" name="actions_sub_tab">
+ <button label="Buscar" name="search_button"/>
+ <button label="Verlos todos" name="show_all_button"/>
+ <scroll_list name="action_list" tool_tip="Elija una capacidad para verla más en detalle.">
<column label="" name="icon"/>
<column label="" name="action"/>
</scroll_list>
diff --git a/indra/newview/skins/default/xui/es/panel_groups.xml b/indra/newview/skins/default/xui/es/panel_groups.xml
index 232de85522..1259ded62f 100644
--- a/indra/newview/skins/default/xui/es/panel_groups.xml
+++ b/indra/newview/skins/default/xui/es/panel_groups.xml
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="groups">
- <scroll_list bottom="50" name="group list"/>
- <text bottom="16" height="32" name="groupdesc" width="268">
- El grupo que tiene activado actualmente se
-muestra en negrilla.
+ <text name="groupdesc">
+ El grupo que tiene activado actualmente se muestra en negrilla
</text>
- <text bottom="3" name="groupcount" width="268">
+ <text name="groupcount">
Pertenece a [COUNT] grupo/s (de un máximo de [MAX]).
</text>
<button label="MI/Llamar" name="IM" tool_tip="Abrir una sesión de mensajes instantáneos"/>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_general.xml b/indra/newview/skins/default/xui/es/panel_preferences_general.xml
index 9e5cd88603..b711821e5f 100644
--- a/indra/newview/skins/default/xui/es/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_general.xml
@@ -10,15 +10,9 @@
</radio_group>
<check_box label="Ver mi posición inicial en la pantalla de inicio de sesión" name="show_location_checkbox"/>
<combo_box name="fade_out_combobox" width="166">
- <combo_item name="Never">
- Nunca
- </combo_item>
- <combo_item name="Show Temporarily">
- Mostrarlos temporalmente
- </combo_item>
- <combo_item name="Always">
- Siempre
- </combo_item>
+ <combo_box.item name="Never" label="Nunca"/>
+ <combo_box.item name="Show Temporarily" label="Mostrarlos temporalmente"/>
+ <combo_box.item name="Always" label="Siempre"/>
</combo_box>
<check_box label="Nombres de avatar en pequeño" name="small_avatar_names_checkbox"/>
<check_box label="No ver mi nombre en mi pantalla" name="show_my_name_checkbox"/>
@@ -80,49 +74,29 @@ contenido calificado:
&lt;escriba el nombre de la región&gt;
</string>
<combo_box name="crash_behavior_combobox" width="166">
- <combo_item length="1" name="Askbeforesending" type="string">
- Preguntar antes de enviar
- </combo_item>
- <combo_item length="1" name="Alwayssend" type="string">
- Enviar siempre
- </combo_item>
- <combo_item length="1" name="Neversend" type="string">
- No enviar nunca
- </combo_item>
+ <combo_box.item length="1" name="Askbeforesending" type="string" label="Preguntar antes de enviar"/>
+ <combo_box.item length="1" name="Alwayssend" type="string" label="Enviar siempre"/>
+ <combo_box.item length="1" name="Neversend" type="string" label="No enviar nunca"/>
</combo_box>
<combo_box name="language_combobox" width="166">
- <combo_item name="System Default Language">
- Predeterminado del sistema
- </combo_item>
- <combo_item length="1" name="English" type="string">
- English (Inglés)
- </combo_item>
- <combo_item name="Danish">
- Dansk (Danés) - Beta
- </combo_item>
- <combo_item length="1" name="Deutsch(German)" type="string">
- Deutsch (Alemán) - Beta
- </combo_item>
- <combo_item name="Spanish" type="string">
- Español - Beta
- </combo_item>
- <combo_item length="1" name="French" type="string">
- Français (Francés) - Beta
- </combo_item>
+ <combo_box.item name="System Default Language" label="Predeterminado del sistema"/>
+ <combo_box.item length="1" name="English" type="string" label="English (Inglés)"/>
+ <combo_box.item name="Danish" label="Dansk (Danés) - Beta"/>
+ <combo_box.item length="1" name="Deutsch(German)" type="string" label="Deutsch (Alemán) - Beta"/>
+ <combo_box.item name="Spanish" type="string" label="Español - Beta"/>
+ <combo_box.item length="1" name="French" type="string" label="Français (Francés) - Beta"/>
+ <combo_box.item name="Hungarian" label="Magyar (Húngaro) - Beta"/>
+ <combo_box.item name="Polish" label="Polski (Polaco) - Beta"/>
+ <combo_box.item name="Portugese" label="Portugués (Portugués) - Beta"/>
+ <combo_box.item length="1" name="Chinese" type="string" label="中文 (简体) (Chino) - Beta"/>
+ <combo_box.item length="1" name="(Japanese)" type="string" label="日本語 (Japonés) - Beta"/>
+ <combo_box.item length="1" name="(Korean)" type="string" label="한국어 (Coreano) - Beta"/>
<combo_item name="Italian">
Italiano - Beta
</combo_item>
- <combo_item name="Hungarian">
- Magyar (Húngaro) - Beta
- </combo_item>
<combo_item name="Dutch">
Nederlands (Neerlandés) - Beta
</combo_item>
- <combo_item name="Polish">
- Polski (Polaco) - Beta
- </combo_item>
- <combo_item name="Portugese">
- Portugués (Portugués) - Beta
</combo_item>
<combo_item name="Russian">
Русский (Ruso) - Beta
@@ -132,16 +106,6 @@ contenido calificado:
</combo_item>
<combo_item name="Ukrainian">
Українська (Ucraniano) - Beta
- </combo_item>
- <combo_item length="1" name="Chinese" type="string">
- 中文 (简体) (Chino) - Beta
- </combo_item>
- <combo_item length="1" name="(Japanese)" type="string">
- 日本語 (Japonés) - Beta
- </combo_item>
- <combo_item length="1" name="(Korean)" type="string">
- 한국어 (Coreano) - Beta
- </combo_item>
</combo_box>
<check_box label="Compartir el idioma con los objetos" name="language_is_public" tool_tip="Hace que los objetos con script del mundo sepan su idioma preferido."/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_region_covenant.xml b/indra/newview/skins/default/xui/es/panel_region_covenant.xml
index 220479098b..3f9e782bd7 100644
--- a/indra/newview/skins/default/xui/es/panel_region_covenant.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_covenant.xml
@@ -22,15 +22,14 @@
Última modificación el miér. 31 de dic. de 1969, 16:00:00
</text>
<button label="?" name="covenant_help"/>
- <text_editor name="covenant_editor" bottom="-263" height="178" >
+ <text_editor name="covenant_editor">
No se ha aportado un contrato para este estado.
</text_editor>
<button label="Cambiar" name="reset_covenant"/>
<text name="covenant_help_text">
- Los cambios en el contrato se mostrarán en todas las parcelas
- del estado.
+ Los cambios en el contrato se mostrarán en todas las parcelas del estado.
</text>
- <text name="covenant_instructions" bottom_delta="-31" >
+ <text name="covenant_instructions">
Para cambiar el contrato de este estado, arrastre y suelte una nota.
</text>
<text name="region_section_lbl">
@@ -76,7 +75,6 @@
El terreno comprado en esta región se podrá unir o subdividir.
</string>
<string name="can_not_change">
- El terreno comprado en esta región no se podrá unir ni
-subdividir.
+ El terreno comprado en esta región no se podrá unir ni subdividir.
</string>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_region_debug.xml b/indra/newview/skins/default/xui/es/panel_region_debug.xml
index a7999cc54d..a722235243 100644
--- a/indra/newview/skins/default/xui/es/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_debug.xml
@@ -7,13 +7,13 @@
desconocida
</text>
<check_box label="Desactivar los scripts" name="disable_scripts_check" tool_tip="Descativar todos los scripts en esta región"/>
- <button label="?" name="disable_scripts_help" left="215"/>
+ <button label="?" name="disable_scripts_help"/>
<check_box label="Desactivar las colisiones" name="disable_collisions_check" tool_tip="Desactiva las colisiones (no las de avatares) en esta región"/>
- <button label="?" name="disable_collisions_help" left="215"/>
+ <button label="?" name="disable_collisions_help"/>
<check_box label="Desactivar las propiedades físicas" name="disable_physics_check" tool_tip="Desactiva toda la física en esta región"/>
- <button label="?" name="disable_physics_help" left="215"/>
+ <button label="?" name="disable_physics_help"/>
<button label="Aplicar" name="apply_btn"/>
- <text name="objret_text_lbl" width="130">
+ <text name="objret_text_lbl">
Devolver el objeto
</text>
<text name="resident_text_lbl">
@@ -30,10 +30,10 @@
<check_box label="Devolver sólo los objetos que están en terreno de otro" name="return_other_land" tool_tip="Devolver sólo los objetos que están en terreno de otro"/>
<check_box label="Devolver los objetos de cualquier región de este estado" name="return_estate_wide" tool_tip="Devolver los objetos de todas las regiones que forman este estado"/>
<button label="Devolver" name="return_btn"/>
- <button width="280" label="Listar los objetos que colisionan..." name="top_colliders_btn" tool_tip="Lista de los objetos con más posibles colisiones potenciales"/>
- <button label="?" name="top_colliders_help" left="297"/>
- <button width="280" label="Listar los scripts según su uso..." name="top_scripts_btn" tool_tip="Lista de los objetos que más tiempo emplean ejecutando scripts"/>
- <button label="?" name="top_scripts_help" left="297"/>
+ <button label="Listar los objetos que colisionan..." name="top_colliders_btn" tool_tip="Lista de los objetos con más posibles colisiones potenciales"/>
+ <button label="?" name="top_colliders_help"/>
+ <button label="Listar los scripts según su uso..." name="top_scripts_btn" tool_tip="Lista de los objetos que más tiempo emplean ejecutando scripts"/>
+ <button label="?" name="top_scripts_help"/>
<button label="Reiniciar la región" name="restart_btn" tool_tip="Cuenta atrás de 2 minutos y reiniciar la región"/>
<button label="?" name="restart_help"/>
<button label="Retrasar el reinicio" name="cancel_restart_btn" tool_tip="Retrasar una hora el reinicio de la región"/>
diff --git a/indra/newview/skins/default/xui/es/panel_region_estate.xml b/indra/newview/skins/default/xui/es/panel_region_estate.xml
index f16ec89cb0..93155d828d 100644
--- a/indra/newview/skins/default/xui/es/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_estate.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Estado" name="Estate">
<text name="estate_help_text">
- Los cambios en las configuraciones de esta
-pestaña afectarán a todas las regiones del estado.
+ Los cambios en las configuraciones de esta pestaña afectarán a todas
+las regiones de este estado.
</text>
<text name="estate_text">
Estado:
@@ -24,16 +24,16 @@ pestaña afectarán a todas las regiones del estado.
<check_box label="Permitir el acceso público" name="externally_visible_check"/>
<button label="?" name="externally_visible_help"/>
<text name="Only Allow">
- Impedir el acceso a Residentes...
+ Impedir el acceso a:
</text>
- <check_box label="sin información de pago archivada" name="limit_payment" tool_tip="Impedir el acceso a los residentes no identificados."/>
- <check_box label="que no han verificado si son adultos" name="limit_age_verified" tool_tip="Impedir el acceso a residentes que no hayan verificado su edad. Para más información, vea support.secondlife.com"/>
+ <check_box label="Residentes sin información de pago archivada" name="limit_payment" tool_tip="Impedir el acceso a los residentes no identificados."/>
+ <check_box label="Residentes de los que no se ha verificado si son adultos" name="limit_age_verified" tool_tip="Impedir el acceso a residentes que no hayan verificado su edad. Para más información, vea support.secondlife.com"/>
<check_box label="Permitir el chat de voz" name="voice_chat_check"/>
<button label="?" name="voice_chat_help"/>
<check_box label="Permitir el teleporte a cualquier punto" name="allow_direct_teleport"/>
<button label="?" name="allow_direct_teleport_help"/>
- <text name="abuse_email_text" width="260">
- Dirección de correo-e para infracciones:
+ <text name="abuse_email_text">
+ Dirección de correo electrónico para infracciones:
</text>
<string name="email_unsupported">
Característica no disponible
@@ -63,7 +63,7 @@ pestaña afectarán a todas las regiones del estado.
<text name="ban_resident_label">
Residentes con el acceso prohibido:
</text>
- <button label="?" name="ban_resident_help" right="476"/>
+ <button label="?" name="ban_resident_help"/>
<button label="Quitar..." name="remove_banned_avatar_btn"/>
<button label="Añadir..." name="add_banned_avatar_btn"/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_region_general.xml b/indra/newview/skins/default/xui/es/panel_region_general.xml
index 155161489e..64169e427b 100644
--- a/indra/newview/skins/default/xui/es/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_general.xml
@@ -30,11 +30,11 @@
<button label="?" name="land_resell_help"/>
<check_box label="Permitir unir/dividir el terreno" name="allow_parcel_changes_check"/>
<button label="?" name="parcel_changes_help"/>
- <check_box label="Bloquear el mostrar el terreno en &#10;la búsqueda." name="block_parcel_search_check" tool_tip="Permitir que la gente vea esta región y sus parcelas en los resultados de la búsqueda."/>
+ <check_box label="Bloquear el mostrar el terreno en la búsqueda." name="block_parcel_search_check" tool_tip="Permitir que la gente vea esta región y sus parcelas en los resultados de la búsqueda."/>
<button label="?" name="parcel_search_help"/>
- <spinner label="Nº máximo de avatares" name="agent_limit_spin" label_width="120" width="180"/>
+ <spinner label="Nº máximo de avatares" name="agent_limit_spin"/>
<button label="?" name="agent_limit_help"/>
- <spinner label="Plus de objetos" name="object_bonus_spin" label_width="120" width="180"/>
+ <spinner label="Plus de objetos" name="object_bonus_spin"/>
<button label="?" name="object_bonus_help"/>
<text label="Calificación" name="access_text">
Calificación:
@@ -54,6 +54,6 @@
<button label="Aplicar" name="apply_btn"/>
<button label="Teleportar a su Base a un usuario..." name="kick_btn"/>
<button label="Teleportar a su Base a todos los usuarios..." name="kick_all_btn"/>
- <button label="Enviar un mensaje a toda la región..." name="im_btn" width="250" />
- <button label="Administrar el Punto de Teleporte..." name="manage_telehub_btn" width="210"/>
+ <button label="Enviar un mensaje a toda la región..." name="im_btn"/>
+ <button label="Administrar el Punto de Teleporte..." name="manage_telehub_btn"/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_region_terrain.xml b/indra/newview/skins/default/xui/es/panel_region_terrain.xml
index 903b826a0b..df333c0c5e 100644
--- a/indra/newview/skins/default/xui/es/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_terrain.xml
@@ -8,9 +8,9 @@
</text>
<spinner label="Nivel del agua" name="water_height_spin"/>
<button label="?" name="water_height_help"/>
- <spinner label="Límite de elevación del &#10;terreno" name="terrain_raise_spin"/>
+ <spinner label="Límite de elevación del terreno" name="terrain_raise_spin"/>
<button label="?" name="terrain_raise_help"/>
- <spinner label="Límite de bajada del &#10;terreno" name="terrain_lower_spin" bottom_delta="-34"/>
+ <spinner label="Límite de bajada del terreno" name="terrain_lower_spin"/>
<button label="?" name="terrain_lower_help"/>
<check_box label="Usar el Sol del estado" name="use_estate_sun_check"/>
<button label="?" name="use_estate_sun_help"/>
@@ -18,10 +18,10 @@
<button label="?" name="fixed_sun_help"/>
<slider label="Fase" name="sun_hour_slider"/>
<button label="Aplicar" name="apply_btn"/>
- <button width="230" label="Descargar el RAW del terreno..." name="download_raw_btn" tool_tip="Disponible sólo para los propietarios del estado, no para los administradores"/>
- <button left="246" label="?" name="download_raw_help"/>
- <button width="230" label="Subir un RAW para el terreno..." name="upload_raw_btn" tool_tip="Disponible sólo para los propietarios del estado, no para los administradores"/>
- <button left="246" label="?" name="upload_raw_help"/>
- <button width="230" label="Predeterminar este terreno" name="bake_terrain_btn" tool_tip="Definir el terreno actual como punto medio para los límites de elevación/bajada"/>
- <button left="246" label="?" name="bake_terrain_help"/>
+ <button label="Descargar el RAW del terreno..." name="download_raw_btn" tool_tip="Disponible sólo para los propietarios del estado, no para los administradores"/>
+ <button label="?" name="download_raw_help"/>
+ <button label="Subir un RAW para el terreno..." name="upload_raw_btn" tool_tip="Disponible sólo para los propietarios del estado, no para los administradores"/>
+ <button label="?" name="upload_raw_help"/>
+ <button label="Predeterminar este terreno" name="bake_terrain_btn" tool_tip="Definir el terreno actual como punto medio para los límites de elevación/bajada"/>
+ <button label="?" name="bake_terrain_help"/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_region_texture.xml b/indra/newview/skins/default/xui/es/panel_region_texture.xml
index 5540358f97..d7f42ac41c 100644
--- a/indra/newview/skins/default/xui/es/panel_region_texture.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_texture.xml
@@ -6,7 +6,7 @@
<text name="region_text">
desconocida
</text>
- <text name="detail_texture_text" width="380">
+ <text name="detail_texture_text">
Texturas del terreno (se requieren archivos .tga de 512x512 y 24 bites)
</text>
<text name="height_text_lbl">
diff --git a/indra/newview/skins/default/xui/fr/floater_customize.xml b/indra/newview/skins/default/xui/fr/floater_customize.xml
index 89b3705570..b1d7edbe52 100644
--- a/indra/newview/skins/default/xui/fr/floater_customize.xml
+++ b/indra/newview/skins/default/xui/fr/floater_customize.xml
@@ -183,7 +183,7 @@ votre avatar. Vous pouvez aussi en créer de nouveaux et les porter.
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter une nouvelle chemise, faites-en glisser une de votre inventaire
+ Pour changer de chemise, faites-en glisser une de votre inventaire
jusqu&apos;à votre avatar. Vous pouvez aussi en créer une nouvelle et la porter.
</text>
<text length="1" name="no modify instructions" type="string">
@@ -217,7 +217,7 @@ jusqu&apos;à votre avatar. Vous pouvez aussi en créer une nouvelle et la porte
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter un nouveau pantalon, faites-en glisser un de votre inventaire
+ Pour changer de pantalon, faites-en glisser un de votre inventaire
jusqu&apos;à votre avatar. Vous pouvez aussi en créer un nouveau et le porter.
</text>
<text length="1" name="no modify instructions" type="string">
@@ -244,7 +244,7 @@ jusqu&apos;à votre avatar. Vous pouvez aussi en créer un nouveau et le porter.
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter de nouvelles chaussures, faites-en glisser une paire de votre
+ Pour changer de chaussures, faites-en glisser une paire de votre
inventaire jusqu&apos;à votre avatar. Vous pouvez aussi en créer une
nouvelle paire et la porter.
</text>
@@ -279,7 +279,7 @@ nouvelle paire et la porter.
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter de nouvelles chaussettes, faites-en glisser une paire de votre
+ Pour changer de chaussettes, faites-en glisser une paire de votre
inventaire jusqu&apos;à votre avatar. Vous pouvez aussi en créer une
nouvelle paire et la porter.
</text>
@@ -314,8 +314,8 @@ nouvelle paire et la porter.
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter une nouvelle veste, faites-en glisser une de votre inventaire
-jusqu&apos;à votre avatar. Vous pouvez aussi en créer une nouvelle et la porter.
+ Pour changer de veste, faites-en glisser une de votre inventaire jusqu&apos;à
+votre avatar. Vous pouvez aussi en créer une nouvelle et la porter.
</text>
<text length="1" name="no modify instructions" type="string">
Vous n&apos;avez pas la permission de modifier cet objet.
@@ -349,7 +349,7 @@ jusqu&apos;à votre avatar. Vous pouvez aussi en créer une nouvelle et la porte
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter de nouveaux gants, faites-les glisser à partir de votre
+ Pour changer de gants, faites-en glisser une paire à partir de votre
inventaire. Vous pouvez aussi en créer une nouvelle paire et la porter.
</text>
<text length="1" name="no modify instructions" type="string">
@@ -383,7 +383,7 @@ inventaire. Vous pouvez aussi en créer une nouvelle paire et la porter.
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter de nouveaux sous-vêtements, faites-les glisser à partir de
+ Pour changer de sous-vêtement, faites-en glisser une paire à partir de
votre inventaire. Vous pouvez aussi en créer des nouveaux et les porter.
</text>
<text length="1" name="no modify instructions" type="string">
@@ -418,7 +418,7 @@ votre inventaire. Vous pouvez aussi en créer des nouveaux et les porter.
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter de nouveaux sous-vêtements, faites-les glisser à partir de
+ Pour changer de sous-vêtement, faites-en glisser une paire à partir de
votre inventaire. Vous pouvez aussi en créer des nouveaux et les porter.
</text>
<text length="1" name="no modify instructions" type="string">
@@ -453,8 +453,8 @@ votre inventaire. Vous pouvez aussi en créer des nouveaux et les porter.
Emplacement : [PATH]
</text>
<text length="1" name="not worn instructions" type="string">
- Pour porter une nouvelle jupe, faites-en glisser une à partir de votre
-inventaire. Vous pouvez aussi en créer une nouvelle et la porter.
+ Pour changer de jupe, faites-en glisser une à partir de votre inventaire.
+Vous pouvez aussi en créer une nouvelle et la porter.
</text>
<text length="1" name="no modify instructions" type="string">
Vous n&apos;avez pas la permission de modifier cet objet.
diff --git a/indra/newview/skins/default/xui/fr/floater_inventory.xml b/indra/newview/skins/default/xui/fr/floater_inventory.xml
index 7173025d18..071c0ae133 100644
--- a/indra/newview/skins/default/xui/fr/floater_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/floater_inventory.xml
@@ -29,8 +29,8 @@
<menu_item_call label="Nouvelle veste" name="New Jacket"/>
<menu_item_call label="Nouvelle jupe" name="New Skirt"/>
<menu_item_call label="Nouveaux gants" name="New Gloves"/>
- <menu_item_call label="Nouveaux sous-vêtements (haut)" name="New Undershirt"/>
- <menu_item_call label="Nouveaux sous-vêtements (bas)" name="New Underpants"/>
+ <menu_item_call label="Nouveau tricot" name="New Undershirt"/>
+ <menu_item_call label="Nouveaux sous-vêtements" name="New Underpants"/>
</menu>
<menu name="New Body Parts">
<menu_item_call label="Nouvelle silhouette" name="New Shape"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/fr/floater_inventory_view_finder.xml
index cb7e618232..090f5f6bc9 100644
--- a/indra/newview/skins/default/xui/fr/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/fr/floater_inventory_view_finder.xml
@@ -12,13 +12,13 @@
<check_box label="Textures" name="check_texture"/>
<check_box label="Photos" name="check_snapshot"/>
<button label="Tout" label_selected="Tout" name="All" width="70"/>
- <button label="Aucun" label_selected="Aucun" name="None" width="70" bottom_delta="0" left="83"/>
- <check_box label="Toujours montrer &#10;les dossiers" name="check_show_empty" bottom_delta="-20"/>
- <check_box label="Depuis la déconnexion" name="check_since_logoff" bottom_delta="-36"/>
+ <button label="Aucun" label_selected="Aucun" name="None" width="70" bottom="-260" left="83"/>
+ <check_box label="Toujours montrer &#10;les dossiers" name="check_show_empty" bottom="-284"/>
+ <check_box label="Depuis la déconnexion" name="check_since_logoff" bottom="-318"/>
<text length="1" name="- OR -" type="string">
Ou il y a...
</text>
<spinner label="Heures" name="spin_hours_ago"/>
<spinner label="Jours" name="spin_days_ago"/>
- <button label="Fermer" label_selected="Fermer" name="Close" bottom_delta="-30"/>
+ <button label="Fermer" label_selected="Fermer" name="Close"/>
</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_mem_leaking.xml b/indra/newview/skins/default/xui/fr/floater_mem_leaking.xml
index 8ee3a23b95..a22d0a2934 100644
--- a/indra/newview/skins/default/xui/fr/floater_mem_leaking.xml
+++ b/indra/newview/skins/default/xui/fr/floater_mem_leaking.xml
@@ -11,8 +11,8 @@
<text name="note_label_2">
[NOTE2]
</text>
- <button label="Commencer" name="start_btn" width="85"/>
- <button label="Stop" name="stop_btn" left="100"/>
- <button label="Libérer" name="release_btn" left="177"/>
+ <button label="Commencer" name="start_btn" />
+ <button label="Stop" name="stop_btn" />
+ <button label="Libérer" name="release_btn" />
<button label="Fermer" name="close_btn" />
</floater>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml
index 23e1e74035..7c366e8bdc 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml
@@ -10,15 +10,9 @@
</radio_group>
<check_box label="Afficher le lieu de départ sur l&apos;écran de connexion" name="show_location_checkbox"/>
<combo_box name="fade_out_combobox" width="166">
- <combo_item name="Never">
- Jamais
- </combo_item>
- <combo_item name="Show Temporarily">
- Afficher temporairement
- </combo_item>
- <combo_item name="Always">
- Toujours
- </combo_item>
+ <combo_box.item name="Never" label="Jamais"/>
+ <combo_box.item name="Show Temporarily" label="Afficher temporairement"/>
+ <combo_box.item name="Always" label="Toujours"/>
</combo_box>
<check_box label="Nom des avatars en petit" name="small_avatar_names_checkbox"/>
<check_box label="Masquer mon nom sur mon écran" name="show_my_name_checkbox"/>
@@ -81,68 +75,34 @@ de sélection :
&lt;Saisissez le nom de la région&gt;
</string>
<combo_box name="crash_behavior_combobox" width="166">
- <combo_item length="1" name="Askbeforesending" type="string">
- Demander avant d&apos;envoyer
- </combo_item>
- <combo_item length="1" name="Alwayssend" type="string">
- Toujours envoyer
- </combo_item>
- <combo_item length="1" name="Neversend" type="string">
- Ne jamais envoyer
- </combo_item>
+ <combo_box.item length="1" name="Askbeforesending" type="string" label="Demander avant d&apos;envoyer"/>
+ <combo_box.item length="1" name="Alwayssend" type="string" label="Toujours envoyer"/>
+ <combo_box.item length="1" name="Neversend" type="string" label="Ne jamais envoyer"/>
</combo_box>
<combo_box name="language_combobox" width="166">
- <combo_item name="System Default Language">
- Choix par défaut
- </combo_item>
- <combo_item length="1" name="English" type="string">
- English (Anglais)
- </combo_item>
- <combo_item length="1" name="Danish" type="string">
- Dansk (Danois) - Bêta
- </combo_item>
- <combo_item length="1" name="Deutsch(German)" type="string">
- Deutsch (Allemand) - Bêta
- </combo_item>
- <combo_item name="Spanish">
- Español (Espagnol) - Bêta
- </combo_item>
- <combo_item name="French">
- Français - Bêta
- </combo_item>
+ <combo_box.item name="System Default Language" label="Choix par défaut"/>
+ <combo_box.item length="1" name="English" type="string" label="English (Anglais)"/>
+ <combo_box.item length="1" name="Danish" type="string" label="Dansk (Danois) - Bêta"/>
+ <combo_box.item length="1" name="Deutsch(German)" type="string" label="Deutsch (Allemand) - Bêta"/>
+ <combo_box.item name="Spanish" label="Español (Espagnol) - Bêta"/>
+ <combo_box.item name="French" label="Français - Bêta"/>
+ <combo_box.item name="Hungarian" label="Magyar (Hongrois) - Bêta"/>
+ <combo_box.item name="Polish" label="Polski (Polonais) - Bêta"/>
+ <combo_box.item name="Portugese" label="Portugués (Portugais) - Bêta"/>
+ <combo_box.item name="Russian" label="Русский (Russe) - Bêta"/>
+ <combo_box.item name="Ukrainian" label="Українська (Ukrainien) - Bêta"/>
+ <combo_box.item length="1" name="Chinese" type="string" label="中文 (简体) (Chinois) - Bêta"/>
+ <combo_box.item length="1" name="(Japanese)" type="string" label="日本語 (Japonais) - Bêta"/>
+ <combo_box.item length="1" name="(Korean)" type="string" label="한국어 (Coréen) - Bêta"/>
<combo_item name="Italian">
Italiano (Italien) - Bêta
</combo_item>
- <combo_item name="Hungarian">
- Magyar (Hongrois) - Bêta
- </combo_item>
<combo_item name="Dutch">
Nederlands (Néerlandais) - Bêta
</combo_item>
- <combo_item name="Polish">
- Polski (Polonais) - Bêta
- </combo_item>
- <combo_item name="Portugese">
- Portugués (Portugais) - Bêta
- </combo_item>
- <combo_item name="Russian">
- Русский (Russe) - Bêta
</combo_item>
<combo_item name="Turkish">
Türkçe (Turc) - Bêta
- </combo_item>
- <combo_item name="Ukrainian">
- Українська (Ukrainien) - Bêta
- </combo_item>
- <combo_item length="1" name="Chinese" type="string">
- 中文 (简体) (Chinois) - Bêta
- </combo_item>
- <combo_item length="1" name="(Japanese)" type="string">
- 日本語 (Japonais) - Bêta
- </combo_item>
- <combo_item length="1" name="(Korean)" type="string">
- 한국어 (Coréen) - Bêta
- </combo_item>
</combo_box>
<check_box label="Partager la langue avec les objets" name="language_is_public" tool_tip="Cette option permet de faire connaître aux objets du Monde votre langue favorite."/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/floater_about_land.xml b/indra/newview/skins/default/xui/it/floater_about_land.xml
index 6e70a04cab..4f57067cd2 100644
--- a/indra/newview/skins/default/xui/it/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/it/floater_about_land.xml
@@ -303,7 +303,7 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
<string name="search_disabled_permissions_tooltip">
Questa opzione è disabilitata perchè tu non puoi modificare le opzioni di questo terreno.
</string>
- <combo_box name="land category with adult" left="282" width="140">
+ <combo_box name="land category with adult">
<combo_item name="AnyCategory">
Tutte le categorie
</combo_item>
@@ -344,45 +344,21 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
Altro
</combo_item>
</combo_box>
- <combo_box name="land category" left="282" width="140">
- <combo_item name="AnyCategory">
- Tutte le categorie
- </combo_item>
- <combo_item name="LindenLocation">
- Luogo dei Linden
- </combo_item>
- <combo_item name="Arts&amp;Culture">
- Arte &amp; Cultura
- </combo_item>
- <combo_item name="Business">
- Affari
- </combo_item>
- <combo_item name="Educational">
- Educazione
- </combo_item>
- <combo_item name="Gaming">
- Gioco
- </combo_item>
- <combo_item name="Hangout">
- Divertimento
- </combo_item>
- <combo_item name="NewcomerFriendly">
- Accoglienza nuovi residenti
- </combo_item>
- <combo_item name="Parks&amp;Nature">
- Parchi &amp; Natura
- </combo_item>
- <combo_item name="Residential">
- Residenziale
- </combo_item>
- <combo_item name="Shopping">
- Shopping
- </combo_item>
- <combo_item name="Other">
- Altro
- </combo_item>
+ <combo_box name="land category">
+ <combo_box.item name="AnyCategory" label="Tutte le categorie"/>
+ <combo_box.item name="LindenLocation" label="Luogo dei Linden"/>
+ <combo_box.item name="Arts&amp;Culture" label="Arte &amp; Cultura"/>
+ <combo_box.item name="Business" label="Affari"/>
+ <combo_box.item name="Educational" label="Educazione"/>
+ <combo_box.item name="Gaming" label="Gioco"/>
+ <combo_box.item name="Hangout" label="Divertimento"/>
+ <combo_box.item name="NewcomerFriendly" label="Accoglienza nuovi residenti"/>
+ <combo_box.item name="Parks&amp;Nature" label="Parchi &amp; Natura"/>
+ <combo_box.item name="Residential" label="Residenziale"/>
+ <combo_box.item name="Shopping" label="Shopping"/>
+ <combo_box.item name="Other" label="Altro"/>
</combo_box>
- <button label="?" label_selected="?" name="?" left="427"/>
+ <button label="?" label_selected="?" name="?"/>
<check_box label="Contenuto Mature" name="MatureCheck" tool_tip=" "/>
<string name="mature_check_mature">
Contenuto Mature
@@ -412,15 +388,9 @@ Solamente terreni più grandi possono essere abilitati nella ricerca.
Rotte dei teleport:
</text>
<combo_box width="140" name="landing type" tool_tip="Rotte dei teleport -- seleziona come vuoi organizzare i teleport nella tua terra.">
- <combo_item name="Blocked">
- Bloccati
- </combo_item>
- <combo_item name="LandingPoint">
- Punto di atterraggio
- </combo_item>
- <combo_item name="Anywhere">
- Ovunque
- </combo_item>
+ <combo_box.item name="Blocked" label="Bloccati"/>
+ <combo_box.item name="LandingPoint" label="Punto di atterraggio"/>
+ <combo_box.item name="Anywhere" label="Ovunque"/>
</combo_box>
<string name="push_restrict_text">
Nessuna spinta
@@ -501,12 +471,8 @@ Media:
<check_box label="Permetti accesso al gruppo: [GROUP]" name="GroupCheck" tool_tip="Imposta il gruppo nel pannello generale."/>
<check_box label="Vendi pass a:" name="PassCheck" tool_tip="Permetti in questo terreno l&apos;accesso temporaneo"/>
<combo_box name="pass_combo">
- <combo_item name="Anyone">
- Chiunque
- </combo_item>
- <combo_item name="Group">
- Gruppo
- </combo_item>
+ <combo_box.item name="Anyone" label="Chiunque"/>
+ <combo_box.item name="Group" label="Gruppo"/>
</combo_box>
<spinner label="Prezzo in L$:" name="PriceSpin"/>
<spinner label="Ore di accesso:" name="HoursSpin"/>
diff --git a/indra/newview/skins/default/xui/it/floater_avatar_picker.xml b/indra/newview/skins/default/xui/it/floater_avatar_picker.xml
index a223e30fb5..4e63c3b7d6 100644
--- a/indra/newview/skins/default/xui/it/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/it/floater_avatar_picker.xml
@@ -14,15 +14,13 @@
</panel>
<panel label="Vicino a me" name="NearMePanel">
<text name="InstructSelectResident">
- Seleziona un residente
-nelle vicinanze:
+ Seleziona un residente nelle vicinanze:
</text>
- <button font="SansSerifSmall" left_delta="6" width="110" label="Aggiorna la lista" label_selected="Aggiorna l&apos;elenco" name="Refresh"/>
- <slider label="Range" name="near_me_range" bottom_delta="-36"/>
+ <button label="Aggiorna la lista" label_selected="Aggiorna l&apos;elenco" name="Refresh"/>
+ <slider label="Range" name="near_me_range"/>
<text name="meters">
Metri
</text>
- <scroll_list bottom_delta="-169" height="159" name="NearMe" />
</panel>
</tab_container>
<button label="Seleziona" label_selected="Seleziona" name="Select"/>
diff --git a/indra/newview/skins/default/xui/it/floater_build_options.xml b/indra/newview/skins/default/xui/it/floater_build_options.xml
index 2c60aeda2b..340d70851c 100644
--- a/indra/newview/skins/default/xui/it/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/it/floater_build_options.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="build options floater" title="Opzioni della griglia">
- <spinner label="Unità di misura della griglia (metri)" name="GridResolution" width="250" label_width="192"/>
- <spinner label="Estensione della griglia (metri)" name="GridDrawSize" width="250" label_width="192"/>
+ <spinner label="Unità di misura della griglia (metri)" name="GridResolution"/>
+ <spinner label="Estensione della griglia (metri)" name="GridDrawSize"/>
<check_box label="Abilita sotto-unità di movimento" name="GridSubUnit"/>
<check_box label="Mostra piani d&apos;intersezione" name="GridCrossSection"/>
- <slider label="Trasparenza della griglia" name="GridOpacity" width="250"/>
+ <slider label="Trasparenza della griglia" name="GridOpacity"/>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_buy_contents.xml b/indra/newview/skins/default/xui/it/floater_buy_contents.xml
index 2836f98970..dce10d5493 100644
--- a/indra/newview/skins/default/xui/it/floater_buy_contents.xml
+++ b/indra/newview/skins/default/xui/it/floater_buy_contents.xml
@@ -6,9 +6,9 @@
<text name="buy_text">
Compra per [AMOUNT]L$ da [NAME]?
</text>
- <button label="Annulla" label_selected="Annulla" name="cancel_btn" width="73"/>
- <button label="Compra" label_selected="Compra" name="buy_btn" width="73" left_delta="-77"/>
- <check_box label="Indossa adesso &#10;l&apos;indumento" name="wear_check" bottom="-234" left_delta="-125"/>
+ <button label="Annulla" label_selected="Annulla" name="cancel_btn"/>
+ <button label="Compra" label_selected="Compra" name="buy_btn"/>
+ <check_box label="Indossa adesso l&apos;indumento" name="wear_check"/>
<string name="no_copy_text">
(non copiabile)
</string>
diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
index a24f0dbe7a..aa840b4de4 100644
--- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml
@@ -22,14 +22,14 @@
<text name="buy_action">
[NAME] [PRICE]L$
</text>
- <text name="currency_action" width="45">
+ <text name="currency_action">
Compra
</text>
<line_editor name="currency_amt">
1234
</line_editor>
<text name="currency_est">
- L$ per circa [USD]US$
+ L$ per circa [USD]US$
</text>
<text name="getting_data">
Dati in ricezione...
@@ -64,6 +64,6 @@ Devi aumentare l&apos;importo da acquistare.
<button label="Cancella" name="cancel_btn"/>
<button label="Acquista" name="buy_btn"/>
<string name="buy_currency">
- acquistare [LINDENS] L$ per circa [USD] US$
+ Compra [LINDENS] L$ per circa [USD] US$
</string>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/it/floater_day_cycle_options.xml
index 4c62d4f5a2..cac43c9b8a 100644
--- a/indra/newview/skins/default/xui/it/floater_day_cycle_options.xml
+++ b/indra/newview/skins/default/xui/it/floater_day_cycle_options.xml
@@ -4,31 +4,31 @@
<panel label="Ciclo giorno/notte" name="Day Cycle">
<button label="?" name="WLDayCycleHelp"/>
<text name="WL12am">
- 0:00
+ 12
</text>
<text name="WL3am">
- 3:00
+ 3
</text>
<text name="WL6am">
- 6:00
+ 6
</text>
<text name="WL9amHash">
- 9:00
+ 9
</text>
<text name="WL12pmHash">
- 12:00
+ 24
</text>
<text name="WL3pm">
- 15:00
+ 15
</text>
<text name="WL6pm">
- 18:00
+ 18
</text>
<text name="WL9pm">
- 21:00
+ 21
</text>
<text name="WL12am2">
- 24:00
+ 12
</text>
<text name="WL12amHash">
|
@@ -57,9 +57,9 @@
<text name="WL12amHash2">
|
</text>
- <button font="SansSerifSmall" width="96" left="546" label="Aggiungi voce" label_selected="Aggiungi voce" name="WLAddKey"/>
- <button font="SansSerifSmall" width="96" left="546" label="Cancella voce" label_selected="Cancella voce" name="WLDeleteKey"/>
- <text name="WLCurKeyFrameText" width="210" left="17">
+ <button label="Aggiungi voce" label_selected="Aggiungi voce" name="WLAddKey"/>
+ <button label="Cancella voce" label_selected="Cancella voce" name="WLDeleteKey"/>
+ <text name="WLCurKeyFrameText">
Impostazioni del fotogramma chiave:
</text>
<text name="WLCurKeyTimeText">
@@ -84,9 +84,9 @@
<text name="DayCycleText3">
Anteprima:
</text>
- <button width="55" font="SansSerifSmall" label="Avvia" label_selected="Avvia" name="WLAnimSky"/>
- <button width="55" left_delta="60" font="SansSerifSmall" label="Arresta!" label_selected="Arresta" name="WLStopAnimSky"/>
- <button left_delta="60" width="150" font="SansSerifSmall" label="Usa l&apos;ora della proprietà" label_selected="Vai all&apos;ora della proprietà" name="WLUseLindenTime"/>
+ <button label="Avvia" label_selected="Avvia" name="WLAnimSky"/>
+ <button label="Arresta!" label_selected="Arresta" name="WLStopAnimSky"/>
+ <button label="Usa l&apos;ora della proprietà" label_selected="Vai all&apos;ora della proprietà" name="WLUseLindenTime"/>
<button label="Salva il test del giorno" label_selected="Salva il test del giorno" name="WLSaveDayCycle"/>
<button label="Carica il test del giorno" label_selected="Carica il test del giorno" name="WLLoadDayCycle"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/floater_env_settings.xml b/indra/newview/skins/default/xui/it/floater_env_settings.xml
index 36f97bda81..58fbff5dc9 100644
--- a/indra/newview/skins/default/xui/it/floater_env_settings.xml
+++ b/indra/newview/skins/default/xui/it/floater_env_settings.xml
@@ -1,26 +1,22 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Environment Editor Floater" title="Editor dell&apos;ambiente">
<text name="EnvTimeText">
- Ora del
-giorno
+ Ora del giorno
</text>
<text name="EnvTimeText2">
12:00 PM
</text>
<text name="EnvCloudText">
- Intensità delle
-Nuvole
+ Intensità delle Nuvole
</text>
<text name="EnvWaterColorText">
- Colore
-dell&apos;Acqua
+ Colore dell&apos;Acqua
</text>
<color_swatch label="" name="EnvWaterColor" tool_tip="Clicca per aprire la tavolozza dei colori"/>
<text name="EnvWaterFogText">
- Nebbiosità
-dell&apos;acqua
+ Nebbiosità dell&apos;acqua
</text>
- <button bottom="-144" label="Usa orario della regione" name="EnvUseEstateTimeButton" width="145"/>
+ <button label="Usa orario della regione" name="EnvUseEstateTimeButton"/>
<button label="Cielo avanzato" name="EnvAdvancedSkyButton"/>
<button label="Acqua avanzata" name="EnvAdvancedWaterButton"/>
<button label="?" name="EnvSettingsHelpButton"/>
diff --git a/indra/newview/skins/default/xui/it/floater_gesture.xml b/indra/newview/skins/default/xui/it/floater_gesture.xml
index 997e13ecb5..27008e97a1 100644
--- a/indra/newview/skins/default/xui/it/floater_gesture.xml
+++ b/indra/newview/skins/default/xui/it/floater_gesture.xml
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="gestures" title="Gesture attive">
<text name="help_label">
- Fai doppio click su una gesture per azionare animazioni
-e suoni.
+ Fai doppio click su una gesture per azionare animazioni e suoni.
</text>
- <scroll_list bottom_delta="-385" height="360" name="gesture_list">
- <column label="Frase scatenante" name="trigger" width="106"/>
- <column label="Pulsante" name="shortcut" width="65"/>
- <column label="Nome" name="name" width="129"/>
+ <scroll_list name="gesture_list">
+ <column label="Frase scatenante" name="trigger"/>
+ <column label="Pulsante" name="shortcut"/>
+ <column label="Nome" name="name"/>
</scroll_list>
<button label="Nuova" name="new_gesture_btn"/>
<button label="Modifica" name="edit_btn"/>
diff --git a/indra/newview/skins/default/xui/it/floater_inspect.xml b/indra/newview/skins/default/xui/it/floater_inspect.xml
index 6028c40557..cbf2935c77 100644
--- a/indra/newview/skins/default/xui/it/floater_inspect.xml
+++ b/indra/newview/skins/default/xui/it/floater_inspect.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="inspect" title="Ispeziona oggetti" min_width="450">
+<floater name="inspect" title="Ispeziona oggetti">
<scroll_list name="object_list" tool_tip="Seleziona un oggetto da questo elenco per evidenziarlo inworld">
<column label="Nome dell&apos;oggetto" name="object_name"/>
- <column label="Proprietario" name="owner_name"/>
- <column label="Creatore" name="creator_name"/>
+ <column label="Nome del proprietario" name="owner_name"/>
+ <column label="Nome del creatore" name="creator_name"/>
<column label="Data di creazione" name="creation_date"/>
</scroll_list>
- <button width="185" label="Vedi il profilo del proprietario..." label_selected="" name="button owner" tool_tip="Vedi il profilo del proprietario dell&apos;oggetto evidenziato"/>
- <button width="165" left="205" label="Vedi il profilo del creatore..." label_selected="" name="button creator" tool_tip="Vedi il profilo del creatore originale dell&apos;oggetto evidenziato"/>
+ <button label="Vedi il profilo del proprietario..." label_selected="" name="button owner" tool_tip="Vedi il profilo del proprietario dell&apos;oggetto evidenziato"/>
+ <button label="Vedi il profilo del creatore..." label_selected="" name="button creator" tool_tip="Vedi il profilo del creatore originale dell&apos;oggetto evidenziato"/>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/it/floater_inventory_view_finder.xml
index c2c05b4023..935e1d7049 100644
--- a/indra/newview/skins/default/xui/it/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/it/floater_inventory_view_finder.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Inventory Finder" title="Inventario_Cose_recenti" width="165">
+<floater name="Inventory Finder" title="Inventario_Cose_recenti">
<check_box label="Animazioni" name="check_animation"/>
<check_box label="Biglietti da visita" name="check_calling_card"/>
<check_box label="Abiti" name="check_clothing"/>
diff --git a/indra/newview/skins/default/xui/it/floater_joystick.xml b/indra/newview/skins/default/xui/it/floater_joystick.xml
index ced227a845..dcd637f199 100644
--- a/indra/newview/skins/default/xui/it/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/it/floater_joystick.xml
@@ -3,24 +3,23 @@
<check_box name="enable_joystick">
Abilita Joystick:
</check_box>
- <text left="120" name="joystick_type" width="380"/>
- <spinner label="Mapping: asse X" name="JoystickAxis1" label_width="140" width="180" left="12"/>
- <spinner label="Mapping: asse Y" name="JoystickAxis2" label_width="134" width="174" left="205"/>
- <spinner label="Mapping: asse Z" name="JoystickAxis0" label_width="94" width="134" left="390"/>
- <spinner label="Mapping: direzione o Pitch" name="JoystickAxis4" label_width="140" width="180" left="12"/>
- <spinner label="Mapping: altitudine o Yaw" name="JoystickAxis5" label_width="134" width="174" left="205"/>
- <spinner label="Mapping del Roll" name="JoystickAxis3" label_width="94" width="134" left="390"/>
- <spinner label="Mapping dello Zoom" name="JoystickAxis6" label_width="140" width="180" left="12"/>
- <check_box label="Zoom diretto" name="ZoomDirect" left="205"/>
+ <spinner label="Mapping asse X" name="JoystickAxis1"/>
+ <spinner label="Mapping asse Y" name="JoystickAxis2"/>
+ <spinner label="Mapping asse Z" name="JoystickAxis0"/>
+ <spinner label="Mapping della direzione o Pitch" name="JoystickAxis4"/>
+ <spinner label="Mapping dell&apos;altitudine o Yaw" name="JoystickAxis5"/>
+ <spinner label="Mapping del Roll" name="JoystickAxis3"/>
+ <spinner label="Mapping dello Zoom" name="JoystickAxis6"/>
+ <check_box label="Zoom diretto" name="ZoomDirect"/>
<check_box label="Cursore 3D" name="Cursor3D"/>
<check_box label="Auto livellamento" name="AutoLeveling"/>
- <text name="Control Modes:" left="3" width="113">
+ <text name="Control Modes:">
Modalità di controllo:
</text>
<check_box name="JoystickAvatarEnabled">
Avatar
</check_box>
- <check_box name="JoystickBuildEnabled" left="192">
+ <check_box name="JoystickBuildEnabled">
Costruire
</check_box>
<check_box name="JoystickFlycamEnabled">
@@ -35,14 +34,14 @@
<text name="ZScale">
Regolazione Z
</text>
- <text name="PitchScale" left="3" width="112">
- Regolazione: Pitch
+ <text name="PitchScale">
+ Regolazione della direzione o Pitch
</text>
- <text name="YawScale" left="3" width="112">
- Regolazione: Yaw
+ <text name="YawScale">
+ Regolazione dell&apos;altitudine o Yaw
</text>
- <text name="RollScale" left="3" width="112">
- Regolazione: Roll
+ <text name="RollScale">
+ Regolazione del Roll
</text>
<text name="XDeadZone">
Angolo morto X
@@ -53,22 +52,22 @@
<text name="ZDeadZone">
Angolo morto Z
</text>
- <text name="PitchDeadZone" left="3" width="112">
- Angolo morto: Pitch
+ <text name="PitchDeadZone">
+ Angolo morto della direzione o Pitch
</text>
- <text name="YawDeadZone" left="3" width="112">
- Angolo morto: Yaw
+ <text name="YawDeadZone">
+ Angolo morto dell&apos;altitudine o Yaw
</text>
- <text name="RollDeadZone" left="3" width="112">
- Angolo morto: Roll
+ <text name="RollDeadZone">
+ Angolo morto del Roll
</text>
<text name="Feathering">
Smussamento
</text>
- <text name="ZoomScale2" width="135" left="6">
+ <text name="ZoomScale2">
Regolazione dello zoom
</text>
- <text name="ZoomDeadZone" width="135" left="6">
+ <text name="ZoomDeadZone">
Angolo morto dello zoom
</text>
<button label="SpaceNavigator Defaults" name="SpaceNavigatorDefaults"/>
diff --git a/indra/newview/skins/default/xui/it/floater_lagmeter.xml b/indra/newview/skins/default/xui/it/floater_lagmeter.xml
index af70ad9d31..d14f12ea4a 100644
--- a/indra/newview/skins/default/xui/it/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/it/floater_lagmeter.xml
@@ -1,27 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="floater_lagmeter" title="Misuratore del lag">
<button label="" label_selected="" name="client_lagmeter" tool_tip="Stato del lag del programma in locale"/>
- <text left="30" name="client_lag_cause" right="-10" />
- <text left="30" name="network_lag_cause" right="-10" />
- <text left="30" name="server_lag_cause" right="-32" />
<text name="client">
Programma in locale:
</text>
- <text name="client_text" left="145" font="SansSerifSmall">
+ <text name="client_text">
Normale
</text>
<button label="" label_selected="" name="network_lagmeter" tool_tip="Stato del lag del network"/>
<text name="network">
Network:
</text>
- <text name="network_text" font="SansSerifSmall">
+ <text name="network_text">
Normale
</text>
<button label="" label_selected="" name="server_lagmeter" tool_tip="Stato del lag del server"/>
<text name="server">
Server:
</text>
- <text name="server_text" font="SansSerifSmall">
+ <text name="server_text">
Normale
</text>
<button label="?" name="server_help"/>
@@ -51,10 +48,10 @@
Normale, finestra sullo sfondo
</string>
<string name="client_frame_time_critical_msg">
- Velocità dei frame al di sotto di [CLIENT_FRAME_RATE_CRITICAL]
+ Velocità dei frame del programma in locale al di sotto di [CLIENT_FRAME_RATE_CRITICAL]
</string>
<string name="client_frame_time_warning_msg">
- Velocità dei frame tra [CLIENT_FRAME_RATE_CRITICAL] e [CLIENT_FRAME_RATE_WARNING]
+ Velocità dei frame del programma in locale tra [CLIENT_FRAME_RATE_CRITICAL] e [CLIENT_FRAME_RATE_WARNING]
</string>
<string name="client_frame_time_normal_msg">
Normale
@@ -120,10 +117,10 @@
20
</string>
<string name="server_frame_time_critical_msg">
- Velocità dei frame al di sotto di [SERVER_FRAME_RATE_CRITICAL]
+ Velocità del simulatore al di sotto di [SERVER_FRAME_RATE_CRITICAL]
</string>
<string name="server_frame_time_warning_msg">
- Velocità dei frame tra [SERVER_FRAME_RATE_CRITICAL] e [SERVER_FRAME_RATE_WARNING]
+ Velocità del simulatore tra [SERVER_FRAME_RATE_CRITICAL] e [SERVER_FRAME_RATE_WARNING]
</string>
<string name="server_frame_time_normal_msg">
Normale
diff --git a/indra/newview/skins/default/xui/it/floater_land_holdings.xml b/indra/newview/skins/default/xui/it/floater_land_holdings.xml
index 85661c28d7..6ac84b854f 100644
--- a/indra/newview/skins/default/xui/it/floater_land_holdings.xml
+++ b/indra/newview/skins/default/xui/it/floater_land_holdings.xml
@@ -7,7 +7,7 @@
<column label="Area" name="area"/>
</scroll_list>
<button label="Teletrasportati" label_selected="Teletrasportati" name="Teleport" tool_tip="Teletrasportati al centro di questo terreno."/>
- <button width="130" label="Mostra sulla mappa" label_selected="Mostra sulla mappa" name="Show on Map" tool_tip="Mostra questo terreno sulla mappa."/>
+ <button label="Mostra sulla mappa" label_selected="Mostra sulla mappa" name="Show on Map" tool_tip="Mostra questo terreno sulla mappa."/>
<text name="contrib_label">
Contributi ai tuoi gruppi:
</text>
@@ -19,21 +19,21 @@
Proprietà di terreni consentite per l&apos;attuale piano di pagamento:
</text>
<text name="allowed_text">
- [AREA] m²
+ [AREA] metri quadrati
</text>
<text name="current_label">
Attuale proprietà di terreni:
</text>
<text name="current_text">
- [AREA] m²
+ [AREA] metri quadrati
</text>
<text name="available_label">
Quantità disponibile per ulteriori acquisti di terreno:
</text>
<text name="available_text">
- [AREA] m²
+ [AREA] metri quadrati
</text>
<string name="area_string">
- [AREA] m²
+ [AREA] metri quadrati
</string>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/it/floater_live_lsleditor.xml
index bb1f6116cf..55195a00f1 100644
--- a/indra/newview/skins/default/xui/it/floater_live_lsleditor.xml
+++ b/indra/newview/skins/default/xui/it/floater_live_lsleditor.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="script ed float" title="Script: Nuovo script">
<button label="Ripristina" label_selected="Ripristina" name="Reset"/>
- <check_box label="In esecuzione" name="running" left="4"/>
- <check_box label="Mono" name="mono" left="106"/>
+ <check_box label="In esecuzione" name="running"/>
+ <check_box label="Mono" name="mono"/>
<string name="not_allowed">
Non sei autorizzato a visualizzare questo script.
</string>
diff --git a/indra/newview/skins/default/xui/it/floater_lsl_guide.xml b/indra/newview/skins/default/xui/it/floater_lsl_guide.xml
index ec62dd087d..6a27703ad6 100644
--- a/indra/newview/skins/default/xui/it/floater_lsl_guide.xml
+++ b/indra/newview/skins/default/xui/it/floater_lsl_guide.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="script ed float" title="LSL Wiki">
<check_box label="Segui il cursore" name="lock_check"/>
- <combo_box label="Blocca" name="history_combo" left_delta="120" width="70"/>
- <button label="Indietro" name="back_btn" left_delta="75"/>
+ <combo_box label="Blocca" name="history_combo"/>
+ <button label="Indietro" name="back_btn"/>
<button label="Avanti" name="fwd_btn"/>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_media_browser.xml b/indra/newview/skins/default/xui/it/floater_media_browser.xml
index 4d3462b348..1c906f5a4d 100644
--- a/indra/newview/skins/default/xui/it/floater_media_browser.xml
+++ b/indra/newview/skins/default/xui/it/floater_media_browser.xml
@@ -2,11 +2,10 @@
<floater name="floater_about" title="Browser multimediale">
<layout_stack name="stack1">
<layout_panel name="nav_controls">
- <button label="Indietro" name="back" width="75"/>
- <button label="Avanti" name="forward" left_delta="75" width="70"/>
- <button label="Ricarica" name="reload" left_delta="75"/>
- <combo_box left_delta="75" name="address" width="510"/>
- <button label="Vai" name="go" left_delta="515"/>
+ <button label="Indietro" name="back"/>
+ <button label="Avanti" name="forward"/>
+ <button label="Ricarica" name="reload"/>
+ <button label="Vai" name="go"/>
</layout_panel>
<layout_panel name="parcel_owner_controls">
<button label="Invia questo URL al terreno" name="assign"/>
diff --git a/indra/newview/skins/default/xui/it/floater_mute_object.xml b/indra/newview/skins/default/xui/it/floater_mute_object.xml
index 6bacdcab41..4b7370bad0 100644
--- a/indra/newview/skins/default/xui/it/floater_mute_object.xml
+++ b/indra/newview/skins/default/xui/it/floater_mute_object.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="mute by name" title="Ignora l&apos;oggetto dal nome">
<text name="message">
- Ignora per nome ha effetti sull&apos;oggetto in chat e IM, non
-nei suoni. Devi scrivere esattamente il nome dell&apos;oggetto.
+ Ignora per nome ha effetti sull&apos;oggetto in chat e IM, non nei suoni.
+Devi scrivere esattamente il nome dell&apos;oggetto.
</text>
<line_editor name="object_name">
Nome dell&apos;oggetto
</line_editor>
- <button label="OK" name="OK"/>
+ <button label="Ok" name="OK"/>
<button label="Annulla" name="Cancel"/>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_pay.xml b/indra/newview/skins/default/xui/it/floater_pay.xml
index 4889f97ec7..dbf374a67c 100644
--- a/indra/newview/skins/default/xui/it/floater_pay.xml
+++ b/indra/newview/skins/default/xui/it/floater_pay.xml
@@ -1,22 +1,21 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Give Money" title="">
- <button label="1 L$" label_selected="1 L$" name="fastpay 1" left="118" width="80" />
- <button label="5 L$" label_selected="5 L$" name="fastpay 5" left="210"/>
- <button label="10 L$" label_selected="10 L$" name="fastpay 10" left="118" width="80" />
- <button label="20 L$" label_selected="20 L$" name="fastpay 20" left="210"/>
- <button label="Paga" label_selected="Paga" name="pay btn" left="127"/>
- <button label="Annulla" label_selected="Annulla" name="cancel btn" left="210"/>
- <text name="payee_label" left="5" width="105">
+ <button label="1 L$" label_selected="1 L$" name="fastpay 1"/>
+ <button label="5 L$" label_selected="5 L$" name="fastpay 5"/>
+ <button label="10 L$" label_selected="10 L$" name="fastpay 10"/>
+ <button label="20 L$" label_selected="20 L$" name="fastpay 20"/>
+ <button label="Paga" label_selected="Paga" name="pay btn"/>
+ <button label="Annulla" label_selected="Annulla" name="cancel btn"/>
+ <text name="payee_label">
Paga residente:
</text>
- <text name="payee_name" left="115">
+ <text name="payee_name">
[FIRST] [LAST]
</text>
- <text name="fastpay text" width="110" halign="left">
+ <text name="fastpay text">
Pagamento veloce:
</text>
- <text name="amount text" left="4" >
+ <text name="amount text">
Ammontare:
</text>
- <line_editor left="70" name="amount" width="49"/>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_pay_object.xml b/indra/newview/skins/default/xui/it/floater_pay_object.xml
index c41c0ba41e..021b2d7647 100644
--- a/indra/newview/skins/default/xui/it/floater_pay_object.xml
+++ b/indra/newview/skins/default/xui/it/floater_pay_object.xml
@@ -1,31 +1,30 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Give Money" title="">
- <text name="payee_group" width="100" halign="left">
+ <text name="payee_group">
Paga il gruppo:
</text>
- <text name="payee_resident" width="120" halign="left">
+ <text name="payee_resident">
Paga il residente:
</text>
- <text name="payee_name" left="120">
+ <text name="payee_name">
[FIRST] [LAST]
</text>
- <text name="object_name_label" left="5" width="110" halign="left">
+ <text name="object_name_label">
Mediante l&apos;oggetto:
</text>
- <text name="object_name_text" left="120" >
+ <text name="object_name_text">
...
</text>
- <text name="fastpay text" width="115" halign="left">
+ <text name="fastpay text">
Pagamento diretto:
</text>
- <text name="amount text" left="5" halign="left">
+ <text name="amount text">
Ammontare:
</text>
- <button label="1 L$" label_selected="1 L$" name="fastpay 1" left="125" width="70"/>
- <button label="5 L$" label_selected="5 L$" name="fastpay 5" left="200" width="70"/>
- <button label="10 L$" label_selected="10 L$" name="fastpay 10" left="125" width="70"/>
- <button label="20 L$" label_selected="20 L$" name="fastpay 20" left="200" width="70"/>
+ <button label="1 L$" label_selected="1 L$" name="fastpay 1"/>
+ <button label="5 L$" label_selected="5 L$" name="fastpay 5"/>
+ <button label="10 L$" label_selected="10 L$" name="fastpay 10"/>
+ <button label="20 L$" label_selected="20 L$" name="fastpay 20"/>
<button label="Paga" label_selected="Paga" name="pay btn"/>
<button label="Cancella" label_selected="Cancella" name="cancel btn"/>
- <line_editor left="74" name="amount" width="50" />
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_preferences.xml b/indra/newview/skins/default/xui/it/floater_preferences.xml
index 6277300bee..726b6dd70b 100644
--- a/indra/newview/skins/default/xui/it/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/it/floater_preferences.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Preferences" title="Preferenze" min_width="350" width="646">
+<floater name="Preferences" title="Preferenze">
<button label="OK" label_selected="OK" name="OK"/>
<button label="Annulla" label_selected="Annulla" name="Cancel"/>
<button label="Applica" label_selected="Applica" name="Apply"/>
<button label="Informazioni..." label_selected="Informazioni..." name="About..."/>
<button label="Aiuto" label_selected="Aiuto" name="Help"/>
- <tab_container name="pref core" tab_width="146" width="646" />
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_preview_animation.xml b/indra/newview/skins/default/xui/it/floater_preview_animation.xml
index e9e0252613..95a8a96066 100644
--- a/indra/newview/skins/default/xui/it/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/it/floater_preview_animation.xml
@@ -3,6 +3,6 @@
<text name="desc txt">
Descrizione:
</text>
- <button left="20" width="131" label="Esegui inworld" label_selected="Ferma" name="Anim play btn" tool_tip="Esegui questa animazione così che altri possano vederla."/>
- <button left="162" width="125" label="Esegui localmente" label_selected="Ferma" name="Anim audition btn" tool_tip="Esegui questa animazione così che solo tu possa vederla."/>
+ <button label="Esegui inworld" label_selected="Ferma" name="Anim play btn" tool_tip="Esegui questa animazione così che altri possano vederla."/>
+ <button label="Esegui localmente" label_selected="Ferma" name="Anim audition btn" tool_tip="Esegui questa animazione così che solo tu possa vederla."/>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_script_search.xml b/indra/newview/skins/default/xui/it/floater_script_search.xml
index 470fb76135..ebd8ee359f 100644
--- a/indra/newview/skins/default/xui/it/floater_script_search.xml
+++ b/indra/newview/skins/default/xui/it/floater_script_search.xml
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="script search" title="Cerca Script" width="320">
- <check_box label="Senza distinzione tra maiuscole e minuscole" name="case_text" left="65"/>
- <button label="Cerca" label_selected="Cerca" name="search_btn" width="85"/>
- <button label="Sostituisci" label_selected="Sostituisci" name="replace_btn" left="100" width="85"/>
- <button label="Sostituisci tutto" label_selected="Sostituisci tutto" name="replace_all_btn" left="190" width="122"/>
- <text name="txt" width="60">
+<floater name="script search" title="Cerca Script">
+ <check_box label="Senza distinzione tra maiuscole e minuscole" name="case_text"/>
+ <button label="Cerca" label_selected="Cerca" name="search_btn"/>
+ <button label="Sostituisci" label_selected="Sostituisci" name="replace_btn"/>
+ <button label="Sostituisci tutto" label_selected="Sostituisci tutto" name="replace_all_btn"/>
+ <text name="txt">
Cerca
</text>
- <text name="txt2" width="60">
+ <text name="txt2">
Sostituisci
</text>
- <line_editor left="65" name="search_text" width="240" />
- <line_editor left="65" name="replace_text" width="240" />
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_telehub.xml b/indra/newview/skins/default/xui/it/floater_telehub.xml
index 0c5199dbc7..5de215522d 100644
--- a/indra/newview/skins/default/xui/it/floater_telehub.xml
+++ b/indra/newview/skins/default/xui/it/floater_telehub.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="telehub" title="Telehub" min_height="310" height="310" width="286">
+<floater name="telehub" title="Telehub">
<text name="status_text_connected">
Telehub connesso all&apos;oggetto [OBJECT]
</text>
@@ -10,23 +10,19 @@
Per rimuovere, clicca Disconnetti.
</text>
<text name="help_text_not_connected">
- Seleziona l&apos;oggetto e clicca Connetti Telehub.
+ Seleziona l&apos;oggetto e clicca connetti Telehub.
</text>
<button label="Connetti Telehub" name="connect_btn"/>
<button label="Disconnetti" name="disconnect_btn"/>
- <text name="spawn_points_text" width="265">
+ <text name="spawn_points_text">
Rigenera i punti (posizioni, non oggetti):
</text>
- <scroll_list name="spawn_points_list" width="265" />
- <button width="165" label="Aggiungi punti rigenerazione" name="add_spawn_point_btn"/>
- <button width="105" left="175" label="Rimuovi punti" name="remove_spawn_point_btn"/>
+ <button label="Aggiungi punti rigenerazione" name="add_spawn_point_btn"/>
+ <button label="Rimuovi punti rigenerazione" name="remove_spawn_point_btn"/>
<text name="spawn_point_help">
- Seleziona un oggetto e clicca su aggiungi per
-specificarne la posizione.
+ Seleziona un oggetto e clicca su aggiungi per specificarne la posizione.
Potrai quindi muovere o rimuovere l&apos;oggetto.
Le posizioni sono relative al centro del telehub.
-
-Seleziona un elemento per vederne la posizione
-globale.
+Seleziona un elemento per vederne la posizione globale.
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_top_objects.xml b/indra/newview/skins/default/xui/it/floater_top_objects.xml
index 470e21769c..ff6e9eb730 100644
--- a/indra/newview/skins/default/xui/it/floater_top_objects.xml
+++ b/indra/newview/skins/default/xui/it/floater_top_objects.xml
@@ -4,33 +4,30 @@
In caricamento...
</text>
<scroll_list name="objects_list">
- <column label="Punteggio" name="score" width="84"/>
- <column label="Nome" name="name" width="84"/>
- <column label="Proprietario" name="owner" width="84"/>
- <column label="Ubicazione" name="location" width="84"/>
- <column label="Ora" name="time" width="84"/>
- <column label="Ora (Mono)" name="mono_time" width="84"/>
+ <column label="Punteggio" name="score"/>
+ <column label="Nome" name="name"/>
+ <column label="Proprietario" name="owner"/>
+ <column label="Ubicazione" name="location"/>
+ <column label="Ora" name="time"/>
+ <column label="Ora (Mono)" name="mono_time"/>
</scroll_list>
- <line_editor font="SansSerifSmall" left="90" name="id_editor" width="280"/>
- <line_editor font="SansSerifSmall" left="90" name="object_name_editor" width="280"/>
- <line_editor font="SansSerifSmall" left="90" name="owner_name_editor" width="280"/>
<text name="id_text">
ID oggetto:
</text>
- <button label="Mostra segnali luminosi" name="show_beacon_btn" width="150"/>
+ <button label="Mostra segnali luminosi" name="show_beacon_btn"/>
<text name="obj_name_text">
Nome oggetto:
</text>
- <button label="Filtro" name="filter_object_btn" width="150"/>
+ <button label="Filtro" name="filter_object_btn"/>
<text name="owner_name_text">
Nome oggetto:
</text>
- <button label="Filtro" name="filter_owner_btn" width="150"/>
- <button label="Restituisci selezionato" name="return_selected_btn" width="150"/>
- <button label="Restituisci tutti" name="return_all_btn" left="170"/>
- <button label="Disabilita selezionato" name="disable_selected_btn" width="150"/>
- <button label="Disabilita per tutti" name="disable_all_btn" left="170"/>
- <button label="Aggiorna" name="refresh_btn" width="150"/>
+ <button label="Filtro" name="filter_owner_btn"/>
+ <button label="Restituisci selezionato" name="return_selected_btn"/>
+ <button label="Restituisci tutti" name="return_all_btn"/>
+ <button label="Disabilita selezionato" name="disable_selected_btn"/>
+ <button label="Disabilita per tutti" name="disable_all_btn"/>
+ <button label="Aggiorna" name="refresh_btn"/>
<string name="top_scripts_title">
Script pesanti
</string>
diff --git a/indra/newview/skins/default/xui/it/floater_url_entry.xml b/indra/newview/skins/default/xui/it/floater_url_entry.xml
index 9ad1a0dce5..2968b19d80 100644
--- a/indra/newview/skins/default/xui/it/floater_url_entry.xml
+++ b/indra/newview/skins/default/xui/it/floater_url_entry.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="url_entry" title="">
<text name="media_label">
- URL Media:
+ Media URL:
</text>
<button label="OK" name="ok_btn"/>
<button label="Annulla" name="cancel_btn"/>
- <button label="Elimina" name="clear_btn"/>
+ <button label="Cancella" name="clear_btn"/>
<text name="loading_label">
In caricamento...
</text>
diff --git a/indra/newview/skins/default/xui/it/floater_water.xml b/indra/newview/skins/default/xui/it/floater_water.xml
index 33f91ed1c8..6665d97e2a 100644
--- a/indra/newview/skins/default/xui/it/floater_water.xml
+++ b/indra/newview/skins/default/xui/it/floater_water.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Water Floater" title="Editor avanzato dell&apos;acqua">
- <text name="KeyFramePresetsText" width="224">
+ <text name="KeyFramePresetsText">
Impostazioni predeterminate dell&apos;acqua:
</text>
- <combo_box left_delta="230" name="WaterPresetsCombo" width="150" />
<button label="Nuovo" label_selected="Nuovo" name="WaterNewPreset"/>
<button label="Salva" label_selected="Salva" name="WaterSavePreset"/>
<button label="Cancella" label_selected="Cancella" name="WaterDeletePreset"/>
@@ -12,21 +11,20 @@
<text name="BHText">
Colore della nebbiosità dell&apos;acqua
</text>
- <button label="?" name="WaterFogColorHelp" left="209"/>
+ <button label="?" name="WaterFogColorHelp"/>
<color_swatch label="" name="WaterFogColor" tool_tip="Clicca per aprire la selezione colore"/>
- <text name="WaterFogDensText" font="SansSerifSmall">
- Esponente di densità della nebbia&#10; dell&apos;acqua
+ <text name="WaterFogDensText">
+ Esponente di densità  della nebbia dell&apos;acqua
</text>
- <slider bottom_delta="-40" name="WaterFogDensity"/>
- <button label="?" name="WaterFogDensityHelp" left="209"/>
- <text name="WaterUnderWaterFogModText" font="SansSerifSmall" bottom="-140">
+ <button label="?" name="WaterFogDensityHelp"/>
+ <text name="WaterUnderWaterFogModText">
Regolatore effetto nebbia subacquea
</text>
- <button label="?" name="WaterUnderWaterFogModHelp" left="209"/>
+ <button label="?" name="WaterUnderWaterFogModHelp"/>
<text name="BDensText">
Scala di riflessione delle onde
</text>
- <button label="?" name="WaterNormalScaleHelp" left="415"/>
+ <button label="?" name="WaterNormalScaleHelp"/>
<text name="BHText2">
1
</text>
@@ -39,31 +37,29 @@
<text name="HDText">
Scala Fresnel
</text>
- <button label="?" name="WaterFresnelScaleHelp" left="415"/>
+ <button label="?" name="WaterFresnelScaleHelp"/>
<text name="FresnelOffsetText">
Offset Fresnel
</text>
- <button label="?" name="WaterFresnelOffsetHelp" left="415"/>
- <text name="DensMultText" font="SansSerifSmall">
- Scala di rifrazione nell&apos;acqua&#10; dall&apos;alto
+ <button label="?" name="WaterFresnelOffsetHelp"/>
+ <text name="DensMultText">
+ Scala di rifrazione nell&apos;acqua dall&apos;alto
</text>
- <slider bottom_delta="-40" name="WaterScaleAbove"/>
- <button label="?" name="WaterScaleAboveHelp" left="650"/>
- <text name="WaterScaleBelowText" font="SansSerifSmall" bottom="-70">
- Scala di rifrazione nell&apos;acqua&#10; dal basso
+ <button label="?" name="WaterScaleAboveHelp"/>
+ <text name="WaterScaleBelowText">
+ Scala di rifrazione nell&apos;acqua dal basso
</text>
- <slider bottom_delta="-40" name="WaterScaleBelow"/>
- <button label="?" name="WaterScaleBelowHelp" left="650"/>
- <text name="MaxAltText" bottom="-122">
+ <button label="?" name="WaterScaleBelowHelp"/>
+ <text name="MaxAltText">
Moltiplicatore della sfocatura
</text>
- <button label="?" name="WaterBlurMultiplierHelp" left="650"/>
+ <button label="?" name="WaterBlurMultiplierHelp"/>
</panel>
<panel label="Immagine" name="Waves">
<text name="BHText">
Direzione della grande onda
</text>
- <button label="?" name="WaterWave1Help" left="170"/>
+ <button label="?" name="WaterWave1Help"/>
<text name="WaterWave1DirXText">
X
</text>
@@ -73,7 +69,7 @@
<text name="BHText2">
Direzione della piccola onda
</text>
- <button label="?" name="WaterWave2Help" left="170"/>
+ <button label="?" name="WaterWave2Help"/>
<text name="WaterWave2DirXText">
X
</text>
diff --git a/indra/newview/skins/default/xui/it/floater_windlight_options.xml b/indra/newview/skins/default/xui/it/floater_windlight_options.xml
index 5076c777dc..aa99e1d883 100644
--- a/indra/newview/skins/default/xui/it/floater_windlight_options.xml
+++ b/indra/newview/skins/default/xui/it/floater_windlight_options.xml
@@ -4,15 +4,15 @@
Cieli predefiniti:
</text>
<button label="Nuovo" label_selected="Nuovo" name="WLNewPreset"/>
- <button label="Salva" label_selected="Salva" name="WLSavePreset" left_delta="72"/>
- <button label="Elimina" label_selected="Elimina" name="WLDeletePreset" left_delta="72"/>
- <button font="SansSerifSmall" width="165" left_delta="85" label="Editor del ciclo giorno/notte" label_selected="Editor del ciclo giorno/notte" name="WLDayCycleMenuButton"/>
+ <button label="Salva" label_selected="Salva" name="WLSavePreset"/>
+ <button label="Elimina" label_selected="Elimina" name="WLDeletePreset"/>
+ <button label="Editor del ciclo giorno/notte" label_selected="Editor del ciclo giorno/notte" name="WLDayCycleMenuButton"/>
<tab_container name="WindLight Tabs">
<panel label="Atmosfera" name="Atmosphere">
<text name="BHText">
Blu dell&apos;Orizzonte
</text>
- <button label="?" name="WLBlueHorizonHelp" left="189"/>
+ <button label="?" name="WLBlueHorizonHelp"/>
<text name="BHText2">
R
</text>
@@ -25,14 +25,14 @@
<text name="BHText5">
I
</text>
- <text name="BDensText" font="SansSerifSmall">
+ <text name="BDensText">
Altezza della Foschia all&apos;Orizzonte
</text>
- <button label="?" name="WLHazeHorizonHelp" left="189" />
+ <button label="?" name="WLHazeHorizonHelp"/>
<text name="BDensText2">
Densità del Blu
</text>
- <button label="?" name="WLBlueDensityHelp" />
+ <button label="?" name="WLBlueDensityHelp"/>
<text name="BHText6">
R
</text>
@@ -52,15 +52,15 @@
<text name="DensMultText">
Moltiplicatore di Densità
</text>
- <button label="?" name="WLDensityMultHelp" left="645"/>
+ <button label="?" name="WLDensityMultHelp"/>
<text name="WLDistanceMultText">
Moltiplicatore della Distanza
</text>
- <button label="?" name="WLDistanceMultHelp" left="645"/>
+ <button label="?" name="WLDistanceMultHelp"/>
<text name="MaxAltText">
Altitudine Massima
</text>
- <button label="?" name="WLMaxAltitudeHelp" left="645"/>
+ <button label="?" name="WLMaxAltitudeHelp"/>
</panel>
<panel label="Illuminazione" name="Lighting">
<text name="SLCText">
@@ -151,15 +151,15 @@
<text name="WLCloudCoverageText">
Copertura delle Nuvole
</text>
- <button label="?" name="WLCloudCoverageHelp" left="415"/>
+ <button label="?" name="WLCloudCoverageHelp"/>
<text name="WLCloudScaleText">
Altitudine delle Nuvole
</text>
- <button label="?" name="WLCloudScaleHelp" left="415"/>
+ <button label="?" name="WLCloudScaleHelp"/>
<text name="WLCloudDetailText">
Dettagli Nuvole (XY/ Densità)
</text>
- <button label="?" name="WLCloudDetailHelp" left="415"/>
+ <button label="?" name="WLCloudDetailHelp"/>
<text name="BHText8">
X
</text>
@@ -170,17 +170,17 @@
D
</text>
<text name="WLCloudScrollXText">
- Scorrimento delle X
+ Scorrimento delle nuvole X
</text>
<button label="?" name="WLCloudScrollXHelp"/>
<check_box label="Blocca" name="WLCloudLockX"/>
<text name="WLCloudScrollYText">
- Scorrimento delle Y
+ Scorrimento delle nuvole Y
</text>
<button label="?" name="WLCloudScrollYHelp"/>
<check_box label="Blocca" name="WLCloudLockY"/>
<check_box label="Mostra le Nuvole Classiche" name="DrawClassicClouds"/>
- <button label="?" name="WLClassicCloudsHelp" left="645"/>
+ <button label="?" name="WLClassicCloudsHelp"/>
</panel>
</tab_container>
<string name="WLDefaultSkyNames">
diff --git a/indra/newview/skins/default/xui/it/panel_friends.xml b/indra/newview/skins/default/xui/it/panel_friends.xml
index e2eb3dd6e7..78e0d542f3 100644
--- a/indra/newview/skins/default/xui/it/panel_friends.xml
+++ b/indra/newview/skins/default/xui/it/panel_friends.xml
@@ -16,5 +16,5 @@
<button label="Teleport..." name="offer_teleport_btn" tool_tip="Offri a questo amico un teleport per dove sei tu ora"/>
<button label="Paga..." name="pay_btn" tool_tip="Dai Linden dollar (L$) a questo amico"/>
<button label="Rimuovi..." name="remove_btn" tool_tip="Rimuovi questa persona dalla tua lista amici"/>
- <button label="Aggiungi..." name="add_btn" tool_tip="Offri amicizia ad un residente"/>
+ <button label="Aggiungi come amico..." name="add_btn" tool_tip="Offri amicizia ad un residente"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_group_general.xml b/indra/newview/skins/default/xui/it/panel_group_general.xml
index 2c04ec776c..cc044a2e56 100644
--- a/indra/newview/skins/default/xui/it/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_general.xml
@@ -48,7 +48,7 @@ Passa il mouse sulle opzioni per un aiuto aggiuntivo.
<check_box label="Mostra nella ricerca" name="show_in_group_list" tool_tip="Lascia che i residenti vedano questo gruppo nella ricerca."/>
<check_box label="Iscrizione libera" name="open_enrollement" tool_tip="Imposta se questo gruppo permette ai nuovi membri di unirsi senza essere invitati."/>
<check_box label="Tassa di iscrizione: L$" name="check_enrollment_fee" tool_tip="Imposta se richiedere una tassa di iscrizione per unirsi al gruppo."/>
- <spinner width="60" left_delta="136" name="spin_enrollment_fee" tool_tip="I nuovi membri devono pagare questa tassa per unirsi al gruppo. La tassa di iscrizione è selezionata."/>
+ <spinner name="spin_enrollment_fee" tool_tip="I nuovi membri devono pagare questa tassa per unirsi al gruppo. La tassa di iscrizione è selezionata."/>
<combo_box name="group_mature_check" tool_tip="Imposta se le informazioni sul tuo gruppo sono da considerarsi Mature.">
<combo_item name="select_mature">
- Seleziona -
diff --git a/indra/newview/skins/default/xui/it/panel_group_invite.xml b/indra/newview/skins/default/xui/it/panel_group_invite.xml
index cc426f7cd2..d75b3a46e8 100644
--- a/indra/newview/skins/default/xui/it/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_invite.xml
@@ -2,8 +2,8 @@
<panel label="Invita una persona" name="invite_panel">
<text name="help_text">
Puoi selezionare più di un residente
-da invitare nel tuo gruppo. Clicca su
-&apos;Scelta residenti&apos; per iniziare.
+da invitare nel tuo gruppo. Clicca su &apos;Scelta
+residenti&apos; per iniziare.
</text>
<button label="Scelta residenti" name="add_button" tool_tip=""/>
<name_list name="invitee_list" tool_tip="Tieni premuto il tasto ctrl e clicca i nomi dei residenti per avere una selezione multipla."/>
diff --git a/indra/newview/skins/default/xui/it/panel_group_land_money.xml b/indra/newview/skins/default/xui/it/panel_group_land_money.xml
index 5f54d8cd25..907ce8ea5a 100644
--- a/indra/newview/skins/default/xui/it/panel_group_land_money.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_land_money.xml
@@ -13,7 +13,7 @@
<string name="loading_txt">
Attendi...
</string>
- <text name="group_land_heading" width="250">
+ <text name="group_land_heading">
Terra posseduta dal gruppo
</text>
<scroll_list name="group_parcel_list">
@@ -22,24 +22,24 @@
<column label="Tipo" name="type"/>
<column label="Area" name="area"/>
</scroll_list>
- <button label="Mostra sulla mappa" label_selected="Mostra sulla mappa" name="map_button" left="282" width="130"/>
+ <button label="Mostra sulla mappa" label_selected="Mostra sulla mappa" name="map_button"/>
<text name="total_contributed_land_label">
Total Contribution:
</text>
<text name="total_contributed_land_value">
- [AREA] m²
+ [AREA] metri quadri
</text>
<text name="total_land_in_use_label">
Terra totale in uso:
</text>
<text name="total_land_in_use_value">
- [AREA] m²
+ [AREA] metri quadri
</text>
<text name="land_available_label">
Terra disponibile:
</text>
<text name="land_available_value">
- [AREA] m²
+ [AREA] metri quadri
</text>
<text name="your_contribution_label">
Il tuo contributo:
@@ -48,11 +48,10 @@
Non è possibile impostare i tuoi contributi in terra.
</string>
<text name="your_contribution_max_value">
- m² ([AMOUNT] massimo)
+ metri quadri ([AMOUNT] massimo)
</text>
<text name="group_over_limit_text">
- I membri del gruppo devono contribuire con più crediti per mantenere
-la quantità  di terra in uso.
+ I membri del gruppo devono contribuire con più crediti per mantenere la quantità  di terra in uso.
</text>
<text name="group_money_heading">
L$ del gruppo
@@ -67,15 +66,15 @@ la quantità  di terra in uso.
<text_editor name="group_money_details_text">
Calcolo...
</text_editor>
- <button width="90" label="&lt; Precedente" label_selected="&lt; Precedente" name="earlier_details_button" tool_tip="Vai ai dettagli precedenti"/>
- <button left_delta="260" width="90" label="Successivo &gt;" label_selected="Successivo &gt;" name="later_details_button" tool_tip="Vai ai dettagli successivi"/>
+ <button label="&lt; Precedente" label_selected="&lt; Precedente" name="earlier_details_button" tool_tip="Vai ai dettagli precedenti"/>
+ <button label="Successivo &gt;" label_selected="Successivo &gt;" name="later_details_button" tool_tip="Vai ai dettagli successivi"/>
</panel>
<panel label="Vendite" name="group_money_sales_tab">
<text_editor name="group_money_sales_text">
Calcolo...
</text_editor>
- <button width="90" label="&lt; Precedente" label_selected="&lt; Precedente" name="earlier_sales_button" tool_tip="Vai ai dettagli precedenti"/>
- <button left_delta="260" width="90" label="Successivo &gt;" label_selected="Successivo &gt;" name="later_sales_button" tool_tip="Vai ai dettagli successivi"/>
+ <button label="&lt; Precedente" label_selected="&lt; Precedente" name="earlier_sales_button" tool_tip="Vai ai dettagli precedenti"/>
+ <button label="Successivo &gt;" label_selected="Successivo &gt;" name="later_sales_button" tool_tip="Vai ai dettagli successivi"/>
</panel>
</tab_container>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_group_notices.xml b/indra/newview/skins/default/xui/it/panel_group_notices.xml
index 6bf0f1e8c0..7f1f37d67e 100644
--- a/indra/newview/skins/default/xui/it/panel_group_notices.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_notices.xml
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Notice" name="notices_tab">
<string name="help_text">
- Le notice sono un modo veloce per comunicare in un gruppo diffondendo un messaggio e recapitando un eventuale oggetto allegato. Le notice arrivano solo ai membri del gruppo il cui ruolo è abilitato a riceverli.
-Puoi disattivare la ricezione delle notice nella finestra principale.
+ Le notice sono un modo veloce per comunicare in un
+gruppo diffondendo un messaggio e recapitando un
+eventuale oggetto allegato. Le notice arrivano solo ai
+membri del gruppo il cui ruolo è abilitato a riceverli.
+Puoi disattivare la ricezione delle notice
+nella finestra principale.
</string>
<string name="no_notices_text">
Non ci sono vecchie notice.
@@ -12,9 +16,9 @@ Puoi disattivare la ricezione delle notice nella finestra principale.
Archivio delle notice del gruppo
</text>
<text name="lbl2">
- Le notice sono conservate per 14 giorni. Clicca la notice qui sotto che desideri
-leggere. Clicca il bottone &apos;Aggiorna&apos; per controllare se sono arrivate nuove
-notice. Il numero delle notice è limitato a 200 notice per gruppo al giorno.
+ Le notice sono conservate per 14 giorni. Clicca la notice qui sotto che desideri leggere.
+Clicca il bottone &apos;Aggiorna&apos; per controllare se sono arrivate nuove notice.
+Il numero delle notice è limitato a 200 notice per gruppo al giorno.
</text>
<scroll_list name="notice_list">
<column label="Oggetto" name="subject"/>
@@ -32,22 +36,19 @@ notice. Il numero delle notice è limitato a 200 notice per gruppo al giorno.
</text>
<text name="lbl2">
Devi scrivere l&apos;oggetto della notice per poterla inviare.
-Puoi aggiungere un solo allegato alla notice trascinandolo dal
-tuo inventario in questa finestra. L&apos;allegato deve essere
-copiabile e cedibile, e non puoi allegare una cartella.
+Puoi aggiungere un solo allegato alla notice trascinandolo
+dal tuo inventario in questa finestra. L&apos;allegato deve essere copiabile e cedibile,
+e non puoi allegare una cartella.
</text>
- <text name="lbl3" left="20">
+ <text name="lbl3">
Oggetto:
</text>
- <line_editor name="create_subject" width="251" left_delta="61"/>
- <text name="lbl4" left="15" width="60">
+ <text name="lbl4">
Messaggio:
</text>
- <text_editor name="create_message" left_delta="66" width="330"/>
- <text name="lbl5" width="68">
+ <text name="lbl5">
Allega:
</text>
- <line_editor name="create_inventory_name" width="190" left_delta="74"/>
<button label="Rimuovi allegato" label_selected="Rimuovi allegato" name="remove_attachment"/>
<button label="Invia la notice" label_selected="Invia la notice" name="send_notice"/>
<panel name="drop_target" tool_tip="Trascina un oggetto dall&apos;inventario sulla casella del messaggio per inviarlo con la notice. Devi avere il permesso di copia e trasferimento dell&apos;oggetto per poterlo inviare con la notice."/>
@@ -57,7 +58,7 @@ copiabile e cedibile, e non puoi allegare una cartella.
Notice archiviate
</text>
<text name="lbl2">
- Per mandare una nuova notice, clicca &apos;Crea una nuova notice&apos; qui sopra.
+ Per mandare una nuova notice, clicca il bottone &apos;Crea una nuova notice&apos; qui sopra.
</text>
<text name="lbl3">
Oggetto:
diff --git a/indra/newview/skins/default/xui/it/panel_group_roles.xml b/indra/newview/skins/default/xui/it/panel_group_roles.xml
index 8dfdd5a46e..2629b91db5 100644
--- a/indra/newview/skins/default/xui/it/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_roles.xml
@@ -12,9 +12,8 @@
Membri &amp; Ruoli
</text>
<text name="static2">
- I membri del Gruppo hanno ricevuto ruoli con delle abilità. Queste
-impostazioni possono essere facilmente personalizzate, permettendo
-una maggiore organizzazione e flessibilità.
+ I membri del Gruppo hanno ricevuto ruoli con delle abilità. Queste impostazioni possono
+essere facilmente personalizzate, permettendo una maggiore organizzazione e flessibilità.
</text>
</panel>
<panel name="roles_header">
@@ -22,14 +21,12 @@ una maggiore organizzazione e flessibilità.
Ruoli
</text>
<text name="role_properties_modifiable">
- Seleziona un ruolo qui sotto. È possibile modificarne il nome,
-la descrizione e il titolo.
+ Seleziona un ruolo qui sotto. È possibile modificarne il nome, la descrizione e il titolo.
</text>
<text name="role_properties_not_modifiable">
- Seleziona un ruolo qui sotto per vederne le proprietà, i membri
-e i permessi abilitati.
+ Seleziona un ruolo qui sotto per vederne le proprietà, i membri e i permessi abilitati.
</text>
- <text bottom_delta="-28" name="role_actions_modifiable">
+ <text name="role_actions_modifiable">
Puoi anche assegnare abilità al ruolo.
</text>
<text name="role_actions_not_modifiable">
@@ -45,17 +42,16 @@ e i permessi abilitati.
eseguire tali abilità.
</text>
</panel>
- <tab_container height="164" name="roles_tab_container">
- <panel height="148" label="Membri" name="members_sub_tab" tool_tip="Membri">
- <line_editor bottom="127" name="search_text"/>
- <button label="Cerca" name="search_button" width="75"/>
- <button label="Mostra tutti" name="show_all_button" left_delta="80"/>
- <name_list name="member_list" bottom_delta="-105" height="104" >
+ <tab_container name="roles_tab_container">
+ <panel label="Membri" name="members_sub_tab" tool_tip="Membri">
+ <button label="Cerca" name="search_button"/>
+ <button label="Mostra tutti" name="show_all_button"/>
+ <name_list name="member_list">
<column label="Nome del membro" name="name"/>
<column label="Contributo donato" name="donated"/>
<column label="Ultimo accesso" name="online"/>
</name_list>
- <button label="Invita un nuovo membro..." name="member_invite" width="165"/>
+ <button label="Invita un nuovo membro ..." name="member_invite"/>
<button label="Espellere dal gruppo" name="member_eject"/>
<string name="help_text">
Puoi aggiungere o rimuovere i ruoli assegnati ai membri.
@@ -63,11 +59,10 @@ Seleziona più membri tenendo premuto il tasto Ctrl e
cliccando sui loro nomi.
</string>
</panel>
- <panel height="148" label="Ruoli" name="roles_sub_tab">
- <line_editor bottom="127" name="search_text"/>
- <button label="Cerca" name="search_button" width="75"/>
- <button label="Mostra tutti" name="show_all_button" left_delta="80"/>
- <scroll_list name="role_list" bottom_delta="-104" height="104">
+ <panel label="Ruoli" name="roles_sub_tab">
+ <button label="Cerca" name="search_button"/>
+ <button label="Mostra tutti" name="show_all_button"/>
+ <scroll_list name="role_list">
<column label="Nome del ruolo" name="name"/>
<column label="Titolo" name="title"/>
<column label="Membri" name="members"/>
@@ -84,11 +79,10 @@ compresi il ruolo base o &apos;Membro&apos; e il ruolo del Capogruppo.
I ruoli &apos;Membro&apos; e &apos;Capogruppo&apos; sono ruoli speciali e non possono essere eliminati.
</string>
</panel>
- <panel height="148" label="Abilità" name="actions_sub_tab">
- <line_editor bottom="127" name="search_text"/>
- <button label="Cerca" name="search_button" width="75"/>
- <button label="Visualizza tutto" name="show_all_button" left_delta="80"/>
- <scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Seleziona una abilità per vederne maggiori dettagli."/>
+ <panel label="Abilità" name="actions_sub_tab">
+ <button label="Cerca" name="search_button"/>
+ <button label="Visualizza tutto" name="show_all_button"/>
+ <scroll_list name="action_list" tool_tip="Seleziona una abilità per vederne maggiori dettagli."/>
<string name="help_text">
Le abilità permettono ai membri nei ruoli di fare cose specifiche
in questo gruppo. C&apos;è una vasta gamma di abilità.
diff --git a/indra/newview/skins/default/xui/it/panel_groups.xml b/indra/newview/skins/default/xui/it/panel_groups.xml
index 43fd36710e..75bccb71a3 100644
--- a/indra/newview/skins/default/xui/it/panel_groups.xml
+++ b/indra/newview/skins/default/xui/it/panel_groups.xml
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="groups">
- <scroll_list bottom="50" name="group list"/>
- <text bottom="16" height="32" name="groupdesc" width="268">
- Il tuo gruppo attualmente attivo è visualizzato
-in grassetto.
+ <text name="groupdesc">
+ Il tuo gruppo attualmente attivo è visualizzato in grassetto.
</text>
- <text bottom="3" name="groupcount" width="268">
- Appartieni a [COUNT] gruppo/i (su un massimo di [MAX]).
+ <text name="groupcount">
+ Appartieni a [COUNT] gruppi (su un massimo di [MAX]).
</text>
<button label="IM/Chiama" name="IM" tool_tip="Apri una sessione di IM/Instant Messages"/>
<button label="Informazioni" name="Info"/>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_general.xml b/indra/newview/skins/default/xui/it/panel_preferences_general.xml
index aadd86d055..620cd33c0a 100644
--- a/indra/newview/skins/default/xui/it/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_general.xml
@@ -10,15 +10,9 @@
</radio_group>
<check_box label="Mostra il punto di partenza nella schermata d&apos;inizio" name="show_location_checkbox"/>
<combo_box name="fade_out_combobox" width="166">
- <combo_item name="Never">
- Mai
- </combo_item>
- <combo_item name="Show Temporarily">
- Mostra temporanemente
- </combo_item>
- <combo_item name="Always">
- Sempre
- </combo_item>
+ <combo_box.item name="Never" label="Mai"/>
+ <combo_box.item name="Show Temporarily" label="Mostra temporanemente"/>
+ <combo_box.item name="Always" label="Sempre"/>
</combo_box>
<check_box label="Nomi avatar in piccolo" name="small_avatar_names_checkbox"/>
<check_box label="Nascondi il mio nome sul mio schermo" name="show_my_name_checkbox"/>
@@ -80,50 +74,29 @@ contenuto di tipo:
&lt;Scrivi il nome della regione&gt;
</string>
<combo_box name="crash_behavior_combobox" width="166">
- <combo_item name="Askbeforesending">
- Chiedi prima di inviare
- </combo_item>
- <combo_item name="Alwayssend">
- Invia sempre
- </combo_item>
- <combo_item name="Neversend">
- Non inviare mai
- </combo_item>
+ <combo_box.item name="Askbeforesending" label="Chiedi prima di inviare"/>
+ <combo_box.item name="Alwayssend" label="Invia sempre"/>
+ <combo_box.item name="Neversend" label="Non inviare mai"/>
</combo_box>
<combo_box name="language_combobox" width="166">
- <combo_item name="System Default Language">
- Default di sistema
- </combo_item>
- <combo_item name="English">
- English
- </combo_item>
- <combo_item name="Danish">
- Dansk (Danese) - Beta
- </combo_item>
- <combo_item name="Deutsch(German)">
- Deutsch (Tedesco) - Beta
- </combo_item>
- <combo_item name="Spanish">
- Español (Spagnolo) - Beta
- </combo_item>
- <combo_item name="French">
- Français (Francese) - Beta
- </combo_item>
+ <combo_box.item name="System Default Language" label="Default di sistema"/>
+ <combo_box.item name="English" label="English"/>
+ <combo_box.item name="Danish" label="Dansk (Danese) - Beta"/>
+ <combo_box.item name="Deutsch(German)" label="Deutsch (Tedesco) - Beta"/>
+ <combo_box.item name="Spanish" label="Español (Spagnolo) - Beta"/>
+ <combo_box.item name="French" label="Français (Francese) - Beta"/>
+ <combo_box.item name="Hungarian" label="Magyar (Ungherese) - Beta"/>
+ <combo_box.item name="Polish" label="Polski (Polacco) - Beta"/>
+ <combo_box.item name="Portugese" label="Portugués (Portoghese) - Beta"/>
+ <combo_box.item name="Chinese" label="中文 (简体) (Cinese) - Beta"/>
+ <combo_box.item name="(Japanese)" label="日本語 (Giapponese) - Beta"/>
+ <combo_box.item name="(Korean)" label="한국어 (Coreano) - Beta"/>
<combo_item name="Italian">
Italiano - Beta
</combo_item>
- <combo_item name="Hungarian">
- Magyar (Ungherese) - Beta
- </combo_item>
<combo_item name="Dutch">
Nederlands (Olandese) - Beta
</combo_item>
- <combo_item name="Polish">
- Polski (Polacco) - Beta
- </combo_item>
- <combo_item name="Portugese">
- Portugués (Portoghese) - Beta
- </combo_item>
<combo_item name="Russian">
Русский (Russo) - Beta
</combo_item>
@@ -133,15 +106,6 @@ contenuto di tipo:
<combo_item name="Ukrainian">
Українська (Ukraino) - Beta
</combo_item>
- <combo_item name="Chinese">
- 中文 (简体) (Cinese) - Beta
- </combo_item>
- <combo_item name="(Japanese)">
- 日本語 (Giapponese) - Beta
- </combo_item>
- <combo_item name="(Korean)">
- 한국어 (Coreano) - Beta
- </combo_item>
</combo_box>
<check_box label="Condividi la tua lingua con gli oggetti" name="language_is_public" tool_tip="Questo fa in modo che gli oggetti inworld riconoscano la tua lingua."/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_region_covenant.xml b/indra/newview/skins/default/xui/it/panel_region_covenant.xml
index 9dfecde317..802156ea0b 100644
--- a/indra/newview/skins/default/xui/it/panel_region_covenant.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_covenant.xml
@@ -22,17 +22,15 @@
Ultima modifica Merc 31 Dic 1969 16:00:00
</text>
<button label="?" name="covenant_help"/>
- <text_editor name="covenant_editor" bottom="-247" height="162" >
+ <text_editor name="covenant_editor">
Per questa proprietà non è stato emesso alcun regolamento.
</text_editor>
<button label="Ripristina" name="reset_covenant"/>
- <text bottom="-25" name="covenant_help_text">
- Le modifiche nel regolamento saranno visibili su tutti i terreni
- della proprietà.
+ <text name="covenant_help_text">
+ Le modifiche nel regolamento saranno visibili su tutti i terreni della proprietà.
</text>
- <text bottom_delta="-36" name="covenant_instructions">
- Trascina e rilascia una notecard per cambiare il regolamento di
- questa proprietà.
+ <text name="covenant_instructions">
+ Trascina e rilascia una notecard per cambiare il regolamento di questa proprietà.
</text>
<text name="region_section_lbl">
Regione:
@@ -40,31 +38,31 @@
<text name="region_name_lbl">
Nome:
</text>
- <text name="region_name_text" left="126">
+ <text name="region_name_text">
leyla
</text>
<text name="region_landtype_lbl">
Tipo:
</text>
- <text name="region_landtype_text" left="126">
+ <text name="region_landtype_text">
Mainland / Homestead
</text>
- <text name="region_maturity_lbl" width="115">
+ <text name="region_maturity_lbl">
Categoria di accesso:
</text>
- <text name="region_maturity_text" left="126">
+ <text name="region_maturity_text">
Adult
</text>
<text name="resellable_lbl">
Rivendita:
</text>
- <text name="resellable_clause" left="126">
+ <text name="resellable_clause">
La terra in questa regione non può essere rivenduta.
</text>
<text name="changeable_lbl">
Suddividi:
</text>
- <text name="changeable_clause" left="126">
+ <text name="changeable_clause">
La terra in questa regione non può essere unita/suddivisa.
</text>
<string name="can_resell">
@@ -74,11 +72,9 @@
Un terreno acquistato in questa regione non può essere rivenduto.
</string>
<string name="can_change">
- Un terreno acquistato in questa regione può essere unito o
-suddiviso.
+ Un terreno acquistato in questa regione può essere unito o suddiviso.
</string>
<string name="can_not_change">
- Un terreno acquistato in questa regione non può essere unito o
-suddiviso.
+ Un terreno acquistato in questa regione non può essere unito o suddiviso.
</string>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_region_debug.xml b/indra/newview/skins/default/xui/it/panel_region_debug.xml
index 85fb968ab4..fddc14e85c 100644
--- a/indra/newview/skins/default/xui/it/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_debug.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Debug" name="Debug">
+<panel label="Debug - individuazione errori" name="Debug">
<text name="region_text_lbl">
Regione:
</text>
@@ -13,7 +13,7 @@
<check_box label="Disabilita la fisica" name="disable_physics_check" tool_tip="Disabilita tutta la fisica dei corpi in questa regione"/>
<button label="?" name="disable_physics_help"/>
<button label="Applica" name="apply_btn"/>
- <text name="objret_text_lbl" width="130">
+ <text name="objret_text_lbl">
Restituisci oggetti
</text>
<text name="resident_text_lbl">
@@ -30,10 +30,10 @@
<check_box label="Restituisci solo gli oggetti che sono sulle terre altrui" name="return_other_land" tool_tip="Restituisci solo gli oggetti che sono in terreni appartenenti a qualcun altro"/>
<check_box label="Restituisci gli oggetti in ogni regione di questi possedimenti" name="return_estate_wide" tool_tip="Restituisci tutti gli oggetti nelle varie regioni che costituiscono l&apos;insieme dei possedimenti terrieri"/>
<button label="Restituisci" name="return_btn"/>
- <button width="280" label="Visualizza l&apos;elenco dei maggiori collidenti..." name="top_colliders_btn" tool_tip="Elenco degli oggetti che stanno potenzialmente subendo le maggiori collisioni"/>
- <button label="?" name="top_colliders_help" left="297"/>
- <button width="280" label="Visualizza l&apos;elenco degli script più pesanti..." name="top_scripts_btn" tool_tip="Elenco degli oggetti che impiegano più tempo a far girare gli script"/>
- <button label="?" name="top_scripts_help" left="297"/>
+ <button label="Visualizza l&apos;elenco dei maggiori collidenti..." name="top_colliders_btn" tool_tip="Elenco degli oggetti che stanno potenzialmente subendo le maggiori collisioni"/>
+ <button label="?" name="top_colliders_help"/>
+ <button label="Visualizza l&apos;elenco degli script più pesanti..." name="top_scripts_btn" tool_tip="Elenco degli oggetti che impiegano più tempo a far girare gli script"/>
+ <button label="?" name="top_scripts_help"/>
<button label="Riavvia la regione" name="restart_btn" tool_tip="Dai 2 minuti di tempo massimo e fai riavviare la regione"/>
<button label="?" name="restart_help"/>
<button label="Ritarda il riavvio" name="cancel_restart_btn" tool_tip="Ritarda il riavvio della regione di un&apos;ora"/>
diff --git a/indra/newview/skins/default/xui/it/panel_region_estate.xml b/indra/newview/skins/default/xui/it/panel_region_estate.xml
index 5b95b7378b..a27e3a716c 100644
--- a/indra/newview/skins/default/xui/it/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_estate.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Proprietà immobiliari" name="Estate">
<text name="estate_help_text">
- I cambiamenti alle impostazioni in questa finestra
-avranno effetto su tutte le regioni della proprietà.
+ I cambiamenti alle impostazioni in questa finestra avranno effetto su tutte
+le regioni della proprietà.
</text>
- <text name="estate_text" width="140">
+ <text name="estate_text">
Proprietà immobiliari:
</text>
<text name="estate_name">
@@ -24,15 +24,15 @@ avranno effetto su tutte le regioni della proprietà.
<check_box label="Permetti accesso pubblico" name="externally_visible_check"/>
<button label="?" name="externally_visible_help"/>
<text name="Only Allow">
- Limita l&apos;accesso a residenti...
+ Limita l&apos;accesso a:
</text>
- <check_box label="che hanno dato info. di pagamento" name="limit_payment" tool_tip="Blocca residenti non identificati."/>
+ <check_box label="residenti che hanno dato informazioni di pagamento" name="limit_payment" tool_tip="Blocca residenti non identificati."/>
<check_box label="Adulti con età verificata" name="limit_age_verified" tool_tip="Blocca residenti che non hanno verificato la loro età. Per maggiori informazioni vai a support.secondlife.com."/>
<check_box label="Permetti la chat voice" name="voice_chat_check"/>
<button label="?" name="voice_chat_help"/>
<check_box label="Permetti teleport diretto" name="allow_direct_teleport"/>
<button label="?" name="allow_direct_teleport_help"/>
- <text name="abuse_email_text" width="230">
+ <text name="abuse_email_text">
Indirizzo email per la denuncia di abuso:
</text>
<string name="email_unsupported">
@@ -40,8 +40,8 @@ avranno effetto su tutte le regioni della proprietà.
</string>
<button label="?" name="abuse_email_address_help"/>
<button label="Applica" name="apply_btn"/>
- <button font="SansSerifSmall" label="Espelli persona dalle proprietà..." name="kick_user_from_estate_btn"/>
- <button font="SansSerifSmall" label="Manda un messaggio di le proprietà..." name="message_estate_btn"/>
+ <button label="Espelli persona dalle proprietà..." name="kick_user_from_estate_btn"/>
+ <button label="Manda un messaggio ai residenti di tutte le tue proprietà..." name="message_estate_btn"/>
<text name="estate_manager_label">
Manager delle proprietà:
</text>
diff --git a/indra/newview/skins/default/xui/it/panel_region_general.xml b/indra/newview/skins/default/xui/it/panel_region_general.xml
index d3afc1c63a..fffe51770e 100644
--- a/indra/newview/skins/default/xui/it/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_general.xml
@@ -3,19 +3,19 @@
<text name="region_text_lbl">
Regione:
</text>
- <text name="region_text" left="70">
+ <text name="region_text">
sconosciuta
</text>
<text name="version_channel_text_lbl">
Versione:
</text>
- <text name="version_channel_text" left="70">
+ <text name="version_channel_text">
sconosciuta
</text>
<text name="region_type_lbl">
Tipo:
</text>
- <text name="region_type" left="70">
+ <text name="region_type">
sconosciuto
</text>
<check_box label="Proibisci la modifica del terreno" name="block_terraform_check"/>
@@ -27,19 +27,19 @@
<check_box label="Limita gli urti" name="restrict_pushobject"/>
<button label="?" name="restrict_pushobject_help"/>
<check_box label="Abilita la rivendita del terreno" name="allow_land_resell_check"/>
- <button label="?" name="land_resell_help" left="260"/>
+ <button label="?" name="land_resell_help"/>
<check_box label="Abilita unione/suddivisione del terreno" name="allow_parcel_changes_check"/>
- <button label="?" name="parcel_changes_help" left="260" />
+ <button label="?" name="parcel_changes_help"/>
<check_box label="Proibisci che il terreno appaia nelle ricerche" name="block_parcel_search_check" tool_tip="Permetti che le persone vedano questa regione e le sue suddivisioni nei risultati delle ricerche"/>
- <button label="?" name="parcel_search_help" left="260"/>
- <spinner label="Limite massimo di avatar" name="agent_limit_spin" label_width="135" width="190"/>
+ <button label="?" name="parcel_search_help"/>
+ <spinner label="Limite massimo di avatar" name="agent_limit_spin"/>
<button label="?" name="agent_limit_help"/>
- <spinner label="Bonus di oggetti" name="object_bonus_spin" label_width="135" width="190"/>
+ <spinner label="Bonus di oggetti" name="object_bonus_spin"/>
<button label="?" name="object_bonus_help"/>
- <text label="Maturità" name="access_text" width="120">
+ <text label="Maturità" name="access_text">
Categoria di accesso:
</text>
- <combo_box label="Mature" name="access_combo" left="126" width="74">
+ <combo_box label="Mature" name="access_combo">
<combo_item name="Adult">
Adult
</combo_item>
@@ -55,5 +55,5 @@
<button label="Teletrasporta a casa un utente..." name="kick_btn"/>
<button label="Teletrasporta a casa tutti gli utenti..." name="kick_all_btn"/>
<button label="Invia messaggio alla regione..." name="im_btn"/>
- <button label="Gestisci snodo di teleport..." name="manage_telehub_btn" width="210"/>
+ <button label="Gestisci snodo di teleport..." name="manage_telehub_btn"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_region_terrain.xml b/indra/newview/skins/default/xui/it/panel_region_terrain.xml
index 92044bae11..70072275eb 100644
--- a/indra/newview/skins/default/xui/it/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_terrain.xml
@@ -8,9 +8,9 @@
</text>
<spinner label="Altezza dell&apos;acqua" name="water_height_spin"/>
<button label="?" name="water_height_help"/>
- <spinner label="Limite di altezza del &#10;terreno" name="terrain_raise_spin"/>
+ <spinner label="Limite di altezza del terreno" name="terrain_raise_spin"/>
<button label="?" name="terrain_raise_help"/>
- <spinner label="Limite di abbassamento &#10;del terreno" name="terrain_lower_spin" bottom_delta="-34"/>
+ <spinner label="Limite di abbassamento del terreno" name="terrain_lower_spin"/>
<button label="?" name="terrain_lower_help"/>
<check_box label="Usa il sole della regione" name="use_estate_sun_check"/>
<button label="?" name="use_estate_sun_help"/>
@@ -22,6 +22,6 @@
<button label="?" name="download_raw_help"/>
<button label="Carica terreno RAW..." name="upload_raw_btn" tool_tip="Disponibile solo per i proprietari del terreno, non per i manager"/>
<button label="?" name="upload_raw_help"/>
- <button width="170" label="Trasforma il terreno" name="bake_terrain_btn" tool_tip="Imposta il terreno corrente come punto medio per i limiti di innalzamento/abbassamento"/>
- <button left="190" label="?" name="bake_terrain_help"/>
+ <button label="Trasforma il terreno" name="bake_terrain_btn" tool_tip="Imposta il terreno corrente come punto medio per i limiti di innalzamento/abbassamento"/>
+ <button label="?" name="bake_terrain_help"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_region_texture.xml b/indra/newview/skins/default/xui/it/panel_region_texture.xml
index 254700e9f1..4e39db9b1d 100644
--- a/indra/newview/skins/default/xui/it/panel_region_texture.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_texture.xml
@@ -6,7 +6,7 @@
<text name="region_text">
sconosciuto
</text>
- <text name="detail_texture_text" width="380">
+ <text name="detail_texture_text">
Texture del terreno (è necessario siano 512x512, 24 bit .tga files)
</text>
<text name="height_text_lbl">
@@ -48,10 +48,10 @@
Questi valori rappresentano l&apos;intervallo di miscelazione delle texture qui sopra.
</text>
<text name="height_text_lbl11">
- Misurato in metri, il valore più BASSO corrisponde all&apos;altezza MASSIMA della
+ Misurato in metri, il valore più BASSO corrisponde all&apos;altezza MASSIMA della Texture #1,
</text>
<text name="height_text_lbl12">
-   Texture #1, e il valore più ALTO all&apos;altezza MINIMA della Texture #4.
+ e il valore più ALTO all&apos;altezza MINIMA della Texture #4.
</text>
<button label="Applica" name="apply_btn"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/teleport_strings.xml b/indra/newview/skins/default/xui/it/teleport_strings.xml
index 57e81bc41e..4ef802dc5b 100644
--- a/indra/newview/skins/default/xui/it/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/it/teleport_strings.xml
@@ -25,7 +25,7 @@ www.secondlife.com/support
Gli oggetti da te indossati non sono ancoa arrivati. Attendi ancora qualche secondo o scollegati e ricollegati prima di provare a teleportarti.
</message>
<message name="too_many_uploads_tport">
- Il server della regione è al momento occupato e la tua richiesta di teletrasporto non può essere soddisfatta entro breve tempo. Per favore prova di nuovo tra qualche minuto o spostati in un&apos;area meno affollata.
+ La gestione dati della regione è al momento occupata e la tua richiesta di teletrasporto non può essere soddisfatta entro breve tempo. Per favore prova di nuovo tra qualche minuto o spostati in un&apos;area meno affollata.
</message>
<message name="expired_tport">
Spiacenti, il sistema non riesce a soddisfare la tua richiesta di teletrasporto entro un tempo ragionevole. Riprova tra qualche minuto.
@@ -42,34 +42,34 @@ www.secondlife.com/support
</message_set>
<message_set name="progress">
<message name="sending_dest">
- In invio a destinazione.
+ In invio verso la destinazione.
</message>
<message name="redirecting">
In reindirizzamento ad una nuova destinazione.
</message>
<message name="relaying">
- In reinvio a destinazione.
+ In ritrasmissione alla destinazione.
</message>
<message name="sending_home">
- In invio verso la destinazione casa.
+ In invio la richiesta di ubicazione casa.
</message>
<message name="sending_landmark">
- In invio verso la destinazione del landmark.
+ In invio la richiesta della destinazione del landmark.
</message>
<message name="completing">
Teletrasporto completato
</message>
<message name="resolving">
- Elaborazione della destinazione in corso...
+ Destinazione in elaborazione.
</message>
<message name="contacting">
- Contattando la nuova regione.
+ Si sta contattando la nuova regione.
</message>
<message name="arriving">
- In arrivo a destinazione...
+ In arrivo...
</message>
<message name="requesting">
- Avvio teletrasporto....
+ Teletrasporto in avvio...
</message>
</message_set>
</teleport_messages>
diff --git a/indra/newview/skins/default/xui/ja/floater_about_land.xml b/indra/newview/skins/default/xui/ja/floater_about_land.xml
index c8195d8f38..26c8a46270 100644
--- a/indra/newview/skins/default/xui/ja/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/ja/floater_about_land.xml
@@ -345,42 +345,18 @@
</combo_item>
</combo_box>
<combo_box name="land category">
- <combo_item name="AnyCategory">
- 全カテゴリー
- </combo_item>
- <combo_item name="LindenLocation">
- Linden所在地
- </combo_item>
- <combo_item name="Arts&amp;Culture">
- アート&amp;カルチャー
- </combo_item>
- <combo_item name="Business">
- ビジネス
- </combo_item>
- <combo_item name="Educational">
- 教育的
- </combo_item>
- <combo_item name="Gaming">
- ゲーム
- </combo_item>
- <combo_item name="Hangout">
- たまり場
- </combo_item>
- <combo_item name="NewcomerFriendly">
- 新住人に好意的
- </combo_item>
- <combo_item name="Parks&amp;Nature">
- 公園と自然
- </combo_item>
- <combo_item name="Residential">
- 住宅用
- </combo_item>
- <combo_item name="Shopping">
- ショッピング
- </combo_item>
- <combo_item name="Other">
- その他
- </combo_item>
+ <combo_box.item name="AnyCategory" label="全カテゴリー"/>
+ <combo_box.item name="LindenLocation" label="Linden所在地"/>
+ <combo_box.item name="Arts&amp;Culture" label="アート&amp;カルチャー"/>
+ <combo_box.item name="Business" label="ビジネス"/>
+ <combo_box.item name="Educational" label="教育的"/>
+ <combo_box.item name="Gaming" label="ゲーム"/>
+ <combo_box.item name="Hangout" label="たまり場"/>
+ <combo_box.item name="NewcomerFriendly" label="新住人に好意的"/>
+ <combo_box.item name="Parks&amp;Nature" label="公園と自然"/>
+ <combo_box.item name="Residential" label="住宅用"/>
+ <combo_box.item name="Shopping" label="ショッピング"/>
+ <combo_box.item name="Other" label="その他"/>
</combo_box>
<button label="?" label_selected="?" name="?"/>
<check_box label="Matureコンテンツ" name="MatureCheck" tool_tip=""/>
@@ -412,15 +388,9 @@
テレポート制限:
</text>
<combo_box name="landing type" tool_tip="Teleport Routing -- select how to handle teleports onto your land.">
- <combo_item length="1" name="Blocked" type="string">
- 不可
- </combo_item>
- <combo_item length="1" name="LandingPoint" type="string">
- 着地点
- </combo_item>
- <combo_item length="1" name="Anywhere" type="string">
- どこでも
- </combo_item>
+ <combo_box.item length="1" name="Blocked" type="string" label="不可"/>
+ <combo_box.item length="1" name="LandingPoint" type="string" label="着地点"/>
+ <combo_box.item length="1" name="Anywhere" type="string" label="どこでも"/>
</combo_box>
<string name="push_restrict_text">
プッシングを制限
@@ -499,12 +469,8 @@
<check_box label="グループ・アクセスを許可:[GROUP]" name="GroupCheck" tool_tip="[一般]タブで、グループを選択してください。"/>
<check_box label="入場許可を販売:" name="PassCheck" tool_tip="この区画への一時的なアクセスを許可"/>
<combo_box name="pass_combo">
- <combo_item name="Anyone">
- 誰でも
- </combo_item>
- <combo_item name="Group">
- グループ
- </combo_item>
+ <combo_box.item name="Anyone" label="誰でも"/>
+ <combo_box.item name="Group" label="グループ"/>
</combo_box>
<spinner label="価格(L$):" name="PriceSpin"/>
<spinner label="アクセス時間:" name="HoursSpin"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_buy_contents.xml b/indra/newview/skins/default/xui/ja/floater_buy_contents.xml
index 8bf660d71d..1ea10324b3 100644
--- a/indra/newview/skins/default/xui/ja/floater_buy_contents.xml
+++ b/indra/newview/skins/default/xui/ja/floater_buy_contents.xml
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<floater name="floater_buy_contents" title="コンテンツを購入" width="340" min_width="340">
- <text name="contains_text" width="320">
+<floater name="floater_buy_contents" title="コンテンツを購入">
+ <text name="contains_text">
[NAME]の内容:
</text>
- <scroll_list name="item_list" width="310"/>
- <text name="buy_text" width="320">
+ <text name="buy_text">
コンテンツを[NAME]からL$[AMOUNT]で購入しますか?
</text>
- <button label="取り消し" label_selected="取り消し" name="cancel_btn" width="73"/>
- <button label="購入" label_selected="購入" name="buy_btn" width="73" left_delta="-77"/>
- <check_box label="今すぐ服を着る" name="wear_check" left_delta="-125"/>
+ <button label="取り消し" label_selected="取り消し" name="cancel_btn" />
+ <button label="購入" label_selected="購入" name="buy_btn" />
+ <check_box label="今すぐ服を着る" name="wear_check" />
<text name="no_copy_text">
(コピーなし)
</text>
diff --git a/indra/newview/skins/default/xui/ja/floater_wearable_save_as.xml b/indra/newview/skins/default/xui/ja/floater_wearable_save_as.xml
index 693446b21a..8286d29973 100644
--- a/indra/newview/skins/default/xui/ja/floater_wearable_save_as.xml
+++ b/indra/newview/skins/default/xui/ja/floater_wearable_save_as.xml
@@ -6,6 +6,6 @@
アイテムを別名で保存:
</text>
<line_editor name="name ed">
- New [DESC]
+ 新規[DESC]
</line_editor>
</floater>
diff --git a/indra/newview/skins/default/xui/ja/panel_group_land_money.xml b/indra/newview/skins/default/xui/ja/panel_group_land_money.xml
index 019d42c40a..f55dbf9009 100644
--- a/indra/newview/skins/default/xui/ja/panel_group_land_money.xml
+++ b/indra/newview/skins/default/xui/ja/panel_group_land_money.xml
@@ -52,8 +52,7 @@
平方メートル ([AMOUNT]最大)
</text>
<text name="group_over_limit_text">
- 使用中の土地をサポートするには、グループ・メンバーがさらに多
-くの土地クレジットを提供する必要があります。
+ 使用中の土地をサポートするには、グループ・メンバーがさらに多くの土地クレジットを提供する必要があります。
</text>
<text name="group_money_heading">
グループL$
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
index 83b21b87d2..3e3d62640f 100644
--- a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
@@ -10,15 +10,9 @@
</radio_group>
<check_box label="ログイン画面にログイン位置を表示" name="show_location_checkbox"/>
<combo_box name="fade_out_combobox">
- <combo_item name="Never">
- なし
- </combo_item>
- <combo_item name="Show Temporarily">
- 一時的に表示
- </combo_item>
- <combo_item name="Always">
- いつも
- </combo_item>
+ <combo_box.item name="Never" label="なし"/>
+ <combo_box.item name="Show Temporarily" label="一時的に表示"/>
+ <combo_box.item name="Always" label="いつも"/>
</combo_box>
<check_box label="小さなアバター名" name="small_avatar_names_checkbox"/>
<check_box label="画面上で自分の名前を隠す" name="show_my_name_checkbox"/>
@@ -79,68 +73,34 @@
&lt;地域の名前入力&gt;
</string>
<combo_box name="crash_behavior_combobox">
- <combo_item length="1" name="Askbeforesending" type="string">
- 送る前に確認する
- </combo_item>
- <combo_item length="1" name="Alwayssend" type="string">
- 常に送信
- </combo_item>
- <combo_item length="1" name="Neversend" type="string">
- 送信しない
- </combo_item>
+ <combo_box.item length="1" name="Askbeforesending" type="string" label="送る前に確認する"/>
+ <combo_box.item length="1" name="Alwayssend" type="string" label="常に送信"/>
+ <combo_box.item length="1" name="Neversend" type="string" label="送信しない"/>
</combo_box>
<combo_box name="language_combobox">
- <combo_item length="1" name="System Default Language" type="string">
- システム・デフォルト
- </combo_item>
- <combo_item length="1" name="English" type="string">
- English (英語)
- </combo_item>
- <combo_item length="1" name="Danish" type="string">
- Dansk (デンマーク語) – ベータ
- </combo_item>
- <combo_item length="1" name="Deutsch(German)" type="string">
- Deutsch (ドイツ語) – ベータ
- </combo_item>
- <combo_item length="1" name="Spanish" type="string">
- Español (スペイン語) – ベータ
- </combo_item>
- <combo_item length="1" name="French" type="string">
- Français (フランス語) – ベータ
- </combo_item>
+ <combo_box.item length="1" name="System Default Language" type="string" label="システム・デフォルト"/>
+ <combo_box.item length="1" name="English" type="string" label="English (英語)"/>
+ <combo_box.item length="1" name="Danish" type="string" label="Dansk (デンマーク語) – ベータ"/>
+ <combo_box.item length="1" name="Deutsch(German)" type="string" label="Deutsch (ドイツ語) – ベータ"/>
+ <combo_box.item length="1" name="Spanish" type="string" label="Español (スペイン語) – ベータ"/>
+ <combo_box.item length="1" name="French" type="string" label="Français (フランス語) – ベータ"/>
+ <combo_box.item name="Hungarian" label="Magyar (ハンガリー語) - ベータ"/>
+ <combo_box.item name="Polish" label="Polski (ポーランド語) - ベータ"/>
+ <combo_box.item length="1" name="Portugese" type="string" label="Português (ポルトガル語) – ベータ"/>
+ <combo_box.item name="Russian" label="Русский (ロシア語) - ベータ"/>
+ <combo_box.item name="Ukrainian" label="Українська (ウクライナ語) - ベータ"/>
+ <combo_box.item length="1" name="Chinese" type="string" label="中文 (简体) (中国語) - ベータ"/>
+ <combo_box.item length="1" name="(Japanese)" type="string" label="日本語 – ベータ"/>
+ <combo_box.item length="1" name="(Korean)" type="string" label="한국어 (韓国語) – ベータ"/>
<combo_item name="Italian">
Italiano (イタリア語) - ベータ
</combo_item>
- <combo_item name="Hungarian">
- Magyar (ハンガリー語) - ベータ
- </combo_item>
<combo_item name="Dutch">
Nederlands (オランダ語) - ベータ
</combo_item>
- <combo_item name="Polish">
- Polski (ポーランド語) - ベータ
- </combo_item>
- <combo_item length="1" name="Portugese" type="string">
- Português (ポルトガル語) – ベータ
- </combo_item>
- <combo_item name="Russian">
- Русский (ロシア語) - ベータ
</combo_item>
<combo_item name="Turkish">
Türkçe (トルコ語) - ベータ
- </combo_item>
- <combo_item name="Ukrainian">
- Українська (ウクライナ語) - ベータ
- </combo_item>
- <combo_item length="1" name="Chinese" type="string">
- 中文 (简体) (中国語) - ベータ
- </combo_item>
- <combo_item length="1" name="(Japanese)" type="string">
- 日本語 – ベータ
- </combo_item>
- <combo_item length="1" name="(Korean)" type="string">
- 한국어 (韓国語) – ベータ
- </combo_item>
</combo_box>
<check_box label="言語をオブジェクトと共有" name="language_is_public" tool_tip="優先言語をインワールドのオブジェクトが認識する"/>
</panel>
diff --git a/indra/newview/skins/default/xui/nl/floater_about_land.xml b/indra/newview/skins/default/xui/nl/floater_about_land.xml
index f2aa9ff47c..44c2ebccf7 100644
--- a/indra/newview/skins/default/xui/nl/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/nl/floater_about_land.xml
@@ -147,31 +147,31 @@
<text name="region_name_lbl">
Naam:
</text>
- <text name="region_name_text" left="114">
+ <text name="region_name_text">
leyla
</text>
<text name="region_landtype_lbl">
Type:
</text>
- <text name="region_landtype_text" left="114">
+ <text name="region_landtype_text">
Mainland / Homestead
</text>
<text name="region_maturity_lbl">
Inhoudscategorie:
</text>
- <text name="region_maturity_text" left="114">
+ <text name="region_maturity_text">
Adult
</text>
<text name="resellable_lbl">
Doorverkopen:
</text>
- <text name="resellable_clause" left="114">
+ <text name="resellable_clause">
Land in deze regio mag niet worden doorverkocht.
</text>
<text name="changeable_lbl">
Opsplitsen:
</text>
- <text name="changeable_clause" left="114" width="340">
+ <text name="changeable_clause">
Land in deze regio mag niet worden samengevoegd/opgesplitst.
</text>
<string name="can_resell">
@@ -343,42 +343,18 @@ of opgedeeld.
</combo_item>
</combo_box>
<combo_box name="land category">
- <combo_item name="AnyCategory">
- Alle categorieën
- </combo_item>
- <combo_item name="LindenLocation">
- Linden Locatie
- </combo_item>
- <combo_item name="Arts&amp;Culture">
- Kunst &amp; Cultuur
- </combo_item>
- <combo_item name="Business">
- Zakelijk
- </combo_item>
- <combo_item name="Educational">
- Educatief
- </combo_item>
- <combo_item name="Gaming">
- Spelen
- </combo_item>
- <combo_item name="Hangout">
- Ontmoetingsplaats
- </combo_item>
- <combo_item name="NewcomerFriendly">
- Nieuwkomervriendelijk
- </combo_item>
- <combo_item name="Parks&amp;Nature">
- Parken &amp; Natuur
- </combo_item>
- <combo_item name="Residential">
- Woongebied
- </combo_item>
- <combo_item name="Shopping">
- Winkelen
- </combo_item>
- <combo_item name="Other">
- Anders
- </combo_item>
+ <combo_box.item name="AnyCategory" label="Alle categorieën"/>
+ <combo_box.item name="LindenLocation" label="Linden Locatie"/>
+ <combo_box.item name="Arts&amp;Culture" label="Kunst &amp; Cultuur"/>
+ <combo_box.item name="Business" label="Zakelijk"/>
+ <combo_box.item name="Educational" label="Educatief"/>
+ <combo_box.item name="Gaming" label="Spelen"/>
+ <combo_box.item name="Hangout" label="Ontmoetingsplaats"/>
+ <combo_box.item name="NewcomerFriendly" label="Nieuwkomervriendelijk"/>
+ <combo_box.item name="Parks&amp;Nature" label="Parken &amp; Natuur"/>
+ <combo_box.item name="Residential" label="Woongebied"/>
+ <combo_box.item name="Shopping" label="Winkelen"/>
+ <combo_box.item name="Other" label="Anders"/>
</combo_box>
<button label="?" label_selected="?" name="?"/>
<check_box label="Mature inhoud" name="MatureCheck" tool_tip=" "/>
@@ -405,20 +381,14 @@ of opgedeeld.
(none)
</string>
<button width="70" label="Instellen" label_selected="Instellen" name="Set" tool_tip="Stelt het landingspunt in waar bezoekers arriveren. Wordt ingesteld op uw avatar&apos;s positie binnen dit perceel."/>
- <button width="80" left="311" label="Opschonen" label_selected="Opschonen" name="Clear" tool_tip="Landingspunt leegmaken"/>
+ <button width="70" left="311" label="Opschonen" label_selected="Opschonen" name="Clear" tool_tip="Landingspunt leegmaken"/>
<text name="Teleport Routing: ">
Teleport routering:
</text>
<combo_box name="landing type" tool_tip="Teleport routering -- selecteer hoe teleports naar uw land moeten worden afgehandeld.">
- <combo_item name="Blocked">
- Geblokkeerd
- </combo_item>
- <combo_item name="LandingPoint">
- Landingsplaats
- </combo_item>
- <combo_item name="Anywhere">
- Overal
- </combo_item>
+ <combo_box.item name="Blocked" label="Geblokkeerd"/>
+ <combo_box.item name="LandingPoint" label="Landingsplaats"/>
+ <combo_box.item name="Anywhere" label="Overal"/>
</combo_box>
<string name="push_restrict_text">
Niet duwen
@@ -496,12 +466,8 @@ hebt geklikt.)
<check_box label="Groepstoegang toestaan: [GROUP]" name="GroupCheck" tool_tip="Stel de groep in op het tabblad Algemeen"/>
<check_box label="Verkoop toegangspassen aan:" name="PassCheck" tool_tip="Tijdelijke toegang tot dit perceel toestaan"/>
<combo_box name="pass_combo" left_delta="190">
- <combo_item name="Anyone">
- Iedereen
- </combo_item>
- <combo_item name="Group">
- Groep
- </combo_item>
+ <combo_box.item name="Anyone" label="Iedereen"/>
+ <combo_box.item name="Group" label="Groep"/>
</combo_box>
<spinner label="Prijs in L$:" name="PriceSpin" label_width="168" width="228" />
<spinner label="Toegangsuren" name="HoursSpin" label_width="168" width="228" />
diff --git a/indra/newview/skins/default/xui/nl/floater_buy_contents.xml b/indra/newview/skins/default/xui/nl/floater_buy_contents.xml
index df0614b3d2..0c513c923a 100644
--- a/indra/newview/skins/default/xui/nl/floater_buy_contents.xml
+++ b/indra/newview/skins/default/xui/nl/floater_buy_contents.xml
@@ -6,7 +6,7 @@
<text name="buy_text">
Koop voor L$[AMOUNT] van [NAME]?
</text>
- <button label="Annuleren" label_selected="Annuleren" name="cancel_btn" width="73"/>
+ <button label="Annuleren" label_selected="Annuleren" name="cancel_btn"/>
<button label="Koop" label_selected="Koop" name="buy_btn"/>
<check_box label="Draag kleding nu" name="wear_check"/>
<string name="no_copy_text">
diff --git a/indra/newview/skins/default/xui/nl/floater_color_picker.xml b/indra/newview/skins/default/xui/nl/floater_color_picker.xml
index 25294e17e2..24b242e15c 100644
--- a/indra/newview/skins/default/xui/nl/floater_color_picker.xml
+++ b/indra/newview/skins/default/xui/nl/floater_color_picker.xml
@@ -18,14 +18,13 @@
<text name="l_val_text">
Lum:
</text>
- <check_box label="Direct toepassen" name="apply_immediate"/>
+ <check_box label="Meteen toepassen" name="apply_immediate"/>
<button label="Annuleren" label_selected="Annuleren" name="cancel_btn"/>
<button label="Selecteer" label_selected="Selecteer" name="select_btn"/>
<text name="Current color:">
Huidige kleur:
</text>
<text name="(Drag below to save.)">
- (Sleep naar beneden
- om op te slaan.)
+ (Sleep naar beneden om op te slaan.)
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/nl/floater_env_settings.xml b/indra/newview/skins/default/xui/nl/floater_env_settings.xml
index d66c0b2205..d212f544c5 100644
--- a/indra/newview/skins/default/xui/nl/floater_env_settings.xml
+++ b/indra/newview/skins/default/xui/nl/floater_env_settings.xml
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Environment Editor Floater" title="Omgeving editor">
- <text bottom="-42" name="EnvTimeText">
- Tijd van de
-dag
+ <text name="EnvTimeText">
+ Tijd van de dag
</text>
- <text bottom_delta="-36" name="EnvTimeText2">
+ <text name="EnvTimeText2">
0:00
</text>
<text name="EnvCloudText">
diff --git a/indra/newview/skins/default/xui/nl/floater_inspect.xml b/indra/newview/skins/default/xui/nl/floater_inspect.xml
index 96c9d59f90..d4fa75d94f 100644
--- a/indra/newview/skins/default/xui/nl/floater_inspect.xml
+++ b/indra/newview/skins/default/xui/nl/floater_inspect.xml
@@ -2,10 +2,10 @@
<floater name="inspect" title="Objecten inspecteren">
<scroll_list name="object_list" tool_tip="Selecteer een object van deze lijst om het in-wereld te markeren">
<column label="Objectnaam" name="object_name"/>
- <column label="Eigenaar" name="owner_name"/>
- <column label="Maker" name="creator_name"/>
+ <column label="Eigenaarnaam" name="owner_name"/>
+ <column label="Makernaam:" name="creator_name"/>
<column label="Aanmaakdatum" name="creation_date"/>
</scroll_list>
- <button label="Toon profiel eigenaar..." label_selected="" name="button owner" tool_tip="Bekijk het profiel van de eigenaar van het gemarkeerde object"/>
- <button label="Toon profiel maker..." label_selected="" name="button creator" tool_tip="Bekijk het profiel van de originele maker van het gemarkeerde object"/>
+ <button label="Bekijk eigenaarprofiel..." label_selected="" name="button owner" tool_tip="Bekijk het profiel van de eigenaar van het gemarkeerde object"/>
+ <button label="Bekijk makerprofiel..." label_selected="" name="button creator" tool_tip="Bekijk het profiel van de originele maker van het gemarkeerde object"/>
</floater>
diff --git a/indra/newview/skins/default/xui/nl/floater_joystick.xml b/indra/newview/skins/default/xui/nl/floater_joystick.xml
index dcdddd0492..27556a89f8 100644
--- a/indra/newview/skins/default/xui/nl/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/nl/floater_joystick.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Joystick" title="Joystick configuratie">
- <check_box name="enable_joystick" width="80">
- Joystick inschakelen:
+ <check_box name="enable_joystick">
+ Joystick inschakelen
</check_box>
- <text left="146" name="joystick_type" width="360"/>
<spinner label="X-as mapping" name="JoystickAxis1"/>
<spinner label="Y-as mapping" name="JoystickAxis2"/>
<spinner label="Z-as mapping" name="JoystickAxis0"/>
@@ -53,7 +52,7 @@
<text name="ZDeadZone">
Z dode zone
</text>
- <text name="PitchDeadZone" left="4" width="110">
+ <text name="PitchDeadZone">
Stampen dode zone
</text>
<text name="YawDeadZone">
@@ -71,9 +70,9 @@
<text name="ZoomDeadZone">
Zoom dode zone
</text>
- <button label="SpaceNavigator standaardwaarden" name="SpaceNavigatorDefaults" width="200" font="SansSerifSmall"/>
+ <button label="SpaceNavigator standaardwaarden" name="SpaceNavigatorDefaults"/>
<button label="OK" label_selected="OK" name="ok_btn"/>
- <button label="Annuleren" label_selected="Annuleren" name="cancel_btn" left_delta="110"/>
+ <button label="Annuleren" label_selected="Annuleren" name="cancel_btn"/>
<string name="JoystickMonitor">
Joystick monitor
</string>
diff --git a/indra/newview/skins/default/xui/nl/floater_mute_object.xml b/indra/newview/skins/default/xui/nl/floater_mute_object.xml
index ca3b34c3a2..efc12f29e2 100644
--- a/indra/newview/skins/default/xui/nl/floater_mute_object.xml
+++ b/indra/newview/skins/default/xui/nl/floater_mute_object.xml
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="mute by name" title="Negeer object op naam">
- <text name="message" bottom_delta="-40">
- Negeer op naam heeft alleen invloed op object chat
-en IM, niet op geluiden. U dient de naam van het object
-exact te typen.
+ <text name="message">
+ Negeer op naam heeft alleen invloed op object chat en IM, niet op geluiden. U dient de naam van het object exact te typen.
</text>
- <line_editor name="object_name" bottom_delta="-58">
+ <line_editor name="object_name">
Object naam
</line_editor>
<button label="Ok" name="OK"/>
diff --git a/indra/newview/skins/default/xui/nl/floater_openobject.xml b/indra/newview/skins/default/xui/nl/floater_openobject.xml
index 10b502be1c..58ca71505a 100644
--- a/indra/newview/skins/default/xui/nl/floater_openobject.xml
+++ b/indra/newview/skins/default/xui/nl/floater_openobject.xml
@@ -3,6 +3,6 @@
<text name="object_name">
[DESC]:
</text>
- <button label="Kopiëren naar inventaris" label_selected="Kopiëren naar inventaris" name="copy_to_inventory_button" width="140"/>
- <button label="Kopiëren en dragen" label_selected="Kopiëren en dragen" name="copy_and_wear_button" left="164"/>
+ <button label="Kopiëren naar inventaris" label_selected="Kopiëren naar inventaris" name="copy_to_inventory_button"/>
+ <button label="Kopiëren en dragen" label_selected="Kopiëren en dragen" name="copy_and_wear_button"/>
</floater>
diff --git a/indra/newview/skins/default/xui/nl/floater_pay.xml b/indra/newview/skins/default/xui/nl/floater_pay.xml
index 4018ebdc93..3255412439 100644
--- a/indra/newview/skins/default/xui/nl/floater_pay.xml
+++ b/indra/newview/skins/default/xui/nl/floater_pay.xml
@@ -6,10 +6,10 @@
<button label="L$20" label_selected="L$20" name="fastpay 20"/>
<button label="Betaal" label_selected="Betaal" name="pay btn"/>
<button label="Annuleren" label_selected="Annuleren" name="cancel btn"/>
- <text name="payee_label" width="100">
+ <text name="payee_label">
Betaal inwoner:
</text>
- <text name="payee_name" left="110">
+ <text name="payee_name">
[FIRST] [LAST]
</text>
<text name="fastpay text">
diff --git a/indra/newview/skins/default/xui/nl/floater_pay_object.xml b/indra/newview/skins/default/xui/nl/floater_pay_object.xml
index d3826648f2..23a161ac14 100644
--- a/indra/newview/skins/default/xui/nl/floater_pay_object.xml
+++ b/indra/newview/skins/default/xui/nl/floater_pay_object.xml
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Give Money" title="">
- <text name="payee_group" left="5" width="90" halign="left">
+ <text name="payee_group">
Betaal groep:
</text>
- <text name="payee_resident" left="5" width="90" halign="left">
+ <text name="payee_resident">
Betaal inwoner:
</text>
- <text name="payee_name" left="100" width="200">
+ <text name="payee_name">
[FIRST] [LAST]
</text>
- <text name="object_name_label" left="5" width="90" halign="left">
+ <text name="object_name_label">
Via object:
</text>
- <text name="object_name_text" left="100" width="200">
+ <text name="object_name_text">
...
</text>
- <text name="fastpay text" halign="left">
+ <text name="fastpay text">
Snel betalen:
</text>
<text name="amount text">
diff --git a/indra/newview/skins/default/xui/nl/floater_perm_prefs.xml b/indra/newview/skins/default/xui/nl/floater_perm_prefs.xml
index c1c9492286..d19b5523f5 100644
--- a/indra/newview/skins/default/xui/nl/floater_perm_prefs.xml
+++ b/indra/newview/skins/default/xui/nl/floater_perm_prefs.xml
@@ -9,7 +9,7 @@
</text>
<check_box label="Wijzigen" name="next_owner_modify"/>
<check_box label="Kopiëren" name="next_owner_copy"/>
- <check_box label="Verkopen/weggeven" name="next_owner_transfer" left_delta="80"/>
+ <check_box label="Verkopen/weggeven" name="next_owner_transfer"/>
</panel>
<button label="OK" label_selected="OK" name="ok"/>
<button label="Annuleren" label_selected="Annuleren" name="cancel"/>
diff --git a/indra/newview/skins/default/xui/nl/floater_select_key.xml b/indra/newview/skins/default/xui/nl/floater_select_key.xml
index c8daa10ab6..da97c03a6c 100644
--- a/indra/newview/skins/default/xui/nl/floater_select_key.xml
+++ b/indra/newview/skins/default/xui/nl/floater_select_key.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="modal container" title="">
<button label="Annuleren" label_selected="Annuleren" name="Cancel"/>
- <text name="Save item as:" left="12" width="220">
- Druk op een toets om die te selecteren
+ <text name="Save item as:">
+ Druk een toets om te selecteren
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/nl/floater_telehub.xml b/indra/newview/skins/default/xui/nl/floater_telehub.xml
index 5a8abc208a..b1fc80cf3c 100644
--- a/indra/newview/skins/default/xui/nl/floater_telehub.xml
+++ b/indra/newview/skins/default/xui/nl/floater_telehub.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="telehub" title="Telehub" width="292">
+<floater name="telehub" title="Telehub">
<text name="status_text_connected">
Telehub verbonden met object [OBJECT]
</text>
@@ -13,21 +13,13 @@
Selecteer objecten klik Verbind telehub
</text>
<button label="Verbind telehub" name="connect_btn"/>
- <button label="Verbinding verbreken" name="disconnect_btn" width="128"/>
+ <button label="Verbinding verbreken" name="disconnect_btn"/>
<text name="spawn_points_text">
Spawnpunten (posities, niet objecten):
</text>
- <scroll_list bottom_delta="-44" draw_border="true" follows="left|top" font="SansSerifSmall"
- height="40" left="10" multi_select="false" name="spawn_points_list"
- width="230" />
-
<button label="Spawn toevoegen" name="add_spawn_point_btn"/>
<button label="Verwijder Spawn" name="remove_spawn_point_btn"/>
- <text name="spawn_point_help" width="290">
- Selecteer object en klik Toevoegen om positie
-te specificeren. U kunt het object daarna verplaatsen
-of verwijderen. Posities zijn relatief ten opzichte
-van het middelpunt van de telehub. Selecteer een
-item in de lijst om de positie in de wereld te tonen.
+ <text name="spawn_point_help">
+ Selecteer object en klik Toevoegen om positie te specificeren. U kunt het object daarna verplaatsen of verwijderen. Posities zijn relatief ten opzichte van het middelpunt van de telehub. Selecteer een item in de lijst om de positie in de wereld te tonen.
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/nl/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/nl/floater_texture_ctrl.xml
index 13a68747c6..440a31097d 100644
--- a/indra/newview/skins/default/xui/nl/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/nl/floater_texture_ctrl.xml
@@ -9,12 +9,12 @@
<text name="unknown">
Afmetingen: [DIMENSIONS]
</text>
- <button label="Standaard" label_selected="Standaard" name="Default" width="70"/>
- <button label="Geen" label_selected="Geen" name="None" left="80"/>
+ <button label="Standaard" label_selected="Standaard" name="Default"/>
+ <button label="Geen" label_selected="Geen" name="None"/>
<button label="Blanco" label_selected="Blanco" name="Blank"/>
<check_box label="Toon mappen" name="show_folders_check"/>
<search_editor label="Type hier om te zoeken" name="inventory search editor"/>
- <check_box label="Direct toepassen" name="apply_immediate_check"/>
+ <check_box label="Meteen toepassen" name="apply_immediate_check"/>
<button label="Annuleren" label_selected="Annuleren" name="Cancel"/>
<button label="Selecteren" label_selected="Selecteren" name="Select"/>
<string name="pick title">
diff --git a/indra/newview/skins/default/xui/nl/floater_tools.xml b/indra/newview/skins/default/xui/nl/floater_tools.xml
index 42cf22aa15..c7f99195dd 100644
--- a/indra/newview/skins/default/xui/nl/floater_tools.xml
+++ b/indra/newview/skins/default/xui/nl/floater_tools.xml
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="toolbox floater" title="" short_title="Bouwen" width="288">
+<floater name="toolbox floater" title="">
<button label="" label_selected="" name="button focus" tool_tip="Focus"/>
<button label="" label_selected="" name="button move" tool_tip="Verplaats"/>
<button label="" label_selected="" name="button edit" tool_tip="Bewerk"/>
<button label="" label_selected="" name="button create" tool_tip="Maak"/>
<button label="" label_selected="" name="button land" tool_tip="Land"/>
<check_box label="Zoom" name="radio zoom"/>
- <check_box label="Roteren (Ctrl)" name="radio orbit"/>
+ <check_box label="Draaien (Ctrl)" name="radio orbit"/>
<check_box label="Verplaatsen (Ctrl-Shift)" name="radio pan"/>
<check_box label="Verplaatsen" name="radio move"/>
<check_box label="Optillen (Ctrl)" name="radio lift"/>
- <check_box label="Roteren (Ctrl-Shift)" name="radio spin"/>
+ <check_box label="Draaien (Ctrl-Shift)" name="radio spin"/>
<check_box label="Positie" name="radio position"/>
- <check_box label="Roteren (Ctrl)" name="radio rotate"/>
+ <check_box label="Draaien (Ctrl)" name="radio rotate"/>
<check_box label="Uitrekken (Ctrl-Shift)" name="radio stretch"/>
<check_box label="Selecteer textuur" name="radio select face"/>
<check_box label="Bewerk gekoppelde onderdelen" name="checkbox edit linked parts"/>
<text name="text ruler mode">
Liniaal:
</text>
- <combo_box name="combobox grid mode" width="78" left_delta="38">
+ <combo_box name="combobox grid mode">
<combo_item name="World">
Wereld
</combo_item>
@@ -30,18 +30,18 @@
Referentie
</combo_item>
</combo_box>
- <check_box left="136" label="Beide zijden uitrekken" name="checkbox uniform"/>
- <check_box left="136" label="Texturen uitrekken" name="checkbox stretch textures"/>
- <check_box left="136" label="Gebruik grid" name="checkbox snap to grid"/>
- <button label="Opties..." label_selected="Opties..." name="Options..." height="18" bottom_delta="-15"/>
- <text name="text status" width="280">
+ <check_box label="Beide zijden uitrekken" name="checkbox uniform"/>
+ <check_box label="Texturen uitrekken" name="checkbox stretch textures"/>
+ <check_box label="Gebruik grid" name="checkbox snap to grid"/>
+ <button label="Opties..." label_selected="Opties..." name="Options..."/>
+ <text name="text status">
Sleep om te verplaatsen, Shift-slepen om te kopiëren
</text>
<button label="" label_selected="" name="ToolCube" tool_tip="Kubus"/>
<button label="" label_selected="" name="ToolPrism" tool_tip="Prisma"/>
<button label="" label_selected="" name="ToolPyramid" tool_tip="Piramide"/>
<button label="" label_selected="" name="ToolTetrahedron" tool_tip="Tetrahedron"/>
- <button label="" label_selected="" name="ToolCylinder" tool_tip="Cilinder"/>
+ <button label="" label_selected="" name="ToolCylinder" tool_tip="Cylinder"/>
<button label="" label_selected="" name="ToolHemiCylinder" tool_tip="Halve cilinder"/>
<button label="" label_selected="" name="ToolCone" tool_tip="Kegel"/>
<button label="" label_selected="" name="ToolHemiCone" tool_tip="Halve kegel"/>
@@ -73,13 +73,13 @@
<text name="Strength:">
Sterkte
</text>
- <text name="obj_count" left="134">
+ <text name="obj_count">
Geselecteerde objecten: [COUNT]
</text>
- <text name="prim_count" left="134">
+ <text name="prim_count">
primitieven: [COUNT]
</text>
- <tab_container name="Object Info Tabs" tab_max_width="62" tab_min_width="30" width="288">
+ <tab_container name="Object Info Tabs">
<panel label="Algemeen" name="General">
<text name="Name:">
Naam:
@@ -95,7 +95,7 @@
</text>
<button label="Profiel..." label_selected="Profiel..." name="button creator profile"/>
<text name="Owner:">
- Eigenaar:
+ Eigenaar
</text>
<text name="Owner Name">
Thrax Linden
@@ -112,7 +112,7 @@
Permissies:
</text>
<text name="perm_modify">
- U kunt dit object wijzigen.
+ U kunt dit object wijzigen
</text>
<check_box label="Deel met groep" name="checkbox share with group" tool_tip="Alle leden van de ingestelde groep toestaan om te delen en uw permissies voor dit object te gebruiken. U moet &apos;Overdragen&apos; om rolbeperkingen in te schakelen."/>
<string name="text deed continued">
@@ -144,12 +144,12 @@
Volgende eigenaar kan:
</text>
<check_box label="Wijzigen" name="checkbox next owner can modify"/>
- <check_box label="Kopiëren" name="checkbox next owner can copy" left_delta="80"/>
- <check_box label="Verkopen/weggeven" name="checkbox next owner can transfer" left_delta="67"/>
+ <check_box label="Kopiëren" name="checkbox next owner can copy"/>
+ <check_box label="Verkopen/weggeven" name="checkbox next owner can transfer"/>
<text name="label click action">
Wanneer links-geklikt:
</text>
- <combo_box name="clickaction" width="178">
+ <combo_box name="clickaction">
<combo_item name="Touch/grab(default)">
Aanraken/pakken (standaard)
</combo_item>
@@ -191,19 +191,19 @@
F:
</text>
<string name="text modify info 1">
- U kunt dit object wijzigen.
+ U kunt dit object wijzigen
</string>
<string name="text modify info 2">
- U kunt deze objecten wijzigen.
+ U kunt deze objecten wijzigen
</string>
<string name="text modify info 3">
- U kunt dit object niet wijzigen.
+ U kunt dit object niet wijzigen
</string>
<string name="text modify info 4">
- U kunt deze objecten niet wijzigen.
+ U kunt deze objecten niet wijzigen
</string>
<string name="text modify warning">
- U moet het hele object selecteren om permissies in te stellen.
+ U moet het hele object selecteren om permissies in te stellen
</string>
<string name="Cost Default">
Prijs: L$
@@ -358,7 +358,7 @@
Deuk begin en einde
</text>
<text name="advanced_slice">
- Uitsnede begin en einde
+ Uitsnede Begin en Einde
</text>
<spinner label="B" name="Path Limit Begin"/>
<spinner label="E" name="Path Limit End"/>
@@ -370,7 +370,7 @@
<text name="text radius delta">
Straal
</text>
- <text name="text revolutions" width="84">
+ <text name="text revolutions">
Omwentelingen
</text>
<texture_picker label="Sculpt textuur" name="sculpt texture control" tool_tip="Klik om een afbeelding te kiezen"/>
@@ -405,14 +405,14 @@
Bewerk objectkenmerken:
</text>
<check_box label="Flexibiliteit" name="Flexible1D Checkbox Ctrl" tool_tip="Staat toe dat objecten kunnen buigen om de Z-as. (alleen aan de client kant)"/>
- <spinner label="Zachtheid" name="FlexNumSections" width="143" label_width="80"/>
- <spinner label="Zwaartekracht" name="FlexGravity" width="143" label_width="80"/>
- <spinner label="Slepen" name="FlexFriction" width="143" label_width="80"/>
- <spinner label="Wind" name="FlexWind" width="143" label_width="80"/>
- <spinner label="Spanning" name="FlexTension" width="143" label_width="80"/>
- <spinner label="Kracht X" name="FlexForceX" width="143" label_width="80"/>
- <spinner label="Kracht Y" name="FlexForceY" width="143" label_width="80"/>
- <spinner label="Kracht Z" name="FlexForceZ" width="143" label_width="80"/>
+ <spinner label="Zachtheid" name="FlexNumSections"/>
+ <spinner label="Zwaartekracht" name="FlexGravity"/>
+ <spinner label="Slepen" name="FlexFriction"/>
+ <spinner label="Wind" name="FlexWind"/>
+ <spinner label="Spanning" name="FlexTension"/>
+ <spinner label="Kracht X" name="FlexForceX"/>
+ <spinner label="Kracht Y" name="FlexForceY"/>
+ <spinner label="Kracht Z" name="FlexForceZ"/>
<check_box label="Licht" name="Light Checkbox Ctrl" tool_tip="Zorgt dat het object licht uitstraalt"/>
<text name="label color">
Kleur
@@ -425,13 +425,13 @@
<panel label="Textuur" name="Texture">
<texture_picker label="Textuur" name="texture control" tool_tip="Klik om een afbeelding te kiezen"/>
<color_swatch label="Kleur" name="colorswatch" tool_tip="Klik om kleurkiezer to openen"/>
- <text name="color trans" width="100">
+ <text name="color trans">
Transparantie %
</text>
<text name="glow label">
Gloed
</text>
- <check_box label="Volledige &#10;helderheid" name="checkbox fullbright" bottom_delta="-21"/>
+ <check_box label="Volledige helderheid" name="checkbox fullbright"/>
<text name="tex gen">
Mapping
</text>
@@ -536,7 +536,7 @@
Herhalingen per zijde
</string>
<text name="rpt">
- Herhalingen per m
+ Herhalingen per meter
</text>
<button label="Toepassen" label_selected="Toepassen" name="button apply"/>
<text name="tex offset">
@@ -545,15 +545,13 @@
<spinner label="Horizontaal (U)" name="TexOffsetU"/>
<spinner label="Verticaal (V)" name="TexOffsetV"/>
<text name="textbox autofix">
- Mediatextuur uitlijnen
-(moet eerst laden)
+ Mediatextuur uitlijnen (moet eerst laden)
</text>
- <button label="Uitlijnen" label_selected="Uitlijnen" name="button align" left="155" />
+ <button label="Uitlijnen" label_selected="Uitlijnen" name="button align"/>
</panel>
<panel label="Inhoud" name="Contents">
<button label="Nieuw script" label_selected="Nieuw script..." name="button new script"/>
<button label="Permissies..." name="button permissions"/>
- <panel name="ContentsInventory" width="272" />
</panel>
</tab_container>
<panel name="land info panel">
@@ -561,14 +559,14 @@
Perceel Informatie
</text>
<text name="label_area_price">
- Prijs: L$[PRICE] voor [AREA] m².
+ Prijs: L$[PRICE] voor [AREA] m2.
</text>
<text name="label_area">
- Gebied: [AREA] m².
+ Gebied: [AREA] m2.
</text>
<button label="Over land..." label_selected="Over land..." name="button about land"/>
<check_box label="Toon Eigenaren" name="checkbox show owners" tool_tip="Kleur percelen op basis van hun eigendom"/>
- <button label="?" label_selected="?" name="button show owners help" left_delta="105"/>
+ <button label="?" label_selected="?" name="button show owners help"/>
<text name="label_parcel_modify">
Wijzig Perceel
</text>
diff --git a/indra/newview/skins/default/xui/nl/floater_top_objects.xml b/indra/newview/skins/default/xui/nl/floater_top_objects.xml
index cc252352eb..e79ee4ea56 100644
--- a/indra/newview/skins/default/xui/nl/floater_top_objects.xml
+++ b/indra/newview/skins/default/xui/nl/floater_top_objects.xml
@@ -4,29 +4,29 @@
Laden…
</text>
<scroll_list name="objects_list">
- <column label="Score" name="score" width="84"/>
- <column label="Naam" name="name" width="84"/>
- <column label="Eigenaar" name="owner" width="84"/>
- <column label="Locatie" name="location" width="84"/>
- <column label="Tijd" name="time" width="84"/>
- <column label="Mono tijd" name="mono_time" width="84"/>
+ <column label="Score" name="score"/>
+ <column label="Naam" name="name"/>
+ <column label="Eigenaar" name="owner"/>
+ <column label="Locatie" name="location"/>
+ <column label="Tijd" name="time"/>
+ <column label="Mono tijd" name="mono_time"/>
</scroll_list>
- <text name="id_text" left="2">
+ <text name="id_text">
Object ID:
</text>
<button label="Toon baken" name="show_beacon_btn"/>
- <text name="obj_name_text" left="2">
+ <text name="obj_name_text">
Object naam:
</text>
<button label="Filter" name="filter_object_btn"/>
- <text name="owner_name_text" left="2">
+ <text name="owner_name_text">
Eigenaar naam:
</text>
<button label="Filter" name="filter_owner_btn"/>
- <button label="Geselecteerde retourneren" name="return_selected_btn" width="170"/>
- <button label="Alles retourneren" name="return_all_btn" left="190"/>
- <button label="Geselecteerde uitschakelen" name="disable_selected_btn" width="170"/>
- <button label="Alles uitschakelen" name="disable_all_btn" left="190"/>
+ <button label="Geselecteerde retourneren" name="return_selected_btn"/>
+ <button label="Alles retourneren" name="return_all_btn"/>
+ <button label="Geselecteerde uitschakelen" name="disable_selected_btn"/>
+ <button label="Alles uitschakelen" name="disable_all_btn"/>
<button label="Verversen" name="refresh_btn"/>
<string name="top_scripts_title">
Top scripts
diff --git a/indra/newview/skins/default/xui/nl/floater_url_entry.xml b/indra/newview/skins/default/xui/nl/floater_url_entry.xml
index 6926f09390..23ea21bcc5 100644
--- a/indra/newview/skins/default/xui/nl/floater_url_entry.xml
+++ b/indra/newview/skins/default/xui/nl/floater_url_entry.xml
@@ -4,8 +4,8 @@
Media URL:
</text>
<button label="OK" name="ok_btn"/>
- <button label="Annuleren" name="cancel_btn" width="80"/>
- <button label="Leegmaken" name="clear_btn" width="80"/>
+ <button label="Annuleren" name="cancel_btn"/>
+ <button label="Leegmaken" name="clear_btn"/>
<text name="loading_label">
Laden…
</text>
diff --git a/indra/newview/skins/default/xui/nl/floater_water.xml b/indra/newview/skins/default/xui/nl/floater_water.xml
index 2238008fd8..38ec15d1a0 100644
--- a/indra/newview/skins/default/xui/nl/floater_water.xml
+++ b/indra/newview/skins/default/xui/nl/floater_water.xml
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Water Floater" title="Geavanceerde water editor">
- <combo_box bottom="-50" height="18" left_delta="116" name="WaterPresetsCombo" width="150" />
<text name="KeyFramePresetsText">
Watervoorinstellingen
</text>
- <button label="Nieuw" label_selected="Nieuw" name="WaterNewPreset" left_delta="190"/>
+ <button label="Nieuw" label_selected="Nieuw" name="WaterNewPreset"/>
<button label="Opslaan" label_selected="Opslaan" name="WaterSavePreset"/>
- <button label="Verwijderen" label_selected="Verwijderen" name="WaterDeletePreset" width="80"/>
+ <button label="Verwijderen" label_selected="Verwijderen" name="WaterDeletePreset"/>
<tab_container name="Water Tabs">
<panel label="Instellingen" name="Settings">
<text name="BHText">
diff --git a/indra/newview/skins/default/xui/nl/panel_friends.xml b/indra/newview/skins/default/xui/nl/panel_friends.xml
index eaf6e5d55b..2f43ee0a53 100644
--- a/indra/newview/skins/default/xui/nl/panel_friends.xml
+++ b/indra/newview/skins/default/xui/nl/panel_friends.xml
@@ -11,10 +11,10 @@
<column name="icon_edit_mine" tool_tip="Vriend kan objecten wijzigen, verwijderen of oppakken"/>
<column name="icon_edit_theirs" tool_tip="U kunt de objecten van deze vriend bewerken"/>
</scroll_list>
- <button label="IM/Oproepen" name="im_btn" tool_tip="Open Instant Message sessie" width="86"/>
- <button label="Profiel" name="profile_btn" tool_tip="Toon afbeelding, groepen en andere informatie" width="86"/>
- <button label="Teleport..." name="offer_teleport_btn" tool_tip="Bied deze vriend een teleport naar uw huidige locatie aan" width="86"/>
- <button label="Betaal..." name="pay_btn" tool_tip="Geef Linden dollars (L$) aan deze vriend" width="86"/>
- <button label="Verwijderen..." name="remove_btn" tool_tip="Verwijder deze persoon van uw vriendenlijst" width="86"/>
- <button label="Toevoegen..." name="add_btn" tool_tip="Bied vriendschap aan een inwoner aan" width="86"/>
+ <button label="IM/Oproepen" name="im_btn" tool_tip="Open Instant Message sessie"/>
+ <button label="Profiel" name="profile_btn" tool_tip="Toon afbeelding, groepen en andere informatie"/>
+ <button label="Teleport..." name="offer_teleport_btn" tool_tip="Bied deze vriend een teleport naar uw huidige locatie aan"/>
+ <button label="Betaal..." name="pay_btn" tool_tip="Geef Linden dollars (L$) aan deze vriend"/>
+ <button label="Verwijderen..." name="remove_btn" tool_tip="Verwijder deze persoon van uw vriendenlijst"/>
+ <button label="Toevoegen..." name="add_btn" tool_tip="Bied vriendschap aan een inwoner aan"/>
</panel>
diff --git a/indra/newview/skins/default/xui/nl/panel_group_general.xml b/indra/newview/skins/default/xui/nl/panel_group_general.xml
index 7b78c845cd..9982a527f4 100644
--- a/indra/newview/skins/default/xui/nl/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/nl/panel_group_general.xml
@@ -16,18 +16,18 @@ Laat uw muis boven de opties zweven voor meer help.
<text name="prepend_founded_by">
Opgericht door
</text>
- <text name="founder_name" left_delta="84">
+ <text name="founder_name">
(wachten)
</text>
- <text name="group_charter_label" width="244">
+ <text name="group_charter_label">
Groepcharter
</text>
<texture_picker label="Groepinsigne" name="insignia" tool_tip="Klik om een afbeelding te kiezen"/>
- <text_editor name="charter" width="244">
+ <text_editor name="charter">
Groepcharter
</text_editor>
<button label="Deelnemen (L$0)" label_selected="Deelnemen (L$0)" name="join_button"/>
- <button label="Gedetailleerde weergave" label_selected="Gedetailleerde weergave" name="info_button" width="154"/>
+ <button label="Gedetailleerde weergave" label_selected="Gedetailleerde weergave" name="info_button"/>
<text name="text_owners_and_visible_members">
Eigenaren en zichtbare leden
</text>
@@ -43,10 +43,10 @@ Laat uw muis boven de opties zweven voor meer help.
Groepvoorkeuren
</text>
<panel name="preferences_container">
- <check_box label="Toon in zoeken" name="show_in_group_list" tool_tip="Stelt in of deze groep zichtbaar is in de zoekresultaten."/>
+ <check_box label="Toon in zoeken" name="show_in_group_list" tool_tip="Laat mensen deze groep zien in zoekresultaten."/>
<check_box label="Vrije toegang" name="open_enrollement" tool_tip="Stelt in of deze groep toestaat dat nieuwe leden lid kunnen worden zonder uitgenodigd te zijn."/>
<check_box label="Contributiebijdrage: L$" name="check_enrollment_fee" tool_tip="Stelt in of er een contributiebijdrage vereist is om lid te worden van de groep."/>
- <spinner name="spin_enrollment_fee" tool_tip="Nieuwe leden moeten deze bijdrage betalen om deel te nemen aan de groep wanneer &quot;Contributie bijdrage&quot; is aangevinkt." width="58" left_delta="142"/>
+ <spinner name="spin_enrollment_fee" tool_tip="Nieuwe leden moeten deze bijdrage betalen om deel te nemen aan de groep wanneer &quot;Contributie bijdrage&quot; is aangevinkt."/>
<combo_box name="group_mature_check" tool_tip="Stelt in of uw groepsinformatie als mature beschouwd wordt.">
<combo_item name="select_mature">
- Selecteer -
@@ -64,15 +64,14 @@ Laat uw muis boven de opties zweven voor meer help.
</text>
<combo_box name="active_title" tool_tip="Stelt de titel in die in uw avatar&apos;s naamlabel verschijnt wanneer deze groep actief is."/>
</panel>
- <check_box label="Ontvang groepsberichten" name="receive_notices" tool_tip="Stelt in of u berichten van deze groep wilt ontvangen. Verwijder het vinkje wanneer u spam ontvangt van deze groep." left_delta="-4"/>
+ <check_box label="Ontvang groepsberichten" name="receive_notices" tool_tip="Stelt in of u berichten van deze groep wilt ontvangen. Verwijder het vinkje wanneer u spam ontvangt van deze groep."/>
<check_box label="Toon deze groep in mijn profiel" name="list_groups_in_profile" tool_tip="Stelt in of u deze groep in uw profiel wil laten zien"/>
</panel>
<string name="incomplete_member_data_str">
Ledendata ophalen
</string>
<string name="confirm_group_create_str">
- Het maken van deze groep zal u L$ 100 kosten. Weet u ECHT héél zeker dat u L$ 100 wilt betalen om deze groep te maken?
-
-WEES U ER VAN BEWUST, dat als er niemand binnen 48 uur lid wordt van deze groep, deze weer ontmanteld zal worden. Hierbij zal ook de groepsnaam onbeschikbaar blijven voor toekomstig gebruik!
+ Het maken van deze groep zal u L$100 kosten. Weet u echt, echt, ECHT zeker dat u L$100 wil besteden om deze groep te maken?
+Wees u ervan bewust dat, indien niemand anders binnen 48 uur lid wordt van deze groep, deze ontmanteld zal worden, waarbij de groepsnaam onbeschikbaar zal blijven voor toekomstig gebruik.
</string>
</panel>
diff --git a/indra/newview/skins/default/xui/nl/panel_group_invite.xml b/indra/newview/skins/default/xui/nl/panel_group_invite.xml
index e012d88ff5..004fdc4bee 100644
--- a/indra/newview/skins/default/xui/nl/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/nl/panel_group_invite.xml
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Nodig een lid uit" name="invite_panel">
<text name="help_text">
- U kunt meerdere inwoners selecteren
-om voor uw groep uit te nodigen. Klik
-&apos;Open inwonerkiezer&apos; om te starten.
+ U kunt meerdere inwoners selecteren om voor uw groep uit te nodigen. Klik &apos;Open inwonerkiezer&apos; om te starten.
</text>
<button label="Open inwonerkiezer" name="add_button" tool_tip=""/>
<name_list name="invitee_list" tool_tip="Houd de Ctrl-toets vast en klik de namen van de inwoners om meerdere te selecteren."/>
<button label="Verwijder geselecteerden van lijst" name="remove_button" tool_tip="Verwijderd hierboven geselecteerde inwoners van de uitnodigingslijst."/>
<text name="role_text">
- Kies welke rol aan hen wordt
-toegewezen:
+ Kies welke rol aan hen wordt toegewezen:
</text>
- <combo_box name="role_name" tool_tip="Kies uit de lijst met rollen waarvoor u toestemming heeft om leden toe te wijzen." bottom_delta="-30"/>
+ <combo_box name="role_name" tool_tip="Kies uit de lijst met rollen waarvoor u toestemming heeft om leden toe te wijzen."/>
<button label="Verzend uitnodigingen" name="ok_button"/>
<button label="Annuleren" name="cancel_button"/>
<string name="confirm_invite_owner_str">
diff --git a/indra/newview/skins/default/xui/nl/panel_group_notices.xml b/indra/newview/skins/default/xui/nl/panel_group_notices.xml
index 68f3c87f7d..41aff527dd 100644
--- a/indra/newview/skins/default/xui/nl/panel_group_notices.xml
+++ b/indra/newview/skins/default/xui/nl/panel_group_notices.xml
@@ -11,9 +11,7 @@
Groepsberichtenarchief
</text>
<text name="lbl2">
- Berichten worden 14 dagen bewaard. Klik hieronder het bericht dat u wilt
-bekijken. Klik de &apos;Verversen&apos; knop om te controleren of nieuwe berichten zijn
-ontvangen. Berichtenlijsten zijn gelimiteerd tot 200 berichten groep per dag.
+ Berichten worden 14 dagen bewaard. Klik hieronder het bericht dat u wilt bekijken. Klik de &apos;Verversen&apos; knop om te controleren of nieuwe berichten zijn ontvangen. Berichtenlijsten zijn gelimiteerd tot 200 berichten groep per dag.
</text>
<scroll_list name="notice_list">
<column label="Onderwerp" name="subject"/>
@@ -30,25 +28,18 @@ ontvangen. Berichtenlijsten zijn gelimiteerd tot 200 berichten groep per dag.
Maak een bericht
</text>
<text name="lbl2">
- U dient een onderwerp in te voeren om een bericht te versturen.
-U kunt een enkel item aan een bericht toevoegen door het van
-uw inventaris naar dit paneel te slepen. Bevestigde items
-moeten kopieerbaar en overdraagbaar zijn en u kunt geen
-mappen versturen.
+ U dient een onderwerp in te voeren om een bericht te versturen. U kunt een enkel item aan een bericht toevoegen door het van uw inventaris naar dit paneel te slepen. Bevestigde items moeten kopieerbaar en overdraagbaar zijn en u kunt geen mappen versturen.
</text>
- <text bottom_delta="-79" halign="right" left="10" name="lbl3" width="60">
+ <text name="lbl3">
Onderwerp:
</text>
- <line_editor name="create_subject" width="331" left_delta="71"/>
- <text bottom_delta="-18" halign="right" left="10" name="lbl4" width="60">
+ <text name="lbl4">
Bericht:
</text>
- <text_editor name="create_message" bottom_delta="-90" height="104" left_delta="71" width="330"/>
- <line_editor name="create_inventory_name" width="190" left_delta="71"/>
- <text name="lbl5" left="10">
+ <text name="lbl5">
Bevestig:
</text>
- <button label="Verwijder bevestiging" label_selected="Verwijder bevestiging" name="remove_attachment"/>
+ <button label="Verwijder bevestiging:" label_selected="Verwijder bevestiging:" name="remove_attachment"/>
<button label="Verzend bericht" label_selected="Verzend bericht" name="send_notice"/>
<panel name="drop_target" tool_tip="Sleep een inventarisitem op het berichtvenster om het met het bericht mee te sturen. U dient permissie te hebben om het object te kopiëren en over te dragen wilt u het met het bericht mee kunnen sturen."/>
</panel>
@@ -65,7 +56,6 @@ mappen versturen.
<text name="lbl4">
Bericht:
</text>
- <button label="Open bevestiging" label_selected="Open bevestiging" name="open_attachment" width="118"/>
- <line_editor left="128" name="view_inventory_name" width="256"/>
+ <button label="Open bevestiging" label_selected="Open bevestiging" name="open_attachment"/>
</panel>
</panel>
diff --git a/indra/newview/skins/default/xui/nl/panel_group_roles.xml b/indra/newview/skins/default/xui/nl/panel_group_roles.xml
index ffaaa8137a..50aabb0433 100644
--- a/indra/newview/skins/default/xui/nl/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/nl/panel_group_roles.xml
@@ -12,9 +12,7 @@
Leden &amp; Rollen
</text>
<text name="static2">
- Groepsleden krijgen Rollen met Mogelijkheden toegekend. Deze instellingen
-kunnen eenvoudig aangepast worden, zodat meer organisatie en flexibiliteit
-mogelijk is.
+ Groepsleden krijgen Rollen met Mogelijkheden toegekend. Deze instellingen kunnen eenvoudig aangepast worden, zodat meer organisatie en flexibiliteit mogelijk is.
</text>
</panel>
<panel name="roles_header">
@@ -22,14 +20,12 @@ mogelijk is.
Rollen
</text>
<text name="role_properties_modifiable">
- Selecteer een Rol hieronder. U kunt zijn Naam, Omschrijving en
-Lid Titel wijzigen.
+ Selecteer een Rol hieronder. U kunt zijn Naam, Omschrijving en Lid Titel wijzigen.
</text>
<text name="role_properties_not_modifiable">
- Selecteer een Rol hieronder om zijn eigenschappen, Leden en
-toegestane Mogelijkheden te bekijken.
+ Selecteer een Rol hieronder om zijn eigenschappen, Leden en toegestane Mogelijkheden te bekijken.
</text>
- <text bottom_delta="-28" name="role_actions_modifiable">
+ <text name="role_actions_modifiable">
U kunt ook Mogelijkheden aan de Rol toekennen.
</text>
<text name="role_actions_not_modifiable">
@@ -41,16 +37,14 @@ toegestane Mogelijkheden te bekijken.
Mogelijkheden
</text>
<text name="static2">
- U kunt de Omschrijving van een Mogelijkheid bekijken en welke Rollen en
-Leden de Mogelijkheid kunnen uitvoeren.
+ U kunt de Omschrijving van een Mogelijkheid bekijken en welke Rollen en Leden de Mogelijkheid kunnen uitvoeren.
</text>
</panel>
- <tab_container height="164" name="roles_tab_container">
- <panel height="148" label="Leden" name="members_sub_tab" tool_tip="Leden">
- <line_editor bottom="127" name="search_text"/>
+ <tab_container name="roles_tab_container">
+ <panel label="Leden" name="members_sub_tab" tool_tip="Leden">
<button label="Zoeken" name="search_button"/>
<button label="Alles Tonen" name="show_all_button"/>
- <name_list bottom_delta="-105" height="104" name="member_list">
+ <name_list name="member_list">
<column label="Lid Naam" name="name"/>
<column label="Gedoneerde Tier" name="donated"/>
<column label="Laatste Login" name="online"/>
@@ -61,16 +55,15 @@ Leden de Mogelijkheid kunnen uitvoeren.
U kunt Rollen aan Leden toewijzen of van Leden afnemen. Selecteer meerdere Leden door de Ctrl toets ingedrukt te houden en op hun namen te klikken.
</string>
</panel>
- <panel height="148" label="Rollen" name="roles_sub_tab">
- <line_editor bottom="127" name="search_text"/>
+ <panel label="Rollen" name="roles_sub_tab">
<button label="Zoeken" name="search_button"/>
<button label="Alles Tonen" name="show_all_button"/>
- <scroll_list bottom_delta="-104" height="104" name="role_list">
+ <scroll_list name="role_list">
<column label="Rol Naam" name="name"/>
<column label="Titel" name="title"/>
<column label="Leden" name="members"/>
</scroll_list>
- <button label="Nieuwe Rol Maken..." name="role_create"/>
+ <button label="Nieuwe Rol Maken ..." name="role_create"/>
<button label="Rol Verwijderen" name="role_delete"/>
<string name="help_text">
Rollen hebben een titel en een toegestane lijst met Mogelijkheden die Leden kunnen uitvoeren. Leden kunnen tot 1 of meer Rollen behoren. Een groep kan tot 10 Rollen bevatten, inclusief de Iedereen en Eigenaren Rollen.
@@ -79,11 +72,10 @@ Leden de Mogelijkheid kunnen uitvoeren.
De &apos;Iedereen&apos; en &apos;Eigenaren&apos; Rollen zijn speciaal en kunnen niet verwijderd worden.
</string>
</panel>
- <panel height="148" label="Mogelijkheden" name="actions_sub_tab">
- <line_editor bottom="127" name="search_text"/>
+ <panel label="Mogelijkheden" name="actions_sub_tab">
<button label="Zoeken" name="search_button"/>
<button label="Alles Tonen" name="show_all_button"/>
- <scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Selecteer een Mogelijkheid om meer details te bekijken."/>
+ <scroll_list name="action_list" tool_tip="Selecteer een Mogelijkheid om meer details te bekijken."/>
<string name="help_text">
Mogelijkheden stellen leden in staat om specifieke dingen in een groep te doen. Er is een brede variëteit aan Mogelijkheden.
</string>
diff --git a/indra/newview/skins/default/xui/nl/panel_groups.xml b/indra/newview/skins/default/xui/nl/panel_groups.xml
index a0c77b83ff..5b66eddb73 100644
--- a/indra/newview/skins/default/xui/nl/panel_groups.xml
+++ b/indra/newview/skins/default/xui/nl/panel_groups.xml
@@ -3,13 +3,13 @@
<text name="groupdesc">
Uw huidige actieve groep wordt vet getoond.
</text>
- <text name="groupcount" width="300">
+ <text name="groupcount">
U behoort tot [COUNT] groepen (maximaal [MAX]).
</text>
- <button label="IM/Oproepen" name="IM" tool_tip="Open Instant Message sessie" width="86"/>
- <button label="Info" name="Info" width="86"/>
- <button label="Activeren" name="Activate" width="86"/>
- <button label="Verlaten" name="Leave" width="86"/>
- <button label="Maak…" name="Create" width="86"/>
- <button label="Zoeken…" name="Search..." width="86"/>
+ <button label="IM/Oproepen" name="IM" tool_tip="Open Instant Message sessie"/>
+ <button label="Info" name="Info"/>
+ <button label="Activeren" name="Activate"/>
+ <button label="Verlaten" name="Leave"/>
+ <button label="Maak…" name="Create"/>
+ <button label="Zoeken…" name="Search..."/>
</panel>
diff --git a/indra/newview/skins/default/xui/nl/panel_region_estate.xml b/indra/newview/skins/default/xui/nl/panel_region_estate.xml
index 7a5fa801d9..731887dc5d 100644
--- a/indra/newview/skins/default/xui/nl/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/nl/panel_region_estate.xml
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Estate" name="Estate">
<text name="estate_help_text">
- Wijzigingen van instellingen op dit tabblad
-zullen alle regio&apos;s in de estate beïnvloeden.
+ Wijzigingen van instellingen op dit tabblad zullen alle regio&apos;s in de estate beïnvloeden.
</text>
<text name="estate_text">
Estate:
@@ -11,7 +10,7 @@ zullen alle regio&apos;s in de estate beïnvloeden.
(onbekend)
</text>
<text name="owner_text">
- Eigenaar:
+ Eigenaar
</text>
<text name="estate_owner">
(onbekend)
@@ -26,22 +25,21 @@ zullen alle regio&apos;s in de estate beïnvloeden.
<text name="Only Allow">
Beperk toegang tot:
</text>
- <check_box label="Inwoners met betalingsinformatie &#10;opgeslagen" name="limit_payment" tool_tip="Verban ongeïdentificeerde inwoners."/>
- <check_box label="Leeftijdgeverifieerde volwassenen" name="limit_age_verified" tool_tip="Verban inwoners die hun leeftijd niet geverifieerd hebben. Zie support.secondlife.com voor meer informatie." bottom_delta="-30"/>
+ <check_box label="Inwoners met betalingsinformatie opgeslagen" name="limit_payment" tool_tip="Verban ongeïdentificeerde inwoners."/>
+ <check_box label="Leeftijdgeverifieerde volwassenen" name="limit_age_verified" tool_tip="Verban inwoners die hun leeftijd niet geverifieerd hebben. Zie support.secondlife.com voor meer informatie."/>
<check_box label="Voice chat toestaan" name="voice_chat_check"/>
<button label="?" name="voice_chat_help"/>
<check_box label="Directe teleport toestaan" name="allow_direct_teleport"/>
<button label="?" name="allow_direct_teleport_help"/>
- <text name="abuse_email_text" bottom_delta="-23">
+ <text name="abuse_email_text">
Misbruik e-mail adres:
</text>
- <line_editor bottom_delta="-14" name="abuse_email_address" />
<string name="email_unsupported">
Optie niet ondersteund
</string>
<button label="?" name="abuse_email_address_help"/>
- <button label="Toepassen" name="apply_btn" bottom_delta="-22"/>
- <button label="Gebruiker verwijderen van estate..." name="kick_user_from_estate_btn"/>
+ <button label="Toepassen" name="apply_btn"/>
+ <button label="Gebruiker verwijderen van estate" name="kick_user_from_estate_btn"/>
<button label="Zend bericht naar estate..." name="message_estate_btn"/>
<text name="estate_manager_label">
Estate beheerders:
diff --git a/indra/newview/skins/default/xui/nl/panel_region_general.xml b/indra/newview/skins/default/xui/nl/panel_region_general.xml
index fe69fe9d9a..9ed822ac13 100644
--- a/indra/newview/skins/default/xui/nl/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/nl/panel_region_general.xml
@@ -29,9 +29,9 @@
<check_box label="Landverkoop toestaan" name="allow_land_resell_check"/>
<button label="?" name="land_resell_help"/>
<check_box label="Samenvoegen/opsplitsen land toestaan" name="allow_parcel_changes_check"/>
- <button label="?" name="parcel_changes_help" left="240"/>
+ <button label="?" name="parcel_changes_help"/>
<check_box label="Blokkeer zichtbaarheid land in zoeken" name="block_parcel_search_check" tool_tip="Laat mensen deze regio en zijn percelen in zoekresultaten zien"/>
- <button label="?" name="parcel_search_help" left="240"/>
+ <button label="?" name="parcel_search_help"/>
<spinner label="Agent limiet" name="agent_limit_spin"/>
<button label="?" name="agent_limit_help"/>
<spinner label="Object bonus" name="object_bonus_spin"/>
diff --git a/indra/newview/skins/default/xui/pl/floater_about_land.xml b/indra/newview/skins/default/xui/pl/floater_about_land.xml
index 5f4bf4ece6..7612212105 100755
--- a/indra/newview/skins/default/xui/pl/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/pl/floater_about_land.xml
@@ -343,42 +343,18 @@ Jedynie większe posiadłości mogą być umieszczone w bazie wyszukiwarki.
</combo_item>
</combo_box>
<combo_box name="land category">
- <combo_item name="AnyCategory">
- Każda
- </combo_item>
- <combo_item name="LindenLocation">
- Linden Lokacja
- </combo_item>
- <combo_item name="Arts&amp;Culture">
- Sztuka i Kultura
- </combo_item>
- <combo_item name="Business">
- Biznes
- </combo_item>
- <combo_item name="Educational">
- Edukacyjna
- </combo_item>
- <combo_item name="Gaming">
- Gra
- </combo_item>
- <combo_item name="Hangout">
- Poznawanie ludzi
- </combo_item>
- <combo_item name="NewcomerFriendly">
- Przyjazna dla nowych
- </combo_item>
- <combo_item name="Parks&amp;Nature">
- Parki i Natura
- </combo_item>
- <combo_item name="Residential">
- Mieszkalna
- </combo_item>
- <combo_item name="Shopping">
- Komercja/Sklepy
- </combo_item>
- <combo_item name="Other">
- Inna
- </combo_item>
+ <combo_box.item name="AnyCategory" label="Każda"/>
+ <combo_box.item name="LindenLocation" label="Linden Lokacja"/>
+ <combo_box.item name="Arts&amp;Culture" label="Sztuka i Kultura"/>
+ <combo_box.item name="Business" label="Biznes"/>
+ <combo_box.item name="Educational" label="Edukacyjna"/>
+ <combo_box.item name="Gaming" label="Gra"/>
+ <combo_box.item name="Hangout" label="Poznawanie ludzi"/>
+ <combo_box.item name="NewcomerFriendly" label="Przyjazna dla nowych"/>
+ <combo_box.item name="Parks&amp;Nature" label="Parki i Natura"/>
+ <combo_box.item name="Residential" label="Mieszkalna"/>
+ <combo_box.item name="Shopping" label="Komercja/Sklepy"/>
+ <combo_box.item name="Other" label="Inna"/>
</combo_box>
<button label="?" label_selected="?" name="?"/>
<check_box label="Treść &apos;Mature&apos;" name="MatureCheck" tool_tip=""/>
@@ -410,15 +386,9 @@ Jedynie większe posiadłości mogą być umieszczone w bazie wyszukiwarki.
Trasa Teleportacji:
</text>
<combo_box name="landing type" tool_tip="Trasa Teleportacj-ustaw w jaki sposób będzie sę odbywać proces telportacji w posiadłości.">
- <combo_item length="1" name="Blocked" type="string">
- Zablokowana
- </combo_item>
- <combo_item length="1" name="LandingPoint" type="string">
- Punkt Lądowania
- </combo_item>
- <combo_item length="1" name="Anywhere" type="string">
- Gdziekolwiek
- </combo_item>
+ <combo_box.item length="1" name="Blocked" type="string" label="Zablokowana"/>
+ <combo_box.item length="1" name="LandingPoint" type="string" label="Punkt Lądowania"/>
+ <combo_box.item length="1" name="Anywhere" type="string" label="Gdziekolwiek"/>
</combo_box>
<string name="push_restrict_text">
Popychanie niedozwolone
@@ -497,12 +467,8 @@ Mediów:
<check_box label="Udostępnij wejście grupie: [GROUP]" name="GroupCheck" tool_tip="Ustaw grupę w głównej zakładce"/>
<check_box label="Sprzedaj wejściówki:" name="PassCheck" tool_tip="Otwórz tymczasowy dostęp do tej posiadłości"/>
<combo_box name="pass_combo">
- <combo_item name="Anyone">
- Każdemu
- </combo_item>
- <combo_item name="Group">
- Grupie
- </combo_item>
+ <combo_box.item name="Anyone" label="Każdemu"/>
+ <combo_box.item name="Group" label="Grupie"/>
</combo_box>
<spinner label="Cena w L$:" name="PriceSpin"/>
<spinner label="Ilość godzin dostępu:" name="HoursSpin"/>
diff --git a/indra/newview/skins/default/xui/pl/floater_joystick.xml b/indra/newview/skins/default/xui/pl/floater_joystick.xml
index 8e21f225ca..8ce113514b 100755
--- a/indra/newview/skins/default/xui/pl/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/pl/floater_joystick.xml
@@ -3,7 +3,6 @@
<check_box name="enable_joystick">
Aktywuj Joystick:
</check_box>
- <text left="130" name="joystick_type" width="360"/>
<spinner label="Kalibracja Osi X" left="20" width="170" label_width="130" name="JoystickAxis1"/>
<spinner label="Kalibracja Osi Y" left="210" width="170" label_width="130" name="JoystickAxis2" />
<spinner label="Kalibracja Osi Z" left="400" width="170" label_width="130" name="JoystickAxis0" />
@@ -14,104 +13,104 @@
<check_box label="Bezpośrednie" left="205" name="ZoomDirect" />
<check_box label="Kursor 3D" left="340" name="Cursor3D" />
<check_box label="Automatyczne" left="450" name="AutoLeveling" />
- <text length="1" left="22" name="Control Modes:" type="string">
+ <text length="1" left="42" name="Control Modes:" type="string">
Kontroluj:
</text>
- <check_box left="130" width="90" name="JoystickAvatarEnabled">
+ <check_box left="150" width="90" name="JoystickAvatarEnabled">
Awatara
</check_box>
- <check_box left="205" width="90" name="JoystickBuildEnabled">
+ <check_box left="249" width="90" name="JoystickBuildEnabled">
Budowanie
</check_box>
- <check_box left="282" width="90" name="JoystickFlycamEnabled">
+ <check_box left="340" width="90" name="JoystickFlycamEnabled">
Kamerę podczas latania
</check_box>
- <text width="104" name="XScale">
+ <text width="124" name="XScale">
Skala X
</text>
- <spinner left="133" name="AvatarAxisScale1" />
- <spinner left="208" name="BuildAxisScale1" />
+ <spinner left="153" name="AvatarAxisScale1" />
+ <spinner left="218" name="BuildAxisScale1" />
<spinner left="283" name="FlycamAxisScale1" />
- <text width="104" name="YScale">
+ <text width="124" name="YScale">
Skala Y
</text>
- <spinner left="133" name="AvatarAxisScale2" />
- <spinner left="208" name="BuildAxisScale2" />
+ <spinner left="153" name="AvatarAxisScale2" />
+ <spinner left="218" name="BuildAxisScale2" />
<spinner left="283" name="FlycamAxisScale2" />
- <text width="104" name="ZScale">
+ <text width="124" name="ZScale">
Skala Z
</text>
- <spinner left="133" name="AvatarAxisScale0" />
- <spinner left="208" name="BuildAxisScale0" />
+ <spinner left="153" name="AvatarAxisScale0" />
+ <spinner left="218" name="BuildAxisScale0" />
<spinner left="283" name="FlycamAxisScale0" />
- <text width="104" name="PitchScale">
+ <text width="124" name="PitchScale">
Skala Wznoszenia
</text>
- <spinner left="133" name="AvatarAxisScale4" />
- <spinner left="208" name="BuildAxisScale4" />
+ <spinner left="153" name="AvatarAxisScale4" />
+ <spinner left="218" name="BuildAxisScale4" />
<spinner left="283" name="FlycamAxisScale4" />
- <text width="104" name="YawScale">
+ <text width="124" name="YawScale">
Skala Odchylania
</text>
- <spinner left="133" name="AvatarAxisScale5" />
- <spinner left="208" name="BuildAxisScale5" />
+ <spinner left="153" name="AvatarAxisScale5" />
+ <spinner left="218" name="BuildAxisScale5" />
<spinner left="283" name="FlycamAxisScale5" />
- <text width="104" name="RollScale">
+ <text width="124" name="RollScale">
Skala Obrotu
</text>
- <spinner left="208" name="BuildAxisScale3" />
+ <spinner left="218" name="BuildAxisScale3" />
<spinner left="283" name="FlycamAxisScale3" />
- <text width="104" name="XDeadZone">
+ <text width="124" name="XDeadZone">
Tolerancja Osi X
</text>
- <spinner left="133" name="AvatarAxisDeadZone1" />
- <spinner left="208" name="BuildAxisDeadZone1" />
+ <spinner left="153" name="AvatarAxisDeadZone1" />
+ <spinner left="218" name="BuildAxisDeadZone1" />
<spinner left="283" name="FlycamAxisDeadZone1" />
- <text width="104" name="YDeadZone">
+ <text width="124" name="YDeadZone">
Tolerancja Osi Y
</text>
- <spinner left="133" name="AvatarAxisDeadZone2" />
- <spinner left="208" name="BuildAxisDeadZone2" />
+ <spinner left="153" name="AvatarAxisDeadZone2" />
+ <spinner left="218" name="BuildAxisDeadZone2" />
<spinner left="283" name="FlycamAxisDeadZone2" />
- <text width="104" name="ZDeadZone">
+ <text width="124" name="ZDeadZone">
Tolerancja Osi Z
</text>
- <spinner left="133" name="AvatarAxisDeadZone0" />
- <spinner left="208" name="BuildAxisDeadZone0" />
+ <spinner left="153" name="AvatarAxisDeadZone0" />
+ <spinner left="218" name="BuildAxisDeadZone0" />
<spinner left="283" name="FlycamAxisDeadZone0" />
- <text width="104" name="PitchDeadZone">
+ <text width="124" name="PitchDeadZone">
Tolerancja Wznoszenia
</text>
- <spinner left="133" name="AvatarAxisDeadZone4" />
- <spinner left="208" name="BuildAxisDeadZone4" />
+ <spinner left="153" name="AvatarAxisDeadZone4" />
+ <spinner left="218" name="BuildAxisDeadZone4" />
<spinner left="283" name="FlycamAxisDeadZone4" />
- <text width="104" name="YawDeadZone">
+ <text width="124" name="YawDeadZone">
Tolerancja Odchylania
</text>
- <spinner left="133" name="AvatarAxisDeadZone5" />
- <spinner left="208" name="BuildAxisDeadZone5" />
+ <spinner left="153" name="AvatarAxisDeadZone5" />
+ <spinner left="218" name="BuildAxisDeadZone5" />
<spinner left="283" name="FlycamAxisDeadZone5" />
- <text width="104" name="RollDeadZone">
+ <text width="124" name="RollDeadZone">
Tolerancja Obrotu
</text>
- <spinner left="208" name="BuildAxisDeadZone3" />
+ <spinner left="218" name="BuildAxisDeadZone3" />
<spinner left="283" name="FlycamAxisDeadZone3" />
- <text width="104" name="Feathering">
+ <text width="124" name="Feathering">
Przenikanie
</text>
- <slider left="125" label="" name="AvatarFeathering" />
- <slider left="200" label="" name="BuildFeathering" />
+ <slider left="145" label="" name="AvatarFeathering" />
+ <slider left="210" label="" name="BuildFeathering" />
<slider left="275" label="" name="FlycamFeathering" />
- <text width="104" name="ZoomScale2">
+ <text width="124" name="ZoomScale2">
Skala Powiększania
</text>
<spinner left="283" label="" name="FlycamAxisScale6" />
- <text width="104" name="ZoomDeadZone">
+ <text width="124" name="ZoomDeadZone">
Tolerancja Powiększania
</text>
<spinner left="283" label="" name="FlycamAxisDeadZone6" />
<button left="366" label="Ustawienia Domyślne" name="SpaceNavigatorDefaults" />
- <button left="366" label="OK" label_selected="OK" name="ok_btn" />
+ <button label="OK" label_selected="OK" name="ok_btn" />
<button label="Anuluj" label_selected="Anuluj" name="cancel_btn" />
<string name="JoystickMonitor">
Monitor Joysticka
diff --git a/indra/newview/skins/default/xui/pl/floater_preview_sound.xml b/indra/newview/skins/default/xui/pl/floater_preview_sound.xml
index 0c8684a8cf..c9dd20128d 100755
--- a/indra/newview/skins/default/xui/pl/floater_preview_sound.xml
+++ b/indra/newview/skins/default/xui/pl/floater_preview_sound.xml
@@ -8,5 +8,5 @@
tool_tip="Dźwięk będzie słyszalny tylko dla Ciebie." />
<button label="Odtwarzaj w Świecie" label_selected="Odtwarzaj w Świecie"
name="Sound play btn"
- tool_tip="Dźwięk będzie słyszalny przez wszystkich." width="130" left_delta="-136"/>
+ tool_tip="Dźwięk będzie słyszalny przez wszystkich." />
</floater>
diff --git a/indra/newview/skins/default/xui/pl/floater_telehub.xml b/indra/newview/skins/default/xui/pl/floater_telehub.xml
index 917ab95ecc..b4cf098878 100755
--- a/indra/newview/skins/default/xui/pl/floater_telehub.xml
+++ b/indra/newview/skins/default/xui/pl/floater_telehub.xml
@@ -12,8 +12,8 @@
<text name="help_text_not_connected">
Wybierz obiekt i kliknij Połącz z teleporterem
</text>
- <button label="Połącz z teleporterem" name="connect_btn" width="132" />
- <button label="Rozłącz" name="disconnect_btn" left="152" width="88"/>
+ <button label="Połącz z teleporterem" name="connect_btn" width="122" />
+ <button label="Rozłącz" name="disconnect_btn" left="142" width="98"/>
<text name="spawn_points_text" width="250">
Punkty Składowe (pozycje - nie obiekty!):
</text>
diff --git a/indra/newview/skins/default/xui/pl/floater_tools.xml b/indra/newview/skins/default/xui/pl/floater_tools.xml
index c896222646..380943f4ad 100755
--- a/indra/newview/skins/default/xui/pl/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pl/floater_tools.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="toolbox floater" title="" short_title="Buduj">
+<floater name="toolbox floater" title="">
<button label="" label_selected="" name="button focus" tool_tip="Zbliżenie"/>
<button label="" label_selected="" name="button move" tool_tip="Przesunięcie"/>
<button label="" label_selected="" name="button edit" tool_tip="Edycja"/>
@@ -311,10 +311,10 @@
</combo_item>
</combo_box>
<text name="text cut">
- Wykrój początek i koniec
+ Wykrój
</text>
- <spinner label="P" name="cut begin"/>
- <spinner label="K" name="cut end"/>
+ <spinner label="B" name="cut begin"/>
+ <spinner label="E" name="cut end"/>
<text name="text hollow">
Wydrążenie
</text>
@@ -343,8 +343,8 @@
<text name="text twist">
Skręcenie
</text>
- <spinner label="P" name="Twist Begin"/>
- <spinner label="K" name="Twist End"/>
+ <spinner label="B" name="Twist Begin"/>
+ <spinner label="E" name="Twist End"/>
<text name="scale_taper">
Zwężenie
</text>
@@ -367,8 +367,8 @@
<text name="advanced_slice">
Przetnij początek i koniec
</text>
- <spinner label="P" name="Path Limit Begin"/>
- <spinner label="K" name="Path Limit End"/>
+ <spinner label="B" name="Path Limit Begin"/>
+ <spinner label="E" name="Path Limit End"/>
<text name="text taper2">
Zwężenie
</text>
@@ -434,15 +434,15 @@
<panel label="Tekstura" name="Texture">
<texture_picker label="Tekstura" name="texture control" tool_tip="Kliknij by wybrać obraz"/>
<color_swatch label="Kolor" name="colorswatch" tool_tip="Kliknij by wybrać kolor"/>
- <text name="color trans" left="170" width="99">
- Przezroczystość%
+ <text name="color trans">
+ Przezroczystość %
</text>
- <spinner left="170" name="ColorTrans"/>
- <text name="glow label" left="170">
+ <spinner name="ColorTrans"/>
+ <text name="glow label">
Blask
</text>
- <spinner left="170" name="glow"/>
- <check_box label="Jaskrawość" name="checkbox fullbright" left="170"/>
+ <spinner name="glow"/>
+ <check_box label="Jaskrawość" name="checkbox fullbright"/>
<text name="tex gen">
Mapowanie
</text>
@@ -561,7 +561,7 @@
Dopasuj Teksturę Mediów
(najpierw załaduj)
</text>
- <button label="Dopasuj" label_selected="Dopasuj" name="button align" left="160"/>
+ <button label="Dopasuj" label_selected="Dopasuj" name="button align"/>
</panel>
<panel label="Treść" name="Contents">
<button label="Nowy Skrypt" label_selected="Nowy Skrypt..." name="button new script"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_about_land.xml b/indra/newview/skins/default/xui/pt/floater_about_land.xml
index 79db9db822..fee7ed60f5 100644
--- a/indra/newview/skins/default/xui/pt/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/pt/floater_about_land.xml
@@ -301,7 +301,7 @@ Apenas lotes maiores podem ser listados na busca.
<string name="search_disabled_permissions_tooltip">
Esta opção está desabilitada porque você não pode modificar as opções deste lote.
</string>
- <combo_box name="land category with adult" left="265" width="155">
+ <combo_box name="land category with adult">
<combo_item name="AnyCategory">
Qualquer Categoria
</combo_item>
@@ -342,43 +342,19 @@ Apenas lotes maiores podem ser listados na busca.
Outros
</combo_item>
</combo_box>
- <combo_box name="land category" left="265" width="155">
- <combo_item name="AnyCategory">
- Qualquer Categoria
- </combo_item>
- <combo_item name="LindenLocation">
- Locação Linden
- </combo_item>
- <combo_item name="Arts&amp;Culture">
- Artes e Cultura
- </combo_item>
- <combo_item name="Business">
- Negócios
- </combo_item>
- <combo_item name="Educational">
- Educacional
- </combo_item>
- <combo_item name="Gaming">
- Jogo
- </combo_item>
- <combo_item name="Hangout">
- Lazer
- </combo_item>
- <combo_item name="NewcomerFriendly">
- Amigável para novatos
- </combo_item>
- <combo_item name="Parks&amp;Nature">
- Parques e Natureza
- </combo_item>
- <combo_item name="Residential">
- Residencial
- </combo_item>
- <combo_item name="Shopping">
- Compras
- </combo_item>
- <combo_item name="Other">
- Outros
- </combo_item>
+ <combo_box left="276" name="land category" width="146">
+ <combo_box.item name="AnyCategory" label="Qualquer Categoria"/>
+ <combo_box.item name="LindenLocation" label="Locação Linden"/>
+ <combo_box.item name="Arts&amp;Culture" label="Artes e Cultura"/>
+ <combo_box.item name="Business" label="Negócios"/>
+ <combo_box.item name="Educational" label="Educacional"/>
+ <combo_box.item name="Gaming" label="Jogo"/>
+ <combo_box.item name="Hangout" label="Lazer"/>
+ <combo_box.item name="NewcomerFriendly" label="Amigável para novatos"/>
+ <combo_box.item name="Parks&amp;Nature" label="Parques e Natureza"/>
+ <combo_box.item name="Residential" label="Residencial"/>
+ <combo_box.item name="Shopping" label="Compras"/>
+ <combo_box.item name="Other" label="Outros"/>
</combo_box>
<button label="?" label_selected="?" left="426" name="?"/>
<check_box label="Conteúdo Mature" name="MatureCheck" tool_tip=""/>
@@ -409,16 +385,10 @@ Apenas lotes maiores podem ser listados na busca.
<text length="1" name="Teleport Routing: " type="string">
Rota de Tele-transporte:
</text>
- <combo_box width="160" left="140" name="landing type" tool_tip="Rota de Teletransporte -- Selecione como tratar os tele-transportes no seu lote.">
- <combo_item length="1" name="Blocked" type="string">
- Bloqueado
- </combo_item>
- <combo_item length="1" name="LandingPoint" type="string">
- Ponto de Aterrissagem
- </combo_item>
- <combo_item length="1" name="Anywhere" type="string">
- Qualquer lugar
- </combo_item>
+ <combo_box left="140" name="landing type" tool_tip="Rota de Teletransporte -- Selecione como tratar os tele-transportes no seu lote." width="140">
+ <combo_box.item length="1" name="Blocked" type="string" label="Bloqueado"/>
+ <combo_box.item length="1" name="LandingPoint" type="string" label="Ponto de Aterrissagem"/>
+ <combo_box.item length="1" name="Anywhere" type="string" label="Qualquer lugar"/>
</combo_box>
<string name="push_restrict_text">
Sem Empurrar
@@ -499,12 +469,8 @@ Mídia:
<check_box label="Permitir Acesso do Grupo: [GROUP]" name="GroupCheck" tool_tip="Definir grupo na aba Geral."/>
<check_box label="Vender passes para:" name="PassCheck" tool_tip="Permite acesso temporário a este terreno"/>
<combo_box name="pass_combo">
- <combo_item name="Anyone">
- Qualquer um
- </combo_item>
- <combo_item name="Group">
- Grupo
- </combo_item>
+ <combo_box.item name="Anyone" label="Qualquer um"/>
+ <combo_box.item name="Group" label="Grupo"/>
</combo_box>
<spinner label="Preço em L$:" name="PriceSpin"/>
<spinner label="Horas de Acesso:" name="HoursSpin"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_avatar_picker.xml b/indra/newview/skins/default/xui/pt/floater_avatar_picker.xml
index 4e1598c8fa..8f433a635d 100644
--- a/indra/newview/skins/default/xui/pt/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/pt/floater_avatar_picker.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="avatarpicker" title="Escolha o Residente" min_width="285" width="285">
- <tab_container name="ResidentChooserTabs" width="275">
+<floater name="avatarpicker" title="Escolha o Residente">
+ <tab_container name="ResidentChooserTabs">
<panel label="Buscar" name="SearchPanel">
<text name="InstructSearchResidentName">
Digite parte do nome do Residente:
@@ -14,15 +14,13 @@
</panel>
<panel label="Próximo a Mim" name="NearMePanel">
<text name="InstructSelectResident">
- Selecione residente
-próximo:
+ Selecione residente próximo:
</text>
- <button font="SansSerifSmall" left_delta="1" width="115" label="Atualizar Lista" label_selected="Atualizar Lista" name="Refresh"/>
- <slider label="Faixa" name="near_me_range" bottom_delta="-36"/>
+ <button label="Atualizar Lista" label_selected="Atualizar Lista" name="Refresh"/>
+ <slider label="Faixa" name="near_me_range"/>
<text name="meters">
Metros
</text>
- <scroll_list bottom_delta="-169" height="159" name="NearMe" />
</panel>
</tab_container>
<button label="Selecionar" label_selected="Selecionar" name="Select"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_build_options.xml b/indra/newview/skins/default/xui/pt/floater_build_options.xml
index ebc9d0f0c8..4dfebc3abd 100644
--- a/indra/newview/skins/default/xui/pt/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/pt/floater_build_options.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="build options floater" title="Opções de grade">
- <spinner label="Uni. Grade (metros)" name="GridResolution" width="180" label_width="122"/>
- <spinner label="Ext. da Grade (metros)" name="GridDrawSize" width="180" label_width="122"/>
+ <spinner label="Uni. Grade (metros)" name="GridResolution"/>
+ <spinner label="Ext. da Grade (metros)" name="GridDrawSize"/>
<check_box label="Habilitar ajuste de sub-grade" name="GridSubUnit"/>
<check_box label="Mostrar as seções de cruzamento" name="GridCrossSection"/>
- <slider label="Opacidade da grade" name="GridOpacity" width="220"/>
+ <slider label="Opacidade da grade" name="GridOpacity"/>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_buy_contents.xml b/indra/newview/skins/default/xui/pt/floater_buy_contents.xml
index 3e8713d59e..0c1fb77a08 100644
--- a/indra/newview/skins/default/xui/pt/floater_buy_contents.xml
+++ b/indra/newview/skins/default/xui/pt/floater_buy_contents.xml
@@ -6,9 +6,9 @@
<text name="buy_text">
Comprar por L$[AMOUNT] de(a) [NAME]?
</text>
- <button label="Cancelar" label_selected="Cancelar" name="cancel_btn" width="73"/>
- <button label="Comprar" label_selected="Comprar" name="buy_btn" width="73" left_delta="-77"/>
- <check_box label="Vestir roupa agora" name="wear_check" left_delta="-130"/>
+ <button label="Cancelar" label_selected="Cancelar" name="cancel_btn"/>
+ <button label="Comprar" label_selected="Comprar" name="buy_btn"/>
+ <check_box label="Vestir roupa agora" name="wear_check"/>
<string name="no_copy_text">
(sem copiar)
</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_color_picker.xml b/indra/newview/skins/default/xui/pt/floater_color_picker.xml
index 95dd53ccd4..475280b013 100644
--- a/indra/newview/skins/default/xui/pt/floater_color_picker.xml
+++ b/indra/newview/skins/default/xui/pt/floater_color_picker.xml
@@ -19,14 +19,12 @@
Lum:
</text>
<check_box label="Aplicar imediatamente" name="apply_immediate"/>
- <button left_delta="150" name="color_pipette" />
- <button left_delta="55" label="Cancelar" label_selected="Cancelar" name="cancel_btn"/>
+ <button label="Cancelar" label_selected="Cancelar" name="cancel_btn"/>
<button label="Selecionar" label_selected="Selecionar" name="select_btn"/>
<text name="Current color:">
Cor atual:
</text>
<text name="(Drag below to save.)">
- (Arraste abaixo
- para salvar.)
+ (Arraste abaixo para salvar.)
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml
index f02cca9c25..5049b87a56 100644
--- a/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml
+++ b/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml
@@ -4,35 +4,35 @@
<panel label="Ciclo do dia" name="Day Cycle">
<button label="?" name="WLDayCycleHelp"/>
<text name="WL12am">
- 0:00
+ 12:00 meia-noite
</text>
<text name="WL3am">
- 3:00
+ 3:00 da manhã
</text>
<text name="WL6am">
- 6:00
+ 6:00 da manhã
</text>
<text name="WL9amHash">
- 9:00
+ 9:00 da manhã
</text>
<text name="WL12pmHash">
- 12:00
+ 12:00 meio dia
</text>
<text name="WL3pm">
- 15:00
+ 3:00 da tarde
</text>
<text name="WL6pm">
- 18:00
+ 6:00 da tarde
</text>
<text name="WL9pm">
- 21:00
+ 9:00 da noite
</text>
<text name="WL12am2">
- 24:00
+ 12:00 meia noite
</text>
- <button font="SansSerifSmall" width="96" left="546" label="Adicionar chave" label_selected="Adicionar chave" name="WLAddKey"/>
- <button font="SansSerifSmall" width="96" left="546" label="Apagar chave" label_selected="Apagar chave" name="WLDeleteKey"/>
- <text name="WLCurKeyFrameText" width="190" left="17">
+ <button label="Add Key" label_selected="Adicionar chave" name="WLAddKey"/>
+ <button label="Apagar chave" label_selected="Apagar chave" name="WLDeleteKey"/>
+ <text name="WLCurKeyFrameText">
Configurações de Quadro-chave:
</text>
<text name="WLCurKeyTimeText">
@@ -47,7 +47,7 @@
<text name="DayCycleText">
Grudar:
</text>
- <combo_box label="5 minutos" name="WLSnapOptions" width="85"/>
+ <combo_box label="5 minutos" name="WLSnapOptions"/>
<text name="DayCycleText2">
Duração do Ciclo:
</text>
@@ -59,7 +59,7 @@
</text>
<button label="Tocar" label_selected="Tocar" name="WLAnimSky"/>
<button label="Pare!" label_selected="Pare" name="WLStopAnimSky"/>
- <button width="175" font="SansSerifSmall" label="Usar o horário da Propriedade" label_selected="Ir para o horário da Propriedade" name="WLUseLindenTime"/>
+ <button label="Usar o horário da Propriedade" label_selected="Ir para o horário da Propriedade" name="WLUseLindenTime"/>
<button label="Salvar o Dia teste" label_selected="Salvar o Dia teste" name="WLSaveDayCycle"/>
<button label="Carregar o Dia teste" label_selected="Carregar o Dia teste" name="WLLoadDayCycle"/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/floater_env_settings.xml b/indra/newview/skins/default/xui/pt/floater_env_settings.xml
index d3ed760551..b1c85a32b7 100644
--- a/indra/newview/skins/default/xui/pt/floater_env_settings.xml
+++ b/indra/newview/skins/default/xui/pt/floater_env_settings.xml
@@ -7,19 +7,17 @@
12:00 PM
</text>
<text name="EnvCloudText">
- Cobertura de
-Nuvens
+ Cobertura de Nuvens
</text>
<text name="EnvWaterColorText">
Cor da água
</text>
<color_swatch label="" name="EnvWaterColor" tool_tip="Clique para abrir o Editor de cores"/>
<text name="EnvWaterFogText">
- Névoa da
-água
+ Névoa da água
</text>
- <button bottom="-144" label="Usar hora da propriedade" name="EnvUseEstateTimeButton" width="155"/>
- <button label="Céu Avançado" name="EnvAdvancedSkyButton" width="155" left="167"/>
- <button label="Água Avançada" name="EnvAdvancedWaterButton" width="155" left="326"/>
+ <button label="Usar hora da propriedade" name="EnvUseEstateTimeButton"/>
+ <button label="Céu Avançado" name="EnvAdvancedSkyButton"/>
+ <button label="Água Avançada" name="EnvAdvancedWaterButton"/>
<button label="?" name="EnvSettingsHelpButton"/>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_inspect.xml b/indra/newview/skins/default/xui/pt/floater_inspect.xml
index f3c23f008e..f3d4b0f33f 100644
--- a/indra/newview/skins/default/xui/pt/floater_inspect.xml
+++ b/indra/newview/skins/default/xui/pt/floater_inspect.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="inspect" title="Inspecionar Objeto" min_width="450">
+<floater name="inspect" title="Inspecionar Objeto">
<scroll_list name="object_list" tool_tip="Selecione um objeto nesta lista para destacá-lo in-world">
<column label="Nome do Objeto" name="object_name"/>
- <column label="Proprietário" name="owner_name"/>
- <column label="Criador" name="creator_name"/>
+ <column label="Nome do Proprietário" name="owner_name"/>
+ <column label="Nome do Criador" name="creator_name"/>
<column label="Data de Criação" name="creation_date"/>
</scroll_list>
- <button width="185" label="Ver Perfil do Proprietário..." label_selected="" name="button owner" tool_tip="Veja o perfil do proprietário do objeto destacado"/>
- <button width="165" left="205" label="Ver perfil do criador..." label_selected="" name="button creator" tool_tip="Veja o perfil do criador original do objeto destacado"/>
+ <button label="Ver Perfil do Proprietário..." label_selected="" name="button owner" tool_tip="Veja o perfil do proprietário do objeto destacado"/>
+ <button label="Ver perfil do criador..." label_selected="" name="button creator" tool_tip="Veja o perfil do criador original do objeto destacado"/>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/pt/floater_inventory_view_finder.xml
index ed36826800..634e236650 100644
--- a/indra/newview/skins/default/xui/pt/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/pt/floater_inventory_view_finder.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Inventory Finder" title="itens_de_inventário_recentes" width="165">
+<floater name="Inventory Finder" title="itens_de_inventário_recentes">
<check_box label="Animação" name="check_animation"/>
<check_box label="Cartões de chamadas" name="check_calling_card"/>
<check_box label="Roupas" name="check_clothing"/>
@@ -13,8 +13,8 @@
<check_box label="Fotos" name="check_snapshot"/>
<button label="Tudo" label_selected="Tudo" name="All"/>
<button label="Nenhum" label_selected="Nenhum" name="None"/>
- <check_box label="Sempre mostrar as pastas" name="check_show_empty" left="3"/>
- <check_box label="Desde o Logoff" name="check_since_logoff" left="3"/>
+ <check_box label="Sempre mostrar as pastas" name="check_show_empty"/>
+ <check_box label="Desde o Logoff" name="check_since_logoff"/>
<text length="1" name="- OR -" type="string">
- OU -
</text>
diff --git a/indra/newview/skins/default/xui/pt/floater_joystick.xml b/indra/newview/skins/default/xui/pt/floater_joystick.xml
index 0bc3928710..6c2e4a5144 100644
--- a/indra/newview/skins/default/xui/pt/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/pt/floater_joystick.xml
@@ -3,15 +3,14 @@
<check_box name="enable_joystick">
Habilitar Joystick:
</check_box>
- <text left="135" name="joystick_type" width="360"/>
- <spinner label="Mapeamento: eixo X" name="JoystickAxis1" label_width="124" width="164"/>
- <spinner label="Mapeamento: eixo Y" name="JoystickAxis2" label_width="124" width="164"/>
- <spinner label="Mapeamento: eixo Z" name="JoystickAxis0" label_width="124" width="164"/>
- <spinner label="Mapeamento: Elevação" name="JoystickAxis4" label_width="124" width="164"/>
- <spinner label="Mapeamento: Guinada" name="JoystickAxis5" label_width="124" width="164"/>
- <spinner label="Mapeamento: Rolagem" name="JoystickAxis3" label_width="124" width="164"/>
- <spinner label="Mapeamento: Zoom" name="JoystickAxis6" label_width="124" width="164"/>
- <check_box label="Zoom Direto" name="ZoomDirect" left="194"/>
+ <spinner label="Mapeamento do eixo X" name="JoystickAxis1"/>
+ <spinner label="Mapeamento do eixo Y" name="JoystickAxis2"/>
+ <spinner label="Mapeamento do Eixo Z" name="JoystickAxis0"/>
+ <spinner label="Mapeamento da Elevação" name="JoystickAxis4"/>
+ <spinner label="Mapeamento da Guinada" name="JoystickAxis5"/>
+ <spinner label="Mapeamento da Rolagem" name="JoystickAxis3"/>
+ <spinner label="Mapeamento do Zoom" name="JoystickAxis6"/>
+ <check_box label="Zoom Direto" name="ZoomDirect"/>
<check_box label="Cursor 3D" name="Cursor3D"/>
<check_box label="Nível Automático" name="AutoLeveling"/>
<text name="Control Modes:">
@@ -20,7 +19,7 @@
<check_box name="JoystickAvatarEnabled">
Avatar
</check_box>
- <check_box name="JoystickBuildEnabled" left="192">
+ <check_box name="JoystickBuildEnabled">
Construir
</check_box>
<check_box name="JoystickFlycamEnabled">
@@ -35,13 +34,13 @@
<text name="ZScale">
Escala Z
</text>
- <text name="PitchScale" left="3" width="115">
+ <text name="PitchScale">
Escala de Elevação
</text>
- <text name="YawScale" left="3" width="115">
+ <text name="YawScale">
Escala da Guinada
</text>
- <text name="RollScale" left="3" width="115">
+ <text name="RollScale">
Escala de Rolagem
</text>
<text name="XDeadZone">
@@ -53,14 +52,14 @@
<text name="ZDeadZone">
Zona Morta Z
</text>
- <text name="PitchDeadZone" left="3" width="115">
- Zona Morta: Elevação
+ <text name="PitchDeadZone">
+ Zona Morta da Elevação
</text>
- <text name="YawDeadZone" left="3" width="115">
- Zona Morta: Guinada
+ <text name="YawDeadZone">
+ Zona Morta da Guinada
</text>
- <text name="RollDeadZone" left="3" width="115">
- Zona Morta: Rolagem
+ <text name="RollDeadZone">
+ Zona Morta de Rolagem
</text>
<text name="Feathering">
Alisar
@@ -68,10 +67,10 @@
<text name="ZoomScale2">
Escala de Zoom
</text>
- <text name="ZoomDeadZone" width="110" left="4">
+ <text name="ZoomDeadZone">
Zona Morta de Zoom
</text>
- <button label="Padrões do SpaceNavigator" name="SpaceNavigatorDefaults" font="SansSerifSmall"/>
+ <button label="Padrões do Navegador Espacial" name="SpaceNavigatorDefaults"/>
<button label="OK" label_selected="OK" name="ok_btn"/>
<button label="Cancelar" label_selected="Cancelar" name="cancel_btn"/>
<string name="JoystickMonitor">
diff --git a/indra/newview/skins/default/xui/pt/floater_lagmeter.xml b/indra/newview/skins/default/xui/pt/floater_lagmeter.xml
index 6657641992..9dbad7099e 100644
--- a/indra/newview/skins/default/xui/pt/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/pt/floater_lagmeter.xml
@@ -1,27 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="floater_lagmeter" title="Medidor de Atraso">
<button label="" label_selected="" name="client_lagmeter" tool_tip="Status de atraso no Cliente"/>
- <text left="30" name="client_lag_cause" right="-10" />
- <text left="30" name="network_lag_cause" right="-10" />
- <text left="30" name="server_lag_cause" right="-32" />
<text name="client">
Cliente:
</text>
- <text name="client_text" font="SansSerifSmall">
+ <text name="client_text">
Normal
</text>
<button label="" label_selected="" name="network_lagmeter" tool_tip="Status de atraso na rede"/>
<text name="network">
Rede:
</text>
- <text name="network_text" font="SansSerifSmall">
+ <text name="network_text">
Normal
</text>
<button label="" label_selected="" name="server_lagmeter" tool_tip="Status de atraso no servidor"/>
<text name="server">
Servidor:
</text>
- <text name="server_text" font="SansSerifSmall">
+ <text name="server_text">
Normal
</text>
<button label="?" name="server_help"/>
@@ -120,10 +117,10 @@
20
</string>
<string name="server_frame_time_critical_msg">
- Taxa de quadros abaixo de [SERVER_FRAME_RATE_CRITICAL]
+ Taxa de quadros do simulador abaixo de [SERVER_FRAME_RATE_CRITICAL]
</string>
<string name="server_frame_time_warning_msg">
- Taxa de quadros entre [SERVER_FRAME_RATE_CRITICAL] e [SERVER_FRAME_RATE_WARNING]
+ Taxa de quadros do simulador entre [SERVER_FRAME_RATE_CRITICAL] e [SERVER_FRAME_RATE_WARNING]
</string>
<string name="server_frame_time_normal_msg">
Normal
diff --git a/indra/newview/skins/default/xui/pt/floater_land_holdings.xml b/indra/newview/skins/default/xui/pt/floater_land_holdings.xml
index 4734d665ef..1a640c9793 100644
--- a/indra/newview/skins/default/xui/pt/floater_land_holdings.xml
+++ b/indra/newview/skins/default/xui/pt/floater_land_holdings.xml
@@ -7,7 +7,7 @@
<column label="Área" name="area"/>
</scroll_list>
<button label="Teletransporte" label_selected="Teletransporte" name="Teleport" tool_tip="Teletransportar para o centro do terreno."/>
- <button width="130" label="Mostrar no mapa" label_selected="Mostrar no mapa" name="Show on Map" tool_tip="Mostrar esse terreno no mapa do mundo."/>
+ <button label="Mostrar no mapa" label_selected="Mostrar no mapa" name="Show on Map" tool_tip="Mostrar esse terreno no mapa do mundo."/>
<text name="contrib_label">
Contribuições para os seus grupos:
</text>
@@ -15,22 +15,22 @@
<column label="Grupo" name="group"/>
<column label="Área" name="area"/>
</scroll_list>
- <text name="allowed_label" width="380">
+ <text name="allowed_label">
Propriedades de terreno permitidas com o plano de pagamento atual:
</text>
- <text name="allowed_text" left_delta="390">
+ <text name="allowed_text">
[AREA] m²
</text>
<text name="current_label">
Propriedades de terrenos atuais:
</text>
- <text name="current_text" left_delta="390">
+ <text name="current_text">
[AREA] m²
</text>
<text name="available_label">
Disponível para compra de terras:
</text>
- <text name="available_text" left_delta="390">
+ <text name="available_text">
[AREA] m²
</text>
<string name="area_string">
diff --git a/indra/newview/skins/default/xui/pt/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/pt/floater_live_lsleditor.xml
index d2654de589..af45fa5873 100644
--- a/indra/newview/skins/default/xui/pt/floater_live_lsleditor.xml
+++ b/indra/newview/skins/default/xui/pt/floater_live_lsleditor.xml
@@ -2,7 +2,7 @@
<floater name="script ed float" title="Script: Novo Script">
<button label="Resetar" label_selected="Resetar" name="Reset"/>
<check_box label="Correndo" name="running"/>
- <check_box label="Mono" name="mono" left="86"/>
+ <check_box label="Mono" name="mono"/>
<string name="not_allowed">
Você não tem permissão para visualizar este script.
</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_lsl_guide.xml b/indra/newview/skins/default/xui/pt/floater_lsl_guide.xml
index 4f60ef23a6..e7e4a22937 100644
--- a/indra/newview/skins/default/xui/pt/floater_lsl_guide.xml
+++ b/indra/newview/skins/default/xui/pt/floater_lsl_guide.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="script ed float" title="LSL Wiki">
<check_box label="Seguir o Cursor" name="lock_check" />
- <combo_box label="Bloquear" name="history_combo" left_delta="120" width="70"/>
- <button label="Anterior" name="back_btn" left_delta="75"/>
+ <combo_box label="Bloquear" name="history_combo" />
+ <button label="Anterior" name="back_btn" />
<button label="Posterior" name="fwd_btn" />
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_mute_object.xml b/indra/newview/skins/default/xui/pt/floater_mute_object.xml
index 7ec0051a7d..d967f527ae 100644
--- a/indra/newview/skins/default/xui/pt/floater_mute_object.xml
+++ b/indra/newview/skins/default/xui/pt/floater_mute_object.xml
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="mute by name" title="Silenciar objeto pelo nome">
<text name="message">
- Silenciar pelo nome afeta apenas conversa de objeto e MI,
-não sons. Você deve digitar o nome exato do objeto.
+ Silenciar pelo nome afeta apenas conversa de objeto e MI, não sons. Você deve digitar o nome exato do objeto.
</text>
<line_editor name="object_name">
Nome do objeto
</line_editor>
- <button label="OK" name="OK"/>
+ <button label="Ok" name="OK"/>
<button label="Cancelar" name="Cancel"/>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_pay.xml b/indra/newview/skins/default/xui/pt/floater_pay.xml
index 2eb1c5c1bf..6b094d07f6 100644
--- a/indra/newview/skins/default/xui/pt/floater_pay.xml
+++ b/indra/newview/skins/default/xui/pt/floater_pay.xml
@@ -9,7 +9,7 @@
<text type="string" length="1" name="payee_label" width="110" left="5">
Pagar residente:
</text>
- <text type="string" length="1" name="payee_name" left="115">
+ <text type="string" length="1" name="payee_name" left="110">
[FIRST] [LAST]
</text>
<text type="string" length="1" name="fastpay text" width="120" halign="left">
diff --git a/indra/newview/skins/default/xui/pt/floater_preferences.xml b/indra/newview/skins/default/xui/pt/floater_preferences.xml
index 0e9ef768b5..eb28e99713 100644
--- a/indra/newview/skins/default/xui/pt/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/pt/floater_preferences.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Preferences" title="Preferências" min_width="332" width="628">
+<floater name="Preferences" title="Preferências">
<button label="OK" label_selected="OK" name="OK"/>
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
<button label="Aplicar" label_selected="Aplicar" name="Apply"/>
<button label="Sobre" label_selected="Sobre" name="About..."/>
<button label="Ajuda" label_selected="Ajuda" name="Help"/>
- <tab_container name="pref core" tab_width="128" width="628" />
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_preview_sound.xml b/indra/newview/skins/default/xui/pt/floater_preview_sound.xml
index b62146b92a..b61508480d 100644
--- a/indra/newview/skins/default/xui/pt/floater_preview_sound.xml
+++ b/indra/newview/skins/default/xui/pt/floater_preview_sound.xml
@@ -3,6 +3,6 @@
<text length="1" name="desc txt" type="string">
Descrição:
</text>
- <button left_delta="-132" label="Executar in-World" label_selected="Executar in-World" name="Sound play btn" tool_tip="Executar este som para que todos possam ouvi-lo."/>
- <button width="135" left="152" label="Executar Localmente" label_selected="Executar Localmente" name="Sound audition btn" tool_tip="Executar este som somente para você ouvir."/>
+ <button label="Executar in-World" label_selected="Executar in-World" name="Sound play btn" tool_tip="Executar este som para que todos possam ouvi-lo."/>
+ <button label="Executar Localmente" label_selected="Executar Localmente" name="Sound audition btn" tool_tip="Executar este som somente para você ouvir."/>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_script_search.xml b/indra/newview/skins/default/xui/pt/floater_script_search.xml
index 5c1393107f..aaf1ea4339 100644
--- a/indra/newview/skins/default/xui/pt/floater_script_search.xml
+++ b/indra/newview/skins/default/xui/pt/floater_script_search.xml
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="script search" title="Busca de Script" width="320">
- <check_box label="Não diferenciar Maiúsculas de Minúsculas" name="case_text" left="75"/>
- <button label="Buscar" label_selected="Buscar" name="search_btn" width="85"/>
- <button label="Substituir" label_selected="Substituir" name="replace_btn" left="100" width="85"/>
- <button label="Substituir Tudo" label_selected="Substituir Tudo" name="replace_all_btn" left="190" width="122"/>
- <text length="1" name="txt" type="string" width="65">
+<floater name="script search" title="Busca de Script">
+ <check_box label="Não diferenciar Maiúsculas de Minúsculas" name="case_text"/>
+ <button label="Buscar" label_selected="Buscar" name="search_btn"/>
+ <button label="Substituir" label_selected="Substituir" name="replace_btn"/>
+ <button label="Substituir Tudo" label_selected="Substituir Tudo" name="replace_all_btn"/>
+ <text length="1" name="txt" type="string">
Buscar
</text>
- <text length="1" name="txt2" type="string" width="65">
+ <text length="1" name="txt2" type="string">
Substituir
</text>
- <line_editor left="75" name="search_text" width="240" />
- <line_editor left="75" name="replace_text" width="240" />
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_telehub.xml b/indra/newview/skins/default/xui/pt/floater_telehub.xml
index 11886c7cab..f2634be852 100644
--- a/indra/newview/skins/default/xui/pt/floater_telehub.xml
+++ b/indra/newview/skins/default/xui/pt/floater_telehub.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="telehub" title="Telehub" min_height="310" height="310" width="286">
+<floater name="telehub" title="Telehub">
<text name="status_text_connected">
Telehub conectado ao objeto [OBJECT]
</text>
@@ -14,19 +14,15 @@
</text>
<button label="Conectar Telehub" name="connect_btn"/>
<button label="Desconectar" name="disconnect_btn"/>
- <text name="spawn_points_text" width="265">
+ <text name="spawn_points_text">
Pontos de Nascimento (posições, não objetos):
</text>
- <scroll_list name="spawn_points_list" width="265" />
- <button width="135" label="Adicionar Nascimento" name="add_spawn_point_btn"/>
- <button width="130" label="Remover Nascimento" name="remove_spawn_point_btn" left="150"/>
+ <button label="Adicionar Nascimento" name="add_spawn_point_btn"/>
+ <button label="Remover Nascimento" name="remove_spawn_point_btn"/>
<text name="spawn_point_help">
- Selecione um objeto e clique Adicionar para
-especificar a posição.
-Em seguida, você pode mover ou apagar o objeto.
+ Selecione um objeto e clique Adicionar para especificar
+a posição. Em seguida, você pode mover ou apagar o objeto.
As posições são relativas ao centro do telehub.
-
-Selecione um item na lista para mostrar a posição
-in-world.
+Selecione um item na lista para mostrar a posição in-world.
</text>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_tools.xml b/indra/newview/skins/default/xui/pt/floater_tools.xml
index 4f5054da73..9a3d14c0ea 100644
--- a/indra/newview/skins/default/xui/pt/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pt/floater_tools.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="toolbox floater" title="" short_title="Construir" width="288">
+<floater name="toolbox floater" title="">
<button label="" label_selected="" name="button focus" tool_tip="Foco"/>
<button label="" label_selected="" name="button move" tool_tip="Mover"/>
<button label="" label_selected="" name="button edit" tool_tip="Editar"/>
@@ -34,7 +34,7 @@
<check_box label="Esticar Texturas" name="checkbox stretch textures"/>
<check_box label="Usar Grade" name="checkbox snap to grid"/>
<button label="Opções..." label_selected="Opções..." name="Options..."/>
- <text name="text status" width="280">
+ <text name="text status">
Arraste para mover, shift+Arrastar para Copiar
</text>
<button label="" label_selected="" name="ToolCube" tool_tip="Cubo"/>
@@ -73,13 +73,13 @@
<text name="Strength:">
Força
</text>
- <text name="obj_count" left="134">
+ <text name="obj_count">
Objetos selecionados: [COUNT]
</text>
- <text name="prim_count" left="134">
+ <text name="prim_count">
primitivas: [COUNT]
</text>
- <tab_container name="Object Info Tabs" tab_max_width="60" tab_min_width="30" width="288">
+ <tab_container name="Object Info Tabs">
<panel label="Comum" name="General">
<text name="Name:">
Nome:
@@ -105,7 +105,7 @@
Grupo:
</text>
<text name="Group Name Proxy">
- The Lindens
+ Os Lindens
</text>
<button label="Definir..." label_selected="Definir..." name="button set group"/>
<text name="Permissions:">
@@ -144,12 +144,12 @@
Próximo Proprietário pode:
</text>
<check_box label="Modificar" name="checkbox next owner can modify"/>
- <check_box label="Copiar" name="checkbox next owner can copy" left_delta="80"/>
- <check_box label="Revender/Dar" name="checkbox next owner can transfer" left_delta="67"/>
- <text name="label click action" width="220">
+ <check_box label="Copiar" name="checkbox next owner can copy"/>
+ <check_box label="Revender/Dar" name="checkbox next owner can transfer"/>
+ <text name="label click action">
Quando clicado com o botão esquerdo:
</text>
- <combo_box name="clickaction" width="192">
+ <combo_box name="clickaction">
<combo_item name="Touch/grab(default)">
Tocar/Pegar (padrão)
</combo_item>
@@ -176,7 +176,7 @@
B:
</text>
<text name="O:">
- O:
+ O;
</text>
<text name="G:">
G:
@@ -222,7 +222,7 @@
</string>
</panel>
<panel label="Objeto" name="Object">
- <text name="select_single" width="272">
+ <text name="select_single">
Selecione apenas uma primitiva para editar os parâmetros.
</text>
<text name="edit_object">
@@ -306,10 +306,10 @@
</combo_item>
</combo_box>
<text name="text cut">
- Recorte Início e final
+ Recorte inicial e final
</text>
- <spinner label="I" name="cut begin"/>
- <spinner label="F" name="cut end"/>
+ <spinner label="B" name="cut begin"/>
+ <spinner label="E" name="cut end"/>
<text name="text hollow">
Vazio
</text>
@@ -336,8 +336,8 @@
<text name="text twist">
Torcer no Início e final
</text>
- <spinner label="I" name="Twist Begin"/>
- <spinner label="F" name="Twist End"/>
+ <spinner label="B" name="Twist Begin"/>
+ <spinner label="E" name="Twist End"/>
<text name="scale_taper">
Afinar
</text>
@@ -351,17 +351,17 @@
</text>
<spinner label="X" name="Shear X"/>
<spinner label="Y" name="Shear Y"/>
- <text name="advanced_cut" width="156">
- Perfil Recortado no Início e fim
+ <text name="advanced_cut">
+ Perfil Recortado no Início e Final
</text>
<text name="advanced_dimple">
- Cova Início e final
+ Cova Início e Final
</text>
<text name="advanced_slice">
- Pedaço Início e fim
+ Pedaço Início (B) e Fim (E)
</text>
- <spinner label="I" name="Path Limit Begin"/>
- <spinner label="F" name="Path Limit End"/>
+ <spinner label="B" name="Path Limit Begin"/>
+ <spinner label="E" name="Path Limit End"/>
<text name="text taper2">
Afinar
</text>
@@ -398,7 +398,7 @@
</combo_box>
</panel>
<panel label="Recursos" name="Features">
- <text name="select_single" width="272">
+ <text name="select_single">
Selecione apenas uma primitiva para editar suas características.
</text>
<text name="edit_object">
@@ -425,7 +425,7 @@
<panel label="Textura" name="Texture">
<texture_picker label="Textura" name="texture control" tool_tip="Clique para escolher uma imagem"/>
<color_swatch label="Cor" name="colorswatch" tool_tip="Clique para abrir o Seletor de Cores"/>
- <text name="color trans" width="100">
+ <text name="color trans">
Transparência %
</text>
<text name="glow label">
@@ -463,7 +463,7 @@
<text name="label bumpiness">
Ondulação
</text>
- <combo_box name="combobox bumpiness" width="100" >
+ <combo_box name="combobox bumpiness">
<combo_item name="None">
Nenhum
</combo_item>
@@ -477,7 +477,7 @@
Granulação
</combo_item>
<combo_item name="bark">
- Casca
+ casca
</combo_item>
<combo_item name="bricks">
Tijolos
@@ -507,7 +507,7 @@
Revestimento
</combo_item>
<combo_item name="stonetile">
- Empedrado
+ empedrado
</combo_item>
<combo_item name="stucco">
Grafiato
@@ -516,7 +516,7 @@
Sulcos
</combo_item>
<combo_item name="weave">
- Weave
+ weave
</combo_item>
</combo_box>
<text name="tex scale">
@@ -552,7 +552,6 @@
<panel label="Conteúdo" name="Contents">
<button label="Novo Script" label_selected="Novo Script..." name="button new script"/>
<button label="Permissões..." name="button permissions"/>
- <panel name="ContentsInventory" width="272" />
</panel>
</tab_container>
<panel name="land info panel">
@@ -567,7 +566,7 @@
</text>
<button label="Sobre a Terra..." label_selected="Sobre a Terra..." name="button about land"/>
<check_box label="Mostrar donos" name="checkbox show owners" tool_tip="Colorir lotes de acordo com seus donos"/>
- <button label="?" label_selected="?" name="button show owners help" left_delta="100"/>
+ <button label="?" label_selected="?" name="button show owners help"/>
<text name="label_parcel_modify">
Modificar Lote
</text>
diff --git a/indra/newview/skins/default/xui/pt/floater_top_objects.xml b/indra/newview/skins/default/xui/pt/floater_top_objects.xml
index cd94b51b16..694100297d 100644
--- a/indra/newview/skins/default/xui/pt/floater_top_objects.xml
+++ b/indra/newview/skins/default/xui/pt/floater_top_objects.xml
@@ -19,17 +19,14 @@
Nome do Objeto:
</text>
<button label="Filtro" name="filter_object_btn"/>
- <text name="owner_name_text" width="130">
+ <text name="owner_name_text">
Nome do Proprietário:
</text>
- <line_editor font="SansSerifSmall" left="140" name="id_editor" width="280"/>
- <line_editor font="SansSerifSmall" left="140" name="object_name_editor" width="280"/>
- <line_editor font="SansSerifSmall" left="140" name="owner_name_editor" width="280"/>
<button label="Filtro" name="filter_owner_btn"/>
- <button label="Retornar Selecionado" name="return_selected_btn" width="170"/>
- <button label="Retornar Tudo" name="return_all_btn" left="190"/>
- <button label="Desabilitar Selecionado" name="disable_selected_btn" width="170"/>
- <button label="Desabilitar Tudo" name="disable_all_btn" left="190"/>
+ <button label="Retornar Selecionado" name="return_selected_btn"/>
+ <button label="Retornar Tudo" name="return_all_btn"/>
+ <button label="Desabilitar Selecionado" name="disable_selected_btn"/>
+ <button label="Desabilitar Tudo" name="disable_all_btn"/>
<button label="Atualizar" name="refresh_btn"/>
<string name="top_scripts_title">
Principais Scripts
diff --git a/indra/newview/skins/default/xui/pt/floater_url_entry.xml b/indra/newview/skins/default/xui/pt/floater_url_entry.xml
index 48af8de363..a4ae5e2e3d 100644
--- a/indra/newview/skins/default/xui/pt/floater_url_entry.xml
+++ b/indra/newview/skins/default/xui/pt/floater_url_entry.xml
@@ -3,7 +3,6 @@
<text name="media_label">
URL da Mídia:
</text>
- <combo_box left="100" name="media_entry" width="360" />
<button label="OK" name="ok_btn"/>
<button label="Cancelar" name="cancel_btn"/>
<button label="Limpar" name="clear_btn"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_water.xml b/indra/newview/skins/default/xui/pt/floater_water.xml
index ceb4414058..007eb3f6ba 100644
--- a/indra/newview/skins/default/xui/pt/floater_water.xml
+++ b/indra/newview/skins/default/xui/pt/floater_water.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Water Floater" title="Editor de Água Avançado">
- <text name="KeyFramePresetsText" width="154">
+ <text name="KeyFramePresetsText">
Pré-configurações da Água:
</text>
- <combo_box left_delta="160" name="WaterPresetsCombo" width="150" />
<button label="Novo" label_selected="Novo" name="WaterNewPreset"/>
<button label="Salvar" label_selected="Salvar" name="WaterSavePreset"/>
<button label="Deletar" label_selected="Deletar" name="WaterDeletePreset"/>
@@ -17,15 +16,15 @@
<text name="WaterFogDensText">
Expoente da Densidade de névoa
</text>
- <button label="?" name="WaterFogDensityHelp" left="209"/>
+ <button label="?" name="WaterFogDensityHelp"/>
<text name="WaterUnderWaterFogModText">
Modificador da névoa Subaquática
</text>
- <button label="?" name="WaterUnderWaterFogModHelp" left="209"/>
+ <button label="?" name="WaterUnderWaterFogModHelp"/>
<text name="BDensText">
Escala da Marola de Reflexão
</text>
- <button label="?" name="WaterNormalScaleHelp" left="415"/>
+ <button label="?" name="WaterNormalScaleHelp"/>
<text name="BHText2">
1
</text>
@@ -38,29 +37,29 @@
<text name="HDText">
Escala de Fresnel
</text>
- <button label="?" name="WaterFresnelScaleHelp" left="415"/>
+ <button label="?" name="WaterFresnelScaleHelp"/>
<text name="FresnelOffsetText">
Deslocamento de Fresnel
</text>
- <button label="?" name="WaterFresnelOffsetHelp" left="415"/>
+ <button label="?" name="WaterFresnelOffsetHelp"/>
<text name="DensMultText">
Refratar a Escala para Cima
</text>
- <button label="?" name="WaterScaleAboveHelp" left="640"/>
+ <button label="?" name="WaterScaleAboveHelp"/>
<text name="WaterScaleBelowText">
Refratar a Escala para Baixo
</text>
- <button label="?" name="WaterScaleBelowHelp" left="640"/>
+ <button label="?" name="WaterScaleBelowHelp"/>
<text name="MaxAltText">
Multiplicador de Difusão
</text>
- <button label="?" name="WaterBlurMultiplierHelp" left="640"/>
+ <button label="?" name="WaterBlurMultiplierHelp"/>
</panel>
<panel label="Imagem" name="Waves">
<text name="BHText">
Direção da Onda Maior
</text>
- <button label="?" name="WaterWave1Help" left="170"/>
+ <button label="?" name="WaterWave1Help"/>
<text name="WaterWave1DirXText">
X
</text>
@@ -70,7 +69,7 @@
<text name="BHText2">
Direção da Onda Pequena
</text>
- <button label="?" name="WaterWave2Help" left="170"/>
+ <button label="?" name="WaterWave2Help"/>
<text name="WaterWave2DirXText">
X
</text>
diff --git a/indra/newview/skins/default/xui/pt/floater_windlight_options.xml b/indra/newview/skins/default/xui/pt/floater_windlight_options.xml
index 0de8bd22f8..f86775c770 100644
--- a/indra/newview/skins/default/xui/pt/floater_windlight_options.xml
+++ b/indra/newview/skins/default/xui/pt/floater_windlight_options.xml
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="WindLight floater" title="Editor de Céu Avançado">
- <text name="KeyFramePresetsText" width="130">
+ <text name="KeyFramePresetsText">
Pré-definições de Céu:
</text>
- <combo_box left_delta="130" name="WLPresetsCombo"/>
<button label="Novo" label_selected="Novo" name="WLNewPreset"/>
- <button label="Salvar" label_selected="Salvar" name="WLSavePreset" left_delta="72"/>
- <button label="Deletar" label_selected="Deletar" name="WLDeletePreset" left_delta="72"/>
- <button label="Editor de Ciclos do Dia" label_selected="Editor de Ciclos do Dia" name="WLDayCycleMenuButton" width="150" left_delta="84" />
+ <button label="Salvar" label_selected="Salvar" name="WLSavePreset"/>
+ <button label="Deletar" label_selected="Deletar" name="WLDeletePreset"/>
+ <button label="Editor de Ciclos do Dia" label_selected="Editor de Ciclos do Dia" name="WLDayCycleMenuButton" width="150" left_delta="95" />
<tab_container name="WindLight Tabs">
<panel label="Atmosfera" name="Atmosphere">
<text name="BHText">
@@ -53,15 +52,15 @@
<text name="DensMultText">
Multiplicador de Densidade
</text>
- <button label="?" name="WLDensityMultHelp" left="635"/>
+ <button label="?" name="WLDensityMultHelp"/>
<text name="WLDistanceMultText">
Multiplicador de Distância
</text>
- <button label="?" name="WLDistanceMultHelp" left="635"/>
+ <button label="?" name="WLDistanceMultHelp"/>
<text name="MaxAltText">
Altitude Máxima
</text>
- <button label="?" name="WLMaxAltitudeHelp" left="635"/>
+ <button label="?" name="WLMaxAltitudeHelp"/>
</panel>
<panel label="Iluminação" name="Lighting">
<text name="SLCText">
@@ -157,10 +156,10 @@
Escala da Nuvem
</text>
<button label="?" name="WLCloudScaleHelp"/>
- <text name="WLCloudDetailText" font="SansSerifSmall">
- Detalhe da Nuvem (XY/Densidade)
+ <text name="WLCloudDetailText">
+ Detalhe da Nuvem (XY/Densidade)
</text>
- <button label="?" name="WLCloudDetailHelp" left="421"/>
+ <button label="?" name="WLCloudDetailHelp"/>
<text name="BHText8">
X
</text>
@@ -181,7 +180,7 @@
<button label="?" name="WLCloudScrollYHelp"/>
<check_box label="Travar" name="WLCloudLockY"/>
<check_box label="Desenhar Nuvens Clássicas" name="DrawClassicClouds"/>
- <button label="?" name="WLClassicCloudsHelp" left="645"/>
+ <button label="?" name="WLClassicCloudsHelp"/>
</panel>
</tab_container>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/panel_friends.xml b/indra/newview/skins/default/xui/pt/panel_friends.xml
index d430d637ad..afd7b79eaa 100644
--- a/indra/newview/skins/default/xui/pt/panel_friends.xml
+++ b/indra/newview/skins/default/xui/pt/panel_friends.xml
@@ -11,10 +11,10 @@
<column name="icon_edit_mine" tool_tip="Amigo pode editar, apagar ou pegar seus objetos"/>
<column name="icon_edit_theirs" tool_tip="Você pode editar os objetos deste amigo"/>
</scroll_list>
- <button width="86" label="MI/Chamar" name="im_btn" tool_tip="Abrir sessão de Mensagem Instantânea"/>
- <button width="86" label="Perfil" name="profile_btn" tool_tip="Mostrar foto, grupos e outras informações"/>
- <button width="86" label="Teletransp..." name="offer_teleport_btn" tool_tip="Oferecer a este amigo o teletransporte para sua localização atual"/>
- <button width="86" label="Pagar..." name="pay_btn" tool_tip="Dar Linden dólares (L$) a este amigo"/>
- <button width="86" label="Remover..." name="remove_btn" tool_tip="Remover esta pessoa de sua lista de amigos"/>
- <button width="86" label="Adicionar..." name="add_btn" tool_tip="Oferecer amizade a um residente"/>
+ <button label="MI/Chamar" name="im_btn" tool_tip="Abrir sessão de Mensagem Instantânea"/>
+ <button label="Perfil" name="profile_btn" tool_tip="Mostrar foto, grupos e outras informações"/>
+ <button label="Teletransporte..." name="offer_teleport_btn" tool_tip="Oferecer a este amigo o teletransporte para sua localização atual"/>
+ <button label="Pagar..." name="pay_btn" tool_tip="Dar Linden dólares (L$) a este amigo"/>
+ <button label="Remover..." name="remove_btn" tool_tip="Remover esta pessoa de sua lista de amigos"/>
+ <button label="Adicionar..." name="add_btn" tool_tip="Oferecer amizade a um residente"/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_group_general.xml b/indra/newview/skins/default/xui/pt/panel_group_general.xml
index 185ed77576..f4941eabd9 100644
--- a/indra/newview/skins/default/xui/pt/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_general.xml
@@ -14,7 +14,7 @@
<text name="prepend_founded_by">
Fundado por:
</text>
- <text name="founder_name" left_delta="74" >
+ <text name="founder_name">
(espera)
</text>
<text name="group_charter_label">
@@ -44,8 +44,8 @@
<check_box label="Mostre na busca" name="show_in_group_list" tool_tip="Deixe as pessoas verem este grupo nos resultados de busca."/>
<check_box label="Adesão aberta" name="open_enrollement" tool_tip="Definir se este grupo permite que novos membros entrem sem serem convidados"/>
<check_box label="Taxa de adesão: L$" name="check_enrollment_fee" tool_tip="Define se é necessária uma taxa de adesão para se unir ao grupo."/>
- <spinner width="60" left_delta="120" name="spin_enrollment_fee" tool_tip="Os novos membros devem pagar esta taxa para se unir ao grupo quando a Taxa de Adesão está marcada."/>
- <combo_box width="170" name="group_mature_check" tool_tip="Define se a informação do seu grupo é considerada mature.">
+ <spinner name="spin_enrollment_fee" tool_tip="Os novos membros devem pagar esta taxa para se unir ao grupo quando a Taxa de Adesão está marcada."/>
+ <combo_box name="group_mature_check" tool_tip="Define se a informação do seu grupo é considerada mature.">
<combo_item name="select_mature">
- Selecionar Maturidade -
</combo_item>
diff --git a/indra/newview/skins/default/xui/pt/panel_group_invite.xml b/indra/newview/skins/default/xui/pt/panel_group_invite.xml
index a02a17139b..e9c7bab3db 100644
--- a/indra/newview/skins/default/xui/pt/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_invite.xml
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Convidar um membro" name="invite_panel" width="224">
- <text name="help_text" width="214">
+<panel label="Convidar um membro" name="invite_panel">
+ <text name="help_text">
Voce pode selecionar vários residentes
-para convidar ao seu grupo. Clique
-&apos;Abrir Seletor de Residente&apos; para iniciar.
+para convidar ao seu grupo. Clique &apos;Abrir
+Seletor de Residente&apos; para iniciar.
</text>
<button label="Abrir Seletor de Residente" name="add_button" tool_tip=""/>
<name_list name="invitee_list" tool_tip="Mantenha apertada a tecla Control e clique nos nomes dos residentes para uma seleção múltipla."/>
- <button left_delta="-7" width="214" label="Remove os selecionados acima da lista" name="remove_button" tool_tip="Remove os residentes selecionados acima da lista de convite."/>
+ <button label="Remove Selected from List" name="remove_button" tool_tip="Remove os residentes selecionados acima da lista de convite."/>
<text name="role_text">
Escolha que Função atribuir a eles:
</text>
diff --git a/indra/newview/skins/default/xui/pt/panel_group_land_money.xml b/indra/newview/skins/default/xui/pt/panel_group_land_money.xml
index 103da6d67d..f5e96869d7 100644
--- a/indra/newview/skins/default/xui/pt/panel_group_land_money.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_land_money.xml
@@ -13,7 +13,7 @@
<string name="loading_txt">
Carregando...
</string>
- <text name="group_land_heading" width="250">
+ <text name="group_land_heading">
Terra percentente ao grupo
</text>
<scroll_list name="group_parcel_list">
@@ -22,7 +22,7 @@
<column label="Tipo" name="type"/>
<column label="Área" name="area"/>
</scroll_list>
- <button label="Mostrar no Mapa" label_selected="Mostrar no Mapa" name="map_button" left="282" width="130"/>
+ <button label="Mostrar no Mapa" label_selected="Mostrar no Mapa" name="map_button"/>
<text name="total_contributed_land_label">
Contribuição Total:
</text>
@@ -51,8 +51,7 @@
m² ([AMOUNT] máxima)
</text>
<text name="group_over_limit_text">
- Membros do grupo precisam contribuir com mais créditos de Terra para
-garantir a terra em uso.
+ Membros do grupo precisam contribuir com mais créditos de Terra para garantir a terra em uso.
</text>
<text name="group_money_heading">
Grupo L$
@@ -67,8 +66,8 @@ garantir a terra em uso.
<text_editor name="group_money_details_text">
Computando...
</text_editor>
- <button label="&lt; Mais Cedo" label_selected="&lt; Cedo" name="earlier_details_button" tool_tip="Voltar no Tempo"/>
- <button label="Mais Tarde &gt;" label_selected="Tarde &gt;" name="later_details_button" tool_tip="Adiantar o Tempo"/>
+ <button label="&lt; Cedo" label_selected="&lt; Cedo" name="earlier_details_button" tool_tip="Voltar no Tempo"/>
+ <button label="Tarde &gt;" label_selected="Tarde &gt;" name="later_details_button" tool_tip="Adiantar o Tempo"/>
</panel>
<panel label="Vendas" name="group_money_sales_tab">
<text_editor name="group_money_sales_text">
diff --git a/indra/newview/skins/default/xui/pt/panel_group_notices.xml b/indra/newview/skins/default/xui/pt/panel_group_notices.xml
index 008e8144c6..1285a24ace 100644
--- a/indra/newview/skins/default/xui/pt/panel_group_notices.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_notices.xml
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Notícias" name="notices_tab">
<text name="help_text">
- As notícias são uma maneira rápida de comunicar-se através de um grupo transmitindo uma mensagem e entregando um item anexo, opcionalmente. As notícias vão apenas a membros do grupo que têm a função habilitada para receber notícias. Você pode desligar Notícias na aba Geral.
+ As notícias são uma maneira rápida de
+comunicar-se através de um grupo transmitindo uma mensagem e
+entregando um item anexo, opcionalmente. As notícias vão apenas a membros
+do grupo que têm a função habilitada para receber notícias. Você pode desligar
+Notícias na aba Geral.
</text>
<text name="no_notices_text">
Não existem notícias anteriores.
@@ -11,9 +15,9 @@
Arquivo de notícias do grupo
</text>
<text name="lbl2">
- As notícias são mantidas por 14 dias. Clique na notícia abaixo que você deseja
-ver. Clique no botão “Atualizar” para verificar se novas notícias foram
-recebidas. Listas de aviso estão limitadas a 200 por grupo, diariamente.
+ As notícias são mantidas por 14 dias. Clique na notícia abaixo que você deseja ver.
+Clique no botão “Atualizar” para verificar se novas notícias foram recebidas.
+Listas de aviso estão limitadas a 200 por grupo, diariamente.
</text>
<scroll_list name="notice_list">
<column label="Assunto" name="subject"/>
@@ -35,18 +39,15 @@ adicionar um item simples à notícia, arrastando-o do seu
Inventário para o painel. Itens anexados devem ser copiáveis
e transferíveis e você não pode mandar uma pasta.
</text>
- <text name="lbl3" left="20">
+ <text name="lbl3">
Assunto:
</text>
- <line_editor name="create_subject" width="251" left_delta="61"/>
- <text name="lbl4" left="15" width="60">
+ <text name="lbl4">
Mensagem:
</text>
- <text_editor name="create_message" left_delta="66" width="330"/>
- <text name="lbl5" width="68">
+ <text name="lbl5">
Anexo:
</text>
- <line_editor name="create_inventory_name" width="190" left_delta="74"/>
<button label="Remover o anexo" label_selected="Remover o anexo" name="remove_attachment"/>
<button label="Enviar notícia" label_selected="Enviar notícia" name="send_notice"/>
<panel name="drop_target" tool_tip="Arraste um item do inventário para dentro da caixa de mensagem para enviá-lo com a notícia. Você deve ter permissão para copiar e transferir o objeto, para enviá-lo com a notícia."/>
diff --git a/indra/newview/skins/default/xui/pt/panel_group_roles.xml b/indra/newview/skins/default/xui/pt/panel_group_roles.xml
index 087cf0c107..32ed839bd8 100644
--- a/indra/newview/skins/default/xui/pt/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_roles.xml
@@ -13,8 +13,7 @@
</text>
<text name="static2">
São atribuídas funções com habilidades aos membros do grupo.
-Estes ajustes podem ser facilmente customizados para uma flexibilidade
-e organização maiores.
+Estes ajustes podem ser facilmente customizados para uma flexibilidade e organização maiores.
</text>
</panel>
<panel name="roles_header">
@@ -22,14 +21,12 @@ e organização maiores.
Funções
</text>
<text name="role_properties_modifiable">
- Selecionar uma função abaixo. Você pode modificar o nome, a descrição
-e o título do membro.
+ Selecionar uma função abaixo. Você pode modificar o nome, a descrição e o título do membro.
</text>
<text name="role_properties_not_modifiable">
- Selecione uma função abaixo para ver suas propriedades, membros e
-habilidades permitidas.
+ Selecione uma função abaixo para ver suas propriedades, membros e habilidades permitidas.
</text>
- <text bottom_delta="-28" name="role_actions_modifiable">
+ <text name="role_actions_modifiable">
Você também pode atribuir habilidades à função.
</text>
<text name="role_actions_not_modifiable">
@@ -41,31 +38,28 @@ habilidades permitidas.
Habilidades
</text>
<text name="static2">
- Você pode ver a descrição de uma habilidade e quais funções e membros
-podem executar essa habilidade.
+ Você pode ver a descrição de uma habilidade e quais funções e membros podem executar essa habilidade.
</text>
</panel>
- <tab_container height="164" name="roles_tab_container">
- <panel height="148" label="Membros" name="members_sub_tab" tool_tip="Membros">
- <line_editor bottom="127" name="search_text"/>
- <button label="Pesquisar" name="search_button" width="75"/>
- <button label="Mostrar todos" name="show_all_button" left_delta="80"/>
- <name_list name="member_list" bottom_delta="-105" height="104" >
+ <tab_container name="roles_tab_container">
+ <panel label="Membros" name="members_sub_tab" tool_tip="Membros">
+ <button label="Pesquisar" name="search_button"/>
+ <button label="Mostrar todos" name="show_all_button"/>
+ <name_list name="member_list">
<column label="Nome do membro" name="name"/>
<column label="Tarifa doada" name="donated"/>
<column label="Último login" name="online"/>
</name_list>
- <button label="Convidar Novo Membro..." name="member_invite" width="165"/>
+ <button label="Convidar Novo Membro ..." name="member_invite"/>
<button label="Ejetar do Grupo" name="member_eject"/>
<string name="help_text">
Você pode adicionar ou remover as funções designadas aos membros. Selecione vários membros, segurando a tecla Ctrl e clicando em seus nomes.
</string>
</panel>
- <panel height="148" label="Funções" name="roles_sub_tab">
- <line_editor bottom="127" name="search_text"/>
- <button label="Busca" name="search_button" width="75"/>
- <button label="Mostrar todos" name="show_all_button" left_delta="80"/>
- <scroll_list name="role_list" bottom_delta="-104" height="104">
+ <panel label="Funções" name="roles_sub_tab">
+ <button label="Busca" name="search_button"/>
+ <button label="Mostrar todos" name="show_all_button"/>
+ <scroll_list name="role_list">
<column label="Nome da função" name="name"/>
<column label="Título" name="title"/>
<column label="Membro" name="members"/>
@@ -81,11 +75,10 @@ permitidas que os membros podem executar. Os membros poderão ter um ou mais fun
As funções &apos;todos&apos; e &apos;donos&apos; são especiais e não podem ser deletadas.
</string>
</panel>
- <panel height="148" label="Habilidades" name="actions_sub_tab">
- <line_editor bottom="127" name="search_text"/>
- <button label="Busca" name="search_button" width="75"/>
- <button label="Mostrar todos" name="show_all_button" left_delta="80"/>
- <scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Selecione uma habilidade para ver mais detalhes."/>
+ <panel label="Habilidades" name="actions_sub_tab">
+ <button label="Busca" name="search_button"/>
+ <button label="Mostrar todos" name="show_all_button"/>
+ <scroll_list name="action_list" tool_tip="Selecione uma habilidade para ver mais detalhes."/>
<string name="help_text">
As habilidades permitem que os membros nas funções façam coisas específicas dentro do grupo.
Há uma grande variedade de habilidades.
diff --git a/indra/newview/skins/default/xui/pt/panel_groups.xml b/indra/newview/skins/default/xui/pt/panel_groups.xml
index aaea1178a6..8a886ef8b1 100644
--- a/indra/newview/skins/default/xui/pt/panel_groups.xml
+++ b/indra/newview/skins/default/xui/pt/panel_groups.xml
@@ -1,15 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="groups">
- <text name="groupdesc" width="268">
+ <text name="groupdesc">
Seu grupo ativo atual es&apos;ta mostrado em negrito.
</text>
- <text name="groupcount" width="300">
+ <text name="groupcount">
Você pertence a [COUNT] grupos (de no máximo [MAX]).
+aximo
</text>
- <button width="86" label="MI/Chamada" name="IM" tool_tip="Abrir sessão de Mensagem Instantânea"/>
- <button width="86" label="Informações" name="Info"/>
- <button width="86" label="Ativar" name="Activate"/>
- <button width="86" label="Deixar" name="Leave"/>
- <button width="86" label="Criar..." name="Create"/>
- <button width="86" label="Buscar..." name="Search..."/>
+ <button label="MI/Chamada" name="IM" tool_tip="Abrir sessão de Mensagem Instantânea"/>
+ <button label="Informações" name="Info"/>
+ <button label="Ativar" name="Activate"/>
+ <button label="Deixar" name="Leave"/>
+ <button label="Criar..." name="Create"/>
+ <button label="Buscar..." name="Search..."/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml
index fde3551b8b..d82330cc78 100644
--- a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml
@@ -10,15 +10,9 @@
</radio_group>
<check_box label="Mostrar Posição Inicial na Tela de Login" name="show_location_checkbox"/>
<combo_box name="fade_out_combobox" width="166">
- <combo_item name="Never">
- Nunca
- </combo_item>
- <combo_item name="Show Temporarily">
- Mostrar Temporariamente
- </combo_item>
- <combo_item name="Always">
- Sempre
- </combo_item>
+ <combo_box.item name="Never" label="Nunca"/>
+ <combo_box.item name="Show Temporarily" label="Mostrar Temporariamente"/>
+ <combo_box.item name="Always" label="Sempre"/>
</combo_box>
<check_box label="Avatar com Nomes Pequenos" name="small_avatar_names_checkbox"/>
<check_box label="Ocultar meu Nome na minha Tela" name="show_my_name_checkbox"/>
@@ -80,49 +74,29 @@ conteúdo classificado:
Digite o nome da Região
</string>
<combo_box name="crash_behavior_combobox" width="166">
- <combo_item length="1" name="Askbeforesending" type="string">
- Perguntar antes de enviar
- </combo_item>
- <combo_item length="1" name="Alwayssend" type="string">
- Sempre enviar
- </combo_item>
- <combo_item length="1" name="Neversend" type="string">
- Nunca Enviar
- </combo_item>
+ <combo_box.item length="1" name="Askbeforesending" type="string" label="Perguntar antes de enviar"/>
+ <combo_box.item length="1" name="Alwayssend" type="string" label="Sempre enviar"/>
+ <combo_box.item length="1" name="Neversend" type="string" label="Nunca Enviar"/>
</combo_box>
<combo_box name="language_combobox" width="166">
- <combo_item name="System Default Language">
- Padrão do Sistema
- </combo_item>
- <combo_item name="English">
- English (Inglês)
- </combo_item>
- <combo_item name="Danish">
- Dansk (Dinamarquês) - Beta
- </combo_item>
- <combo_item name="Deutsch(German)">
- Deutsch (Alemão) - Beta
- </combo_item>
- <combo_item name="Spanish">
- Español (Espanhol) - Beta
- </combo_item>
- <combo_item name="French">
- Français (Francês) - Beta
- </combo_item>
+ <combo_box.item name="System Default Language" label="Padrão do Sistema"/>
+ <combo_box.item name="English" label="English (Inglês)"/>
+ <combo_box.item name="Danish" label="Dansk (Dinamarquês) - Beta"/>
+ <combo_box.item name="Deutsch(German)" label="Deutsch (Alemão) - Beta"/>
+ <combo_box.item name="Spanish" label="Español (Espanhol) - Beta"/>
+ <combo_box.item name="French" label="Français (Francês) - Beta"/>
+ <combo_box.item name="Hungarian" label="Magyar (Húngaro) - Beta"/>
+ <combo_box.item name="Polish" label="Polski (Polonês) - Beta"/>
+ <combo_box.item name="Portugese" label="Português - Beta"/>
+ <combo_box.item name="Chinese" label="中文 (简体) (Chinês) - Beta"/>
+ <combo_box.item name="(Japanese)" label="日本語 (Japonês) - Beta"/>
+ <combo_box.item name="(Korean)" label="한국어 (Coreano) - Beta"/>
<combo_item name="Italian">
Italiano - Beta
</combo_item>
- <combo_item name="Hungarian">
- Magyar (Húngaro) - Beta
- </combo_item>
<combo_item name="Dutch">
Nederlands (Holandês) - Beta
</combo_item>
- <combo_item name="Polish">
- Polski (Polonês) - Beta
- </combo_item>
- <combo_item name="Portugese">
- Português - Beta
</combo_item>
<combo_item name="Russian">
Русский (Russo) - Beta
@@ -132,16 +106,6 @@ conteúdo classificado:
</combo_item>
<combo_item name="Ukrainian">
Українська (Ucraniano) - Beta
- </combo_item>
- <combo_item name="Chinese">
- 中文 (简体) (Chinês) - Beta
- </combo_item>
- <combo_item name="(Japanese)">
- 日本語 (Japonês) - Beta
- </combo_item>
- <combo_item name="(Korean)">
- 한국어 (Coreano) - Beta
- </combo_item>
</combo_box>
<check_box label="Compartilhar a linguagem com objetos" name="language_is_public" tool_tip="Isto permite que os objetos no mundo conheçam sua linguagem preferida."/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_covenant.xml b/indra/newview/skins/default/xui/pt/panel_region_covenant.xml
index 4977a1fac9..6218e4eafb 100644
--- a/indra/newview/skins/default/xui/pt/panel_region_covenant.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_covenant.xml
@@ -22,22 +22,20 @@
Última modificação: Quarta, 31 de dezembro de 1969 às 16:00:00 horas
</text>
<button label="?" name="covenant_help"/>
- <text_editor name="covenant_editor" bottom="-247" height="162" >
+ <text_editor name="covenant_editor">
Não há nenhuma regra fornecida para esta Propriedade.
</text_editor>
<button label="Resetar" name="reset_covenant"/>
<text bottom="-25" name="covenant_help_text">
- As mudanças das regras serão mostradas em todos os lotes
- da propriedade.
+ As mudanças das regras serão mostradas em todos os lotes da propriedade.
</text>
- <text bottom_delta="-36" name="covenant_instructions">
- Arraste e solte um notecard, para mudar as Regras desta
- Propriedade.
+ <text name="covenant_instructions">
+ Arraste e solte um notecard, para mudar as Regras desta Propriedade.
</text>
- <text bottom_delta="-36" name="region_section_lbl">
+ <text name="region_section_lbl">
Região:
</text>
- <text name="region_name_lbl">
+ <text bottom_delta="-31" name="region_name_lbl">
Nome:
</text>
<text name="region_name_text">
@@ -74,11 +72,9 @@
Terras compradas na região não poderão ser revendidas.
</string>
<string name="can_change">
- O terreno comprado nesta região pode ser compartilhado ou
-subdividido.
+ O terreno comprado nesta região pode ser compartilhado ou subdividido.
</string>
<string name="can_not_change">
- O terreno comprado nesta região não pode ser compartilhado
-ou subdividido.
+ O terreno comprado nesta região não pode ser compartilhado ou subdividido.
</string>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_debug.xml b/indra/newview/skins/default/xui/pt/panel_region_debug.xml
index 724df20155..93c5d27648 100644
--- a/indra/newview/skins/default/xui/pt/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_debug.xml
@@ -13,7 +13,7 @@
<check_box label="Desabilitar física" name="disable_physics_check" tool_tip="Desabilitar toda a físíca nesta região"/>
<button label="?" name="disable_physics_help"/>
<button label="Aplicar" name="apply_btn"/>
- <text name="objret_text_lbl" width="130">
+ <text name="objret_text_lbl">
Retornar objeto
</text>
<text name="resident_text_lbl">
@@ -30,10 +30,10 @@
<check_box label="Retornar apenas aqueles objetos na terra de alguém" name="return_other_land" tool_tip="Retornar apenas objetos que estejam na terra pertencente a alguém"/>
<check_box label="Retornar objetos em cada região desta propriedade" name="return_estate_wide" tool_tip="Retornar objetos em todas as regiões que constituem esta propriedade"/>
<button label="Retornar" name="return_btn"/>
- <button width="280" label="Pegar os principais colidentes..." name="top_colliders_btn" tool_tip="Lista dos objetos que experimentam as mais potenciais colisões"/>
- <button label="?" name="top_colliders_help" left="297"/>
- <button width="280" label="Pegar Principais Scripts..." name="top_scripts_btn" tool_tip="Lista de objetos gastando mais tempo rodando scripts"/>
- <button label="?" name="top_scripts_help" left="297"/>
+ <button label="Pegar os principais colidentes..." name="top_colliders_btn" tool_tip="Lista dos objetos que experimentam as mais potenciais colisões"/>
+ <button label="?" name="top_colliders_help"/>
+ <button label="Pegar Principais Scripts..." name="top_scripts_btn" tool_tip="Lista de objetos gastando mais tempo rodando scripts"/>
+ <button label="?" name="top_scripts_help"/>
<button label="Reiniciar a Região" name="restart_btn" tool_tip="Dar 2 minutos de contagem regressiva e reiniciar a região"/>
<button label="?" name="restart_help"/>
<button label="Atrasar o Reinicio" name="cancel_restart_btn" tool_tip="Atrasar o reinicio da região por uma hora"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_estate.xml b/indra/newview/skins/default/xui/pt/panel_region_estate.xml
index f43402be15..c236b95ca1 100644
--- a/indra/newview/skins/default/xui/pt/panel_region_estate.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_estate.xml
@@ -24,9 +24,9 @@ todas as regiões desta propriedade.
<check_box label="Permitir acesso público" name="externally_visible_check"/>
<button label="?" name="externally_visible_help"/>
<text name="Only Allow">
- Acesso restrito a Residentes...
+ Acesso restrito a:
</text>
- <check_box label="com info. de pagamento em arquivo" name="limit_payment" tool_tip="Banir residentes não identificados."/>
+ <check_box label="Residentes com informações de pagamento em arquivo" name="limit_payment" tool_tip="Banir residentes não identificados."/>
<check_box label="Adultos com idade verificada" name="limit_age_verified" tool_tip="Banir residentes que não tenham confirmado a sua idade. Ver support.secondlife.com para mais informações."/>
<check_box label="Permitir conversa de voz" name="voice_chat_check"/>
<button label="?" name="voice_chat_help"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_terrain.xml b/indra/newview/skins/default/xui/pt/panel_region_terrain.xml
index b9b0e9d90f..9b8fc48fb9 100644
--- a/indra/newview/skins/default/xui/pt/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_terrain.xml
@@ -8,9 +8,9 @@
</text>
<spinner label="Altura da água" name="water_height_spin"/>
<button label="?" name="water_height_help"/>
- <spinner label="Limite do aumento do &#10;terreno" name="terrain_raise_spin"/>
+ <spinner label="Limite do aumento do terreno" name="terrain_raise_spin"/>
<button label="?" name="terrain_raise_help"/>
- <spinner label="Limite mais baixo do &#10;terreno" name="terrain_lower_spin" bottom_delta="-34"/>
+ <spinner label="Limite mais baixo do terreno" name="terrain_lower_spin"/>
<button label="?" name="terrain_lower_help"/>
<check_box label="Usar o sol da propriedade" name="use_estate_sun_check"/>
<button label="?" name="use_estate_sun_help"/>
@@ -18,10 +18,10 @@
<button label="?" name="fixed_sun_help"/>
<slider label="Fase" name="sun_hour_slider"/>
<button label="Aplicar" name="apply_btn"/>
- <button label="Download de terreno RAW..." name="download_raw_btn" tool_tip="Não disponível aos gerentes, somente aos proprietários."/>
+ <button label="Download de terreno RAW ..." name="download_raw_btn" tool_tip="Não disponível aos gerentes, somente aos proprietários."/>
<button label="?" name="download_raw_help"/>
<button label="Upload de terreno RAW..." name="upload_raw_btn" tool_tip="Não disponível aos gerentes, somente aos proprietários."/>
<button label="?" name="upload_raw_help"/>
- <button width="170" label="Nivelar o terreno" name="bake_terrain_btn" tool_tip="Ajustar terreno atual como o ponto médio para os limites de aumento/decréscimo"/>
- <button left="190" label="?" name="bake_terrain_help"/>
+ <button label="Nivelar o terreno" name="bake_terrain_btn" tool_tip="Ajustar terreno atual como o ponto médio para os limites de aumento/decréscimo"/>
+ <button label="?" name="bake_terrain_help"/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_texture.xml b/indra/newview/skins/default/xui/pt/panel_region_texture.xml
index 4787b59a8d..8d7bdfe97b 100644
--- a/indra/newview/skins/default/xui/pt/panel_region_texture.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_texture.xml
@@ -6,7 +6,7 @@
<text name="region_text">
desconhecido
</text>
- <text name="detail_texture_text" width="380">
+ <text name="detail_texture_text">
Texturas de Terreno (requer 512x512, arquivos 24 bit .tga )
</text>
<text name="height_text_lbl">
diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp
index 42872d85fb..e08193f785 100644
--- a/indra/newview/tests/llagentaccess_test.cpp
+++ b/indra/newview/tests/llagentaccess_test.cpp
@@ -29,6 +29,8 @@
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
+
+#include "linden_common.h"
#include "../test/lltut.h"
#include "../llagentaccess.h"
diff --git a/indra/newview/tests/llcapabilitylistener_test.cpp b/indra/newview/tests/llcapabilitylistener_test.cpp
index f66ae9404f..b965379c9c 100644
--- a/indra/newview/tests/llcapabilitylistener_test.cpp
+++ b/indra/newview/tests/llcapabilitylistener_test.cpp
@@ -24,9 +24,9 @@
#include "../test/lltut.h"
#include "../llcapabilityprovider.h"
#include "lluuid.h"
-#include "llerrorcontrol.h"
#include "tests/networkio.h"
#include "tests/commtest.h"
+#include "tests/wrapllerrs.h"
#include "stringize.h"
#if defined(LL_WINDOWS)
@@ -104,28 +104,6 @@ namespace tut
typedef llcapears_group::object llcapears_object;
llcapears_group llsdmgr("llcapabilitylistener");
- struct CaptureError: public LLError::OverrideFatalFunction
- {
- CaptureError():
- LLError::OverrideFatalFunction(boost::bind(&CaptureError::operator(), this, _1))
- {
- LLError::setPrintLocation(false);
- }
-
- struct FatalException: public std::runtime_error
- {
- FatalException(const std::string& what): std::runtime_error(what) {}
- };
-
- void operator()(const std::string& message)
- {
- error = message;
- throw FatalException(message);
- }
-
- std::string error;
- };
-
template<> template<>
void llcapears_object::test<1>()
{
@@ -137,10 +115,10 @@ namespace tut
std::string threw;
try
{
- CaptureError capture;
+ WrapLL_ERRS capture;
regionPump.post(request);
}
- catch (const CaptureError::FatalException& e)
+ catch (const WrapLL_ERRS::FatalException& e)
{
threw = e.what();
}
@@ -184,10 +162,10 @@ namespace tut
std::string threw;
try
{
- CaptureError capture;
+ WrapLL_ERRS capture;
regionPump.post(request);
}
- catch (const CaptureError::FatalException& e)
+ catch (const WrapLL_ERRS::FatalException& e)
{
threw = e.what();
}
@@ -246,10 +224,10 @@ namespace tut
std::string threw;
try
{
- CaptureError capture;
+ WrapLL_ERRS capture;
regionPump.post(request);
}
- catch (const CaptureError::FatalException& e)
+ catch (const WrapLL_ERRS::FatalException& e)
{
threw = e.what();
}
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
new file mode 100644
index 0000000000..75db76df27
--- /dev/null
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -0,0 +1,416 @@
+/**
+ * @file lllogininstance_test.cpp
+ * @brief Test for lllogininstance.cpp.
+ *
+ * $LicenseInfo:firstyear=2008&license=internal$
+ * Copyright (c) 2008, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "../llviewerprecompiledheaders.h"
+// Own header
+#include "../lllogininstance.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+#include "../test/lltut.h"
+#include "llevents.h"
+
+#if defined(LL_WINDOWS)
+#pragma warning(disable: 4355) // using 'this' in base-class ctor initializer expr
+#endif
+
+// Constants
+const std::string VIEWERLOGIN_URI("viewerlogin_uri");
+const std::string VIEWERLOGIN_GRIDLABEL("viewerlogin_grid");
+
+const std::string APPVIEWER_SERIALNUMBER("appviewer_serialno");
+
+// Link seams.
+
+//-----------------------------------------------------------------------------
+static LLEventStream gTestPump("test_pump");
+
+#include "lllogin.h"
+static std::string gLoginURI;
+static LLSD gLoginCreds;
+static bool gDisconnectCalled = false;
+class LLLogin::Impl
+{
+};
+LLLogin::LLLogin() {}
+LLLogin::~LLLogin() {}
+LLEventPump& LLLogin::getEventPump() { return gTestPump; }
+void LLLogin::connect(const std::string& uri, const LLSD& credentials)
+{
+ gLoginURI = uri;
+ gLoginCreds = credentials;
+}
+
+void LLLogin::disconnect()
+{
+ gDisconnectCalled = true;
+}
+
+//-----------------------------------------------------------------------------
+#include "../llviewernetwork.h"
+unsigned char gMACAddress[MAC_ADDRESS_BYTES] = {'1','2','3','4','5','6'}; /* Flawfinder: ignore */
+
+LLViewerLogin::LLViewerLogin() {}
+LLViewerLogin::~LLViewerLogin() {}
+void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
+{
+ uris.push_back(VIEWERLOGIN_URI);
+}
+std::string LLViewerLogin::getGridLabel() const { return VIEWERLOGIN_GRIDLABEL; }
+
+//-----------------------------------------------------------------------------
+#include "../llviewercontrol.h"
+LLControlGroup gSavedSettings("Global");
+std::string gCurrentVersion = "invalid_version";
+
+LLControlGroup::LLControlGroup(const std::string& name) :
+ LLInstanceTracker<LLControlGroup, std::string>(name){}
+LLControlGroup::~LLControlGroup() {}
+void LLControlGroup::setBOOL(const std::string& name, BOOL val) {}
+BOOL LLControlGroup::getBOOL(const std::string& name) { return FALSE; }
+U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only) { return 1; }
+void LLControlGroup::setString(const std::string& name, const std::string& val) {}
+std::string LLControlGroup::getString(const std::string& name) { return "test_string"; }
+BOOL LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, BOOL persist) { return TRUE; }
+BOOL LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, BOOL persist) { return TRUE; }
+
+#include "lluicolortable.h"
+void LLUIColorTable::saveUserSettings(void)const {}
+
+//-----------------------------------------------------------------------------
+#include "../llurlsimstring.h"
+LLURLSimString LLURLSimString::sInstance;
+bool LLURLSimString::parse() { return true; }
+
+//-----------------------------------------------------------------------------
+#include "llnotifications.h"
+#include "llfloaterreg.h"
+static std::string gTOSType;
+static LLEventPump * gTOSReplyPump = NULL;
+
+//static
+LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus)
+{
+ gTOSType = name;
+ gTOSReplyPump = &LLEventPumps::instance().obtain(key["reply_pump"]);
+ return NULL;
+}
+
+//-----------------------------------------------------------------------------
+// LLNotifications
+class MockNotifications : public LLNotificationsInterface
+{
+ boost::function<void (const LLSD&, const LLSD&)> mResponder;
+ int mAddedCount;
+
+public:
+ MockNotifications() :
+ mResponder(0),
+ mAddedCount(0)
+ {
+ }
+
+ virtual ~MockNotifications() {}
+
+ /* virtual */ LLNotificationPtr add(
+ const std::string& name,
+ const LLSD& substitutions,
+ const LLSD& payload,
+ LLNotificationFunctorRegistry::ResponseFunctor functor)
+ {
+ mResponder = functor;
+ mAddedCount++;
+ return LLNotificationPtr((LLNotification*)NULL);
+ }
+
+ void sendYesResponse()
+ {
+ LLSD notification;
+ LLSD response;
+ response = 1;
+ mResponder(notification, response);
+ }
+
+ void sendNoResponse()
+ {
+ LLSD notification;
+ LLSD response;
+ response = 2;
+ mResponder(notification, response);
+ }
+
+ void sendBogusResponse()
+ {
+ LLSD notification;
+ LLSD response;
+ response = 666;
+ mResponder(notification, response);
+ }
+
+ int addedCount() { return mAddedCount; }
+};
+
+S32 LLNotification::getSelectedOption(const LLSD& notification, const LLSD& response)
+{
+ return response.asInteger();
+}
+
+// misc
+std::string xml_escape_string(const std::string& in)
+{
+ return in;
+}
+
+/*****************************************************************************
+* TUT
+*****************************************************************************/
+namespace tut
+{
+ struct lllogininstance_data
+ {
+ lllogininstance_data() : logininstance(LLLoginInstance::getInstance())
+ {
+ // Global initialization
+ gLoginURI.clear();
+ gLoginCreds.clear();
+ gDisconnectCalled = false;
+
+ gTOSType = ""; // Set to invalid value.
+ gTOSReplyPump = 0; // clear the callback.
+
+
+ gSavedSettings.declareBOOL("NoInventoryLibrary", FALSE, "", FALSE);
+ gSavedSettings.declareBOOL("ConnectAsGod", FALSE, "", FALSE);
+ gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", FALSE);
+ gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", FALSE);
+ gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", FALSE);
+ gSavedSettings.declareString("VersionChannelName", "test_version_string", "", FALSE);
+ gSavedSettings.declareString("NextLoginLocation", "", "", FALSE);
+ gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", FALSE);
+
+ credentials["first"] = "testfirst";
+ credentials["last"] = "testlast";
+ credentials["passwd"] = "testpass";
+
+ logininstance->setNotificationsInterface(&notifications);
+ }
+
+ LLLoginInstance* logininstance;
+ LLSD credentials;
+ MockNotifications notifications;
+ };
+
+ typedef test_group<lllogininstance_data> lllogininstance_group;
+ typedef lllogininstance_group::object lllogininstance_object;
+ lllogininstance_group llsdmgr("lllogininstance");
+
+ template<> template<>
+ void lllogininstance_object::test<1>()
+ {
+ set_test_name("Test Simple Success And Disconnect");
+
+ // Test default connect.
+ logininstance->connect(credentials);
+
+ ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
+
+ // Dummy success response.
+ LLSD response;
+ response["state"] = "online";
+ response["progress"] = 1.0;
+ response["transfer_rate"] = 7;
+ response["data"] = "test_data";
+
+ gTestPump.post(response);
+
+ ensure("Success response", logininstance->authSuccess());
+ ensure_equals("Test Response Data", logininstance->getResponse().asString(), "test_data");
+
+ logininstance->disconnect();
+
+ ensure_equals("Called Login Module Disconnect", gDisconnectCalled, true);
+
+ response.clear();
+ response["state"] = "offline";
+ response["progress"] = 0.0;
+ response["transfer_rate"] = 0;
+ response["data"] = "test_data";
+
+ gTestPump.post(response);
+
+ ensure("Disconnected", !(logininstance->authSuccess()));
+ }
+
+ template<> template<>
+ void lllogininstance_object::test<2>()
+ {
+ set_test_name("Test User TOS/Critical message Interaction");
+
+ const std::string test_uri = "testing-uri";
+
+ // Test default connect.
+ logininstance->connect(test_uri, credentials);
+
+ // connect should call LLLogin::connect to init gLoginURI and gLoginCreds.
+ ensure_equals("Default connect uri", gLoginURI, "testing-uri");
+ ensure_equals("Default for agree to tos", gLoginCreds["params"]["agree_to_tos"].asBoolean(), false);
+ ensure_equals("Default for read critical", gLoginCreds["params"]["read_critical"].asBoolean(), false);
+
+ // TOS failure response.
+ LLSD response;
+ response["state"] = "offline";
+ response["progress"] = 0.0;
+ response["transfer_rate"] = 7;
+ response["data"]["reason"] = "tos";
+ gTestPump.post(response);
+
+ ensure_equals("TOS Dialog type", gTOSType, "message_tos");
+ ensure("TOS callback given", gTOSReplyPump != 0);
+ gTOSReplyPump->post(false); // Call callback denying TOS.
+ ensure("No TOS, failed auth", logininstance->authFailure());
+
+ // Start again.
+ logininstance->connect(test_uri, credentials);
+ gTestPump.post(response); // Fail for tos again.
+ gTOSReplyPump->post(true); // Accept tos, should reconnect w/ agree_to_tos.
+ ensure_equals("Accepted agree to tos", gLoginCreds["params"]["agree_to_tos"].asBoolean(), true);
+ ensure("Incomplete login status", !logininstance->authFailure() && !logininstance->authSuccess());
+
+ // Fail connection, attempt connect again.
+ // The new request should have reset agree to tos to default.
+ response["data"]["reason"] = "key"; // bad creds.
+ gTestPump.post(response);
+ ensure("TOS auth failure", logininstance->authFailure());
+
+ logininstance->connect(test_uri, credentials);
+ ensure_equals("Reset to default for agree to tos", gLoginCreds["params"]["agree_to_tos"].asBoolean(), false);
+
+ // Critical Message failure response.
+ logininstance->connect(test_uri, credentials);
+ response["data"]["reason"] = "critical"; // Change response to "critical message"
+ gTestPump.post(response);
+
+ ensure_equals("TOS Dialog type", gTOSType, "message_critical");
+ ensure("TOS callback given", gTOSReplyPump != 0);
+ gTOSReplyPump->post(true);
+ ensure_equals("Accepted read critical message", gLoginCreds["params"]["read_critical"].asBoolean(), true);
+ ensure("Incomplete login status", !logininstance->authFailure() && !logininstance->authSuccess());
+
+ // Fail then attempt new connection
+ response["data"]["reason"] = "key"; // bad creds.
+ gTestPump.post(response);
+ ensure("TOS auth failure", logininstance->authFailure());
+ logininstance->connect(test_uri, credentials);
+ ensure_equals("Default for agree to tos", gLoginCreds["params"]["read_critical"].asBoolean(), false);
+ }
+
+ template<> template<>
+ void lllogininstance_object::test<3>()
+ {
+ set_test_name("Test Mandatory Update User Accepts");
+
+ // Part 1 - Mandatory Update, with User accepts response.
+ // Test connect with update needed.
+ logininstance->connect(credentials);
+
+ ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
+
+ // Update needed failure response.
+ LLSD response;
+ response["state"] = "offline";
+ response["progress"] = 0.0;
+ response["transfer_rate"] = 7;
+ response["data"]["reason"] = "update";
+ gTestPump.post(response);
+
+ ensure_equals("Notification added", notifications.addedCount(), 1);
+
+ notifications.sendYesResponse();
+
+ ensure("Disconnected", !(logininstance->authSuccess()));
+ }
+
+ template<> template<>
+ void lllogininstance_object::test<4>()
+ {
+ set_test_name("Test Mandatory Update User Decline");
+
+ // Test connect with update needed.
+ logininstance->connect(credentials);
+
+ ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
+
+ // Update needed failure response.
+ LLSD response;
+ response["state"] = "offline";
+ response["progress"] = 0.0;
+ response["transfer_rate"] = 7;
+ response["data"]["reason"] = "update";
+ gTestPump.post(response);
+
+ ensure_equals("Notification added", notifications.addedCount(), 1);
+ notifications.sendNoResponse();
+
+ ensure("Disconnected", !(logininstance->authSuccess()));
+ }
+
+ template<> template<>
+ void lllogininstance_object::test<6>()
+ {
+ set_test_name("Test Optional Update User Accept");
+
+ // Part 3 - Mandatory Update, with bogus response.
+ // Test connect with update needed.
+ logininstance->connect(credentials);
+
+ ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
+
+ // Update needed failure response.
+ LLSD response;
+ response["state"] = "offline";
+ response["progress"] = 0.0;
+ response["transfer_rate"] = 7;
+ response["data"]["reason"] = "optional";
+ gTestPump.post(response);
+
+ ensure_equals("Notification added", notifications.addedCount(), 1);
+ notifications.sendYesResponse();
+
+ ensure("Disconnected", !(logininstance->authSuccess()));
+ }
+
+ template<> template<>
+ void lllogininstance_object::test<7>()
+ {
+ set_test_name("Test Optional Update User Denies");
+
+ // Part 3 - Mandatory Update, with bogus response.
+ // Test connect with update needed.
+ logininstance->connect(credentials);
+
+ ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
+
+ // Update needed failure response.
+ LLSD response;
+ response["state"] = "offline";
+ response["progress"] = 0.0;
+ response["transfer_rate"] = 7;
+ response["data"]["reason"] = "optional";
+ gTestPump.post(response);
+
+ ensure_equals("Notification added", notifications.addedCount(), 1);
+ notifications.sendNoResponse();
+
+ // User skips, should be reconnecting.
+ ensure_equals("reconnect uri", gLoginURI, VIEWERLOGIN_URI);
+ ensure_equals("skipping optional update", gLoginCreds["params"]["skipoptional"].asBoolean(), true);
+ }
+}
diff --git a/indra/newview/tests/llxmlrpclistener_test.cpp b/indra/newview/tests/llxmlrpclistener_test.cpp
new file mode 100644
index 0000000000..c94ba0a3e8
--- /dev/null
+++ b/indra/newview/tests/llxmlrpclistener_test.cpp
@@ -0,0 +1,230 @@
+/*
+ * @file llxmlrpclistener_test.cpp
+ * @author Nat Goodspeed
+ * @date 2009-03-20
+ * @brief Test for llxmlrpclistener.
+ *
+ * $LicenseInfo:firstyear=2009&license=internal$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "../llviewerprecompiledheaders.h"
+// associated header
+#include "../llxmlrpclistener.h"
+// STL headers
+#include <iomanip>
+// std headers
+// external library headers
+// other Linden headers
+#include "../test/lltut.h"
+#include "../llxmlrpctransaction.h"
+#include "llevents.h"
+#include "lleventfilter.h"
+#include "llsd.h"
+#include "llcontrol.h"
+#include "tests/wrapllerrs.h"
+
+LLControlGroup gSavedSettings("Global");
+
+/*****************************************************************************
+* TUT
+*****************************************************************************/
+namespace tut
+{
+ struct data
+ {
+ data():
+ pumps(LLEventPumps::instance()),
+ uri("http://127.0.0.1:8000")
+ {
+ // These variables are required by machinery used by
+ // LLXMLRPCTransaction. The values reflect reality for this test
+ // executable; hopefully these values are correct.
+ gSavedSettings.declareBOOL("BrowserProxyEnabled", FALSE, "", FALSE); // don't persist
+ gSavedSettings.declareBOOL("NoVerifySSLCert", TRUE, "", FALSE); // don't persist
+ }
+
+ // LLEventPump listener signature
+ bool captureReply(const LLSD& r)
+ {
+ reply = r;
+ return false;
+ }
+
+ LLSD reply;
+ LLEventPumps& pumps;
+ std::string uri;
+ };
+ typedef test_group<data> llxmlrpclistener_group;
+ typedef llxmlrpclistener_group::object object;
+ llxmlrpclistener_group llxmlrpclistenergrp("llxmlrpclistener");
+
+ template<> template<>
+ void object::test<1>()
+ {
+ set_test_name("request validation");
+ WrapLL_ERRS capture;
+ LLSD request;
+ request["uri"] = uri;
+ std::string threw;
+ try
+ {
+ pumps.obtain("LLXMLRPCTransaction").post(request);
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ threw = e.what();
+ }
+ ensure_contains("threw exception", threw, "missing params");
+ ensure_contains("identified missing", threw, "method");
+ ensure_contains("identified missing", threw, "reply");
+ }
+
+ template<> template<>
+ void object::test<2>()
+ {
+ set_test_name("param types validation");
+ WrapLL_ERRS capture;
+ LLSD request;
+ request["uri"] = uri;
+ request["method"] = "hello";
+ request["reply"] = "reply";
+ LLSD& params(request["params"]);
+ params["who"]["specifically"] = "world"; // LLXMLRPCListener only handles scalar params
+ std::string threw;
+ try
+ {
+ pumps.obtain("LLXMLRPCTransaction").post(request);
+ }
+ catch (const WrapLL_ERRS::FatalException& e)
+ {
+ threw = e.what();
+ }
+ ensure_contains("threw exception", threw, "unknown type");
+ }
+
+ template<> template<>
+ void object::test<3>()
+ {
+ set_test_name("success case");
+ LLSD request;
+ request["uri"] = uri;
+ request["method"] = "hello";
+ request["reply"] = "reply";
+ LLSD& params(request["params"]);
+ params["who"] = "world";
+ // Set up a timeout filter so we don't spin forever waiting.
+ LLEventTimeout watchdog;
+ // Connect the timeout filter to the reply pump.
+ LLTempBoundListener temp(
+ pumps.obtain("reply").
+ listen("watchdog", boost::bind(&LLEventTimeout::post, boost::ref(watchdog), _1)));
+ // Now connect our target listener to the timeout filter.
+ watchdog.listen("captureReply", boost::bind(&data::captureReply, this, _1));
+ // Kick off the request...
+ reply.clear();
+ pumps.obtain("LLXMLRPCTransaction").post(request);
+ // Set the timer
+ F32 timeout(10);
+ watchdog.eventAfter(timeout, LLSD().insert("timeout", 0));
+ // and pump "mainloop" until we get something, whether from
+ // LLXMLRPCListener or from the watchdog filter.
+ LLTimer timer;
+ F32 start = timer.getElapsedTimeF32();
+ LLEventPump& mainloop(pumps.obtain("mainloop"));
+ while (reply.isUndefined())
+ {
+ mainloop.post(LLSD());
+ }
+ ensure("timeout works", (timer.getElapsedTimeF32() - start) < (timeout + 1));
+ ensure_equals(reply["responses"]["hi_there"].asString(), "Hello, world!");
+ }
+
+ template<> template<>
+ void object::test<4>()
+ {
+ set_test_name("bogus method");
+ LLSD request;
+ request["uri"] = uri;
+ request["method"] = "goodbye";
+ request["reply"] = "reply";
+ LLSD& params(request["params"]);
+ params["who"] = "world";
+ // Set up a timeout filter so we don't spin forever waiting.
+ LLEventTimeout watchdog;
+ // Connect the timeout filter to the reply pump.
+ LLTempBoundListener temp(
+ pumps.obtain("reply").
+ listen("watchdog", boost::bind(&LLEventTimeout::post, boost::ref(watchdog), _1)));
+ // Now connect our target listener to the timeout filter.
+ watchdog.listen("captureReply", boost::bind(&data::captureReply, this, _1));
+ // Kick off the request...
+ reply.clear();
+ pumps.obtain("LLXMLRPCTransaction").post(request);
+ // Set the timer
+ F32 timeout(10);
+ watchdog.eventAfter(timeout, LLSD().insert("timeout", 0));
+ // and pump "mainloop" until we get something, whether from
+ // LLXMLRPCListener or from the watchdog filter.
+ LLTimer timer;
+ F32 start = timer.getElapsedTimeF32();
+ LLEventPump& mainloop(pumps.obtain("mainloop"));
+ while (reply.isUndefined())
+ {
+ mainloop.post(LLSD());
+ }
+ ensure("timeout works", (timer.getElapsedTimeF32() - start) < (timeout + 1));
+ ensure_equals("XMLRPC error", reply["status"].asString(), "XMLRPCError");
+ }
+
+ template<> template<>
+ void object::test<5>()
+ {
+ set_test_name("bad type");
+ LLSD request;
+ request["uri"] = uri;
+ request["method"] = "getdict";
+ request["reply"] = "reply";
+ (void)request["params"];
+ // Set up a timeout filter so we don't spin forever waiting.
+ LLEventTimeout watchdog;
+ // Connect the timeout filter to the reply pump.
+ LLTempBoundListener temp(
+ pumps.obtain("reply").
+ listen("watchdog", boost::bind(&LLEventTimeout::post, boost::ref(watchdog), _1)));
+ // Now connect our target listener to the timeout filter.
+ watchdog.listen("captureReply", boost::bind(&data::captureReply, this, _1));
+ // Kick off the request...
+ reply.clear();
+ pumps.obtain("LLXMLRPCTransaction").post(request);
+ // Set the timer
+ F32 timeout(10);
+ watchdog.eventAfter(timeout, LLSD().insert("timeout", 0));
+ // and pump "mainloop" until we get something, whether from
+ // LLXMLRPCListener or from the watchdog filter.
+ LLTimer timer;
+ F32 start = timer.getElapsedTimeF32();
+ LLEventPump& mainloop(pumps.obtain("mainloop"));
+ while (reply.isUndefined())
+ {
+ mainloop.post(LLSD());
+ }
+ ensure("timeout works", (timer.getElapsedTimeF32() - start) < (timeout + 1));
+ ensure_equals(reply["status"].asString(), "BadType");
+ ensure_contains("bad type", reply["responses"]["nested_dict"].asString(), "bad XMLRPC type");
+ }
+} // namespace tut
+
+/*****************************************************************************
+* Resolve link errors: use real machinery here, since we intend to exchange
+* actual XML with a peer process.
+*****************************************************************************/
+// Including llxmlrpctransaction.cpp drags in the static LLXMLRPCListener
+// instantiated there. That's why it works to post requests to the LLEventPump
+// named "LLXMLRPCTransaction".
+#include "../llxmlrpctransaction.cpp"
+#include "llcontrol.cpp"
+#include "llxmltree.cpp"
+#include "llxmlparser.cpp"
diff --git a/indra/newview/tests/test_llxmlrpc_peer.py b/indra/newview/tests/test_llxmlrpc_peer.py
new file mode 100644
index 0000000000..cb8f7d26c4
--- /dev/null
+++ b/indra/newview/tests/test_llxmlrpc_peer.py
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+"""\
+@file test_llxmlrpc_peer.py
+@author Nat Goodspeed
+@date 2008-10-09
+@brief This script asynchronously runs the executable (with args) specified on
+ the command line, returning its result code. While that executable is
+ running, we provide dummy local services for use by C++ tests.
+
+$LicenseInfo:firstyear=2008&license=viewergpl$
+Copyright (c) 2008, Linden Research, Inc.
+$/LicenseInfo$
+"""
+
+import os
+import sys
+from threading import Thread
+from SimpleXMLRPCServer import SimpleXMLRPCServer
+
+mydir = os.path.dirname(__file__) # expected to be .../indra/newview/tests/
+sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "lib", "python"))
+sys.path.insert(1, os.path.join(mydir, os.pardir, os.pardir, "llmessage", "tests"))
+from testrunner import run, debug
+
+class TestServer(SimpleXMLRPCServer):
+ def _dispatch(self, method, params):
+ try:
+ func = getattr(self, method)
+ except AttributeError:
+ raise Exception('method "%s" is not supported' % method)
+ else:
+ # LLXMLRPCListener constructs XMLRPC parameters that arrive as a
+ # 1-tuple containing a dict.
+ return func(**(params[0]))
+
+ def hello(self, who):
+ # LLXMLRPCListener expects a dict return.
+ return {"hi_there": "Hello, %s!" % who}
+
+ def getdict(self):
+ return dict(nested_dict=dict(a=17, b=5))
+
+ def log_request(self, code, size=None):
+ # For present purposes, we don't want the request splattered onto
+ # stderr, as it would upset devs watching the test run
+ pass
+
+ def log_error(self, format, *args):
+ # Suppress error output as well
+ pass
+
+class ServerRunner(Thread):
+ def run(self):
+ server = TestServer(('127.0.0.1', 8000))
+ debug("Starting XMLRPC server...\n")
+ server.serve_forever()
+
+if __name__ == "__main__":
+ sys.exit(run(server=ServerRunner(name="xmlrpc"), *sys.argv[1:]))
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index e85fddbc99..7084fca865 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1,735 +1,796 @@
-#!/usr/bin/python
-# @file viewer_manifest.py
-# @author Ryan Williams
-# @brief Description of all installer viewer files, and methods for packaging
-# them into installers for all supported platforms.
-#
-# $LicenseInfo:firstyear=2006&license=viewergpl$
-#
-# Copyright (c) 2006-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
-import sys
-import os.path
-import re
-import tarfile
-viewer_dir = os.path.dirname(__file__)
-# add llmanifest library to our path so we don't have to muck with PYTHONPATH
-sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util'))
-from llmanifest import LLManifest, main, proper_windows_path, path_ancestors
-
-class ViewerManifest(LLManifest):
- def construct(self):
- super(ViewerManifest, self).construct()
- self.exclude("*.svn*")
- self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg")
- self.path(src="../../etc/message.xml", dst="app_settings/message.xml")
-
- if self.prefix(src="app_settings"):
- self.exclude("logcontrol.xml")
- self.exclude("logcontrol-dev.xml")
- self.path("*.pem")
- self.path("*.ini")
- self.path("*.xml")
- self.path("*.db2")
-
- # include the entire shaders directory recursively
- self.path("shaders")
- # ... and the entire windlight directory
- self.path("windlight")
- self.end_prefix("app_settings")
-
- if self.prefix(src="character"):
- self.path("*.llm")
- self.path("*.xml")
- self.path("*.tga")
- self.end_prefix("character")
-
- # Include our fonts
- if self.prefix(src="fonts"):
- self.path("*.ttf")
- self.path("*.txt")
- self.end_prefix("fonts")
-
- # skins
- if self.prefix(src="skins"):
- self.path("paths.xml")
- # include the entire textures directory recursively
- if self.prefix(src="*/textures"):
- self.path("*/*.tga")
- self.path("*/*.j2c")
- self.path("*/*.jpg")
- self.path("*/*.png")
- self.path("*.tga")
- self.path("*.j2c")
- self.path("*.jpg")
- self.path("*.png")
- self.path("textures.xml")
- self.end_prefix("*/textures")
- self.path("*/xui/*/*.xml")
- self.path("*/xui/*/widgets/*.xml")
- self.path("*/*.xml")
-
- # Local HTML files (e.g. loading screen)
- if self.prefix(src="*/html"):
- self.path("*.png")
- self.path("*/*/*.html")
- self.path("*/*/*.gif")
- self.end_prefix("*/html")
- self.end_prefix("skins")
-
- # Files in the newview/ directory
- self.path("gpu_table.txt")
-
- def login_channel(self):
- """Channel reported for login and upgrade purposes ONLY;
- used for A/B testing"""
- # NOTE: Do not return the normal channel if login_channel
- # is not specified, as some code may branch depending on
- # whether or not this is present
- return self.args.get('login_channel')
-
- def grid(self):
- return self.args['grid']
- def channel(self):
- return self.args['channel']
- def channel_unique(self):
- return self.channel().replace("Second Life", "").strip()
- def channel_oneword(self):
- return "".join(self.channel_unique().split())
- def channel_lowerword(self):
- return self.channel_oneword().lower()
-
- def flags_list(self):
- """ Convenience function that returns the command-line flags
- for the grid"""
-
- # Set command line flags relating to the target grid
- grid_flags = ''
- if not self.default_grid():
- grid_flags = "--grid %(grid)s "\
- "--helperuri http://preview-%(grid)s.secondlife.com/helpers/" %\
- {'grid':self.grid()}
-
- # set command line flags for channel
- channel_flags = ''
- if self.login_channel() and self.login_channel() != self.channel():
- # Report a special channel during login, but use default
- channel_flags = '--channel "%s"' % (self.login_channel())
- elif not self.default_channel():
- channel_flags = '--channel "%s"' % self.channel()
-
- # Deal with settings
- setting_flags = ''
- if not self.default_channel() or not self.default_grid():
- if self.default_grid():
- setting_flags = '--settings settings_%s.xml'\
- % self.channel_lowerword()
- else:
- setting_flags = '--settings settings_%s_%s.xml'\
- % (self.grid(), self.channel_lowerword())
-
- return " ".join((channel_flags, grid_flags, setting_flags)).strip()
-
-
-class WindowsManifest(ViewerManifest):
- def final_exe(self):
- if self.default_channel():
- if self.default_grid():
- return "SecondLife.exe"
- else:
- return "SecondLifePreview.exe"
- else:
- return ''.join(self.channel().split()) + '.exe'
-
-
- def construct(self):
- super(WindowsManifest, self).construct()
- # the final exe is complicated because we're not sure where it's coming from,
- # nor do we have a fixed name for the executable
- self.path(self.find_existing_file('debug/secondlife-bin.exe', 'release/secondlife-bin.exe', 'relwithdebinfo/secondlife-bin.exe'), dst=self.final_exe())
- # need to get the kdu dll from any of the build directories as well
- try:
- self.path(self.find_existing_file('../llkdu/%s/llkdu.dll' % self.args['configuration'],
- '../../libraries/i686-win32/lib/release/llkdu.dll'),
- dst='llkdu.dll')
- pass
- except:
- print "Skipping llkdu.dll"
- pass
- self.path(src="licenses-win32.txt", dst="licenses.txt")
-
- self.path("featuretable.txt")
-
- # For use in crash reporting (generates minidumps)
- self.path("dbghelp.dll")
-
- # For using FMOD for sound... DJS
- self.path("fmod.dll")
-
- # For textures
- if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
- self.path("openjpeg.dll")
- self.end_prefix()
-
- # Plugin host application
- if self.prefix(src='../llplugin/slplugin/%s' % self.args['configuration'], dst="llplugin"):
- self.path("slplugin.exe")
- self.end_prefix()
-
- # Media plugins - QuickTime
- if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"):
- self.path("media_plugin_quicktime.dll")
- self.end_prefix()
-
- # Media plugins - WebKit/Qt
- if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
- self.path("media_plugin_webkit.dll")
- self.end_prefix()
-
- # For WebKit/Qt plugin runtimes
- if self.prefix(src="../../libraries/i686-win32/lib/release", dst="llplugin"):
- self.path("libeay32.dll")
- self.path("qtcore4.dll")
- self.path("qtgui4.dll")
- self.path("qtnetwork4.dll")
- self.path("qtopengl4.dll")
- self.path("qtwebkit4.dll")
- self.path("ssleay32.dll")
- self.end_prefix()
-
- # For WebKit/Qt plugin runtimes (image format plugins)
- if self.prefix(src="../../libraries/i686-win32/lib/release/imageformats", dst="llplugin/imageformats"):
- self.path("qgif4.dll")
- self.path("qico4.dll")
- self.path("qjpeg4.dll")
- self.path("qmng4.dll")
- self.path("qsvg4.dll")
- self.path("qtiff4.dll")
- self.end_prefix()
-
- # These need to be installed as a SxS assembly, currently a 'private' assembly.
- # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx
- if self.prefix(src=self.args['configuration'], dst=""):
- if self.args['configuration'] == 'Debug':
- self.path("msvcr80d.dll")
- self.path("msvcp80d.dll")
- self.path("Microsoft.VC80.DebugCRT.manifest")
- else:
- self.path("msvcr80.dll")
- self.path("msvcp80.dll")
- self.path("Microsoft.VC80.CRT.manifest")
- self.end_prefix()
-
- # The config file name needs to match the exe's name.
- self.path(src="%s/secondlife-bin.exe.config" % self.args['configuration'], dst=self.final_exe() + ".config")
-
- # Vivox runtimes
- if self.prefix(src="vivox-runtime/i686-win32", dst=""):
- self.path("SLVoice.exe")
- self.path("alut.dll")
- self.path("vivoxsdk.dll")
- self.path("ortp.dll")
- self.path("wrap_oal.dll")
- self.end_prefix()
-
- # pull in the crash logger and updater from other projects
- self.path(src=self.find_existing_file( # tag:"crash-logger" here as a cue to the exporter
- "../win_crash_logger/debug/windows-crash-logger.exe",
- "../win_crash_logger/release/windows-crash-logger.exe",
- "../win_crash_logger/relwithdebinfo/windows-crash-logger.exe"),
- dst="win_crash_logger.exe")
- self.path(src=self.find_existing_file(
- "../win_updater/debug/windows-updater.exe",
- "../win_updater/release/windows-updater.exe",
- "../win_updater/relwithdebinfo/windows-updater.exe"),
- dst="updater.exe")
-
- # For google-perftools tcmalloc allocator.
- if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
- self.path("libtcmalloc_minimal.dll")
- self.end_prefix()
-
-
- def nsi_file_commands(self, install=True):
- def wpath(path):
- if path.endswith('/') or path.endswith(os.path.sep):
- path = path[:-1]
- path = path.replace('/', '\\')
- return path
-
- result = ""
- dest_files = [pair[1] for pair in self.file_list if pair[0] and os.path.isfile(pair[1])]
- # sort deepest hierarchy first
- dest_files.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
- dest_files.reverse()
- out_path = None
- for pkg_file in dest_files:
- rel_file = os.path.normpath(pkg_file.replace(self.get_dst_prefix()+os.path.sep,''))
- installed_dir = wpath(os.path.join('$INSTDIR', os.path.dirname(rel_file)))
- pkg_file = wpath(os.path.normpath(pkg_file))
- if installed_dir != out_path:
- if install:
- out_path = installed_dir
- result += 'SetOutPath ' + out_path + '\n'
- if install:
- result += 'File ' + pkg_file + '\n'
- else:
- result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n'
- # at the end of a delete, just rmdir all the directories
- if not install:
- deleted_file_dirs = [os.path.dirname(pair[1].replace(self.get_dst_prefix()+os.path.sep,'')) for pair in self.file_list]
- # find all ancestors so that we don't skip any dirs that happened to have no non-dir children
- deleted_dirs = []
- for d in deleted_file_dirs:
- deleted_dirs.extend(path_ancestors(d))
- # sort deepest hierarchy first
- deleted_dirs.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
- deleted_dirs.reverse()
- prev = None
- for d in deleted_dirs:
- if d != prev: # skip duplicates
- result += 'RMDir ' + wpath(os.path.join('$INSTDIR', os.path.normpath(d))) + '\n'
- prev = d
-
- return result
-
- def package_finish(self):
- # a standard map of strings for replacing in the templates
- substitution_strings = {
- 'version' : '.'.join(self.args['version']),
- 'version_short' : '.'.join(self.args['version'][:-1]),
- 'version_dashes' : '-'.join(self.args['version']),
- 'final_exe' : self.final_exe(),
- 'grid':self.args['grid'],
- 'grid_caps':self.args['grid'].upper(),
- # escape quotes becase NSIS doesn't handle them well
- 'flags':self.flags_list().replace('"', '$\\"'),
- 'channel':self.channel(),
- 'channel_oneword':self.channel_oneword(),
- 'channel_unique':self.channel_unique(),
- }
-
- version_vars = """
- !define INSTEXE "%(final_exe)s"
- !define VERSION "%(version_short)s"
- !define VERSION_LONG "%(version)s"
- !define VERSION_DASHES "%(version_dashes)s"
- """ % substitution_strings
- if self.default_channel():
- if self.default_grid():
- # release viewer
- installer_file = "Second_Life_%(version_dashes)s_Setup.exe"
- grid_vars_template = """
- OutFile "%(installer_file)s"
- !define INSTFLAGS "%(flags)s"
- !define INSTNAME "SecondLife"
- !define SHORTCUT "Second Life"
- !define URLNAME "secondlife"
- Caption "Second Life ${VERSION}"
- """
- else:
- # beta grid viewer
- installer_file = "Second_Life_%(version_dashes)s_(%(grid_caps)s)_Setup.exe"
- grid_vars_template = """
- OutFile "%(installer_file)s"
- !define INSTFLAGS "%(flags)s"
- !define INSTNAME "SecondLife%(grid_caps)s"
- !define SHORTCUT "Second Life (%(grid_caps)s)"
- !define URLNAME "secondlife%(grid)s"
- !define UNINSTALL_SETTINGS 1
- Caption "Second Life %(grid)s ${VERSION}"
- """
- else:
- # some other channel on some grid
- installer_file = "Second_Life_%(version_dashes)s_%(channel_oneword)s_Setup.exe"
- grid_vars_template = """
- OutFile "%(installer_file)s"
- !define INSTFLAGS "%(flags)s"
- !define INSTNAME "SecondLife%(channel_oneword)s"
- !define SHORTCUT "%(channel)s"
- !define URLNAME "secondlife"
- !define UNINSTALL_SETTINGS 1
- Caption "%(channel)s ${VERSION}"
- """
- if 'installer_name' in self.args:
- installer_file = self.args['installer_name']
- else:
- installer_file = installer_file % substitution_strings
- substitution_strings['installer_file'] = installer_file
-
- tempfile = "secondlife_setup_tmp.nsi"
- # the following replaces strings in the nsi template
- # it also does python-style % substitution
- self.replace_in("installers/windows/installer_template.nsi", tempfile, {
- "%%VERSION%%":version_vars,
- "%%SOURCE%%":self.get_src_prefix(),
- "%%GRID_VARS%%":grid_vars_template % substitution_strings,
- "%%INSTALL_FILES%%":self.nsi_file_commands(True),
- "%%DELETE_FILES%%":self.nsi_file_commands(False)})
-
- # We use the Unicode version of NSIS, available from
- # http://www.scratchpaper.com/
- NSIS_path = 'C:\\Program Files\\NSIS\\Unicode\\makensis.exe'
- self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile))
- # self.remove(self.dst_path_of(tempfile))
- # If we're on a build machine, sign the code using our Authenticode certificate. JC
- sign_py = os.path.expandvars("${SIGN}")
- if not sign_py or sign_py == "${SIGN}":
- sign_py = 'C:\\buildscripts\\code-signing\\sign.py'
- else:
- sign_py = sign_py.replace('\\', '\\\\\\\\')
- python = os.path.expandvars("${PYTHON}")
- if not python or python == "${PYTHON}":
- python = 'python'
- if os.path.exists(sign_py):
- self.run_command("%s %s %s" % (python, sign_py, self.dst_path_of(installer_file).replace('\\', '\\\\\\\\')))
- else:
- print "Skipping code signing,", sign_py, "does not exist"
- self.created_path(self.dst_path_of(installer_file))
- self.package_file = installer_file
-
-
-class DarwinManifest(ViewerManifest):
- def construct(self):
- # copy over the build result (this is a no-op if run within the xcode script)
- self.path(self.args['configuration'] + "/Second Life.app", dst="")
-
- if self.prefix(src="", dst="Contents"): # everything goes in Contents
- self.path("Info-SecondLife.plist", dst="Info.plist")
-
- # copy additional libs in <bundle>/Contents/MacOS/
- self.path("../../libraries/universal-darwin/lib_release/libndofdev.dylib", dst="MacOS/libndofdev.dylib")
-
- # most everything goes in the Resources directory
- if self.prefix(src="", dst="Resources"):
- super(DarwinManifest, self).construct()
-
- if self.prefix("cursors_mac"):
- self.path("*.tif")
- self.end_prefix("cursors_mac")
-
- self.path("licenses-mac.txt", dst="licenses.txt")
- self.path("featuretable_mac.txt")
- self.path("SecondLife.nib")
-
- # If we are not using the default channel, use the 'Firstlook
- # icon' to show that it isn't a stable release.
- if self.default_channel() and self.default_grid():
- self.path("secondlife.icns")
- else:
- self.path("secondlife_firstlook.icns", "secondlife.icns")
- self.path("SecondLife.nib")
-
- # Translations
- self.path("English.lproj")
- self.path("German.lproj")
- self.path("Japanese.lproj")
- self.path("Korean.lproj")
- self.path("da.lproj")
- self.path("es.lproj")
- self.path("fr.lproj")
- self.path("hu.lproj")
- self.path("it.lproj")
- self.path("nl.lproj")
- self.path("pl.lproj")
- self.path("pt.lproj")
- self.path("ru.lproj")
- self.path("tr.lproj")
- self.path("uk.lproj")
- self.path("zh-Hans.lproj")
-
- # SLVoice and vivox lols
- self.path("vivox-runtime/universal-darwin/libalut.dylib", "libalut.dylib")
- self.path("vivox-runtime/universal-darwin/libopenal.dylib", "libopenal.dylib")
- self.path("vivox-runtime/universal-darwin/libortp.dylib", "libortp.dylib")
- self.path("vivox-runtime/universal-darwin/libvivoxsdk.dylib", "libvivoxsdk.dylib")
- self.path("vivox-runtime/universal-darwin/SLVoice", "SLVoice")
-
- # need to get the kdu dll from any of the build directories as well
- try:
- self.path(self.find_existing_file('../llkdu/%s/libllkdu.dylib' % self.args['configuration'],
- "../../libraries/universal-darwin/lib_release/libllkdu.dylib"),
- dst='libllkdu.dylib')
- pass
- except:
- print "Skipping libllkdu.dylib"
- pass
-
- #libfmodwrapper.dylib
- self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib")
-
- # our apps
- self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
- self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
-
- # plugins
- if self.prefix(src="", dst="llplugin"):
- self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin", "SLPlugin")
- self.path("../media_plugins/quicktime/" + self.args['configuration'] + "/media_plugin_quicktime.dylib", "media_plugin_quicktime.dylib")
- self.path("../media_plugins/webkit/" + self.args['configuration'] + "/media_plugin_webkit.dylib", "media_plugin_webkit.dylib")
- self.path("../../libraries/universal-darwin/lib_release/libllqtwebkit.dylib", "libllqtwebkit.dylib")
-
- self.end_prefix("llplugin")
-
- # command line arguments for connecting to the proper grid
- self.put_in_file(self.flags_list(), 'arguments.txt')
-
- self.end_prefix("Resources")
-
- self.end_prefix("Contents")
-
- # NOTE: the -S argument to strip causes it to keep enough info for
- # annotated backtraces (i.e. function names in the crash log). 'strip' with no
- # arguments yields a slightly smaller binary but makes crash logs mostly useless.
- # This may be desirable for the final release. Or not.
- if ("package" in self.args['actions'] or
- "unpacked" in self.args['actions']):
- self.run_command('strip -S "%(viewer_binary)s"' %
- { 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')})
-
-
- def package_finish(self):
- channel_standin = 'Second Life' # hah, our default channel is not usable on its own
- if not self.default_channel():
- channel_standin = self.channel()
-
- imagename="SecondLife_" + '_'.join(self.args['version'])
-
- # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning.
- # If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick.
-
- volname="Second Life Installer" # DO NOT CHANGE without understanding comment above
-
- if self.default_channel():
- if not self.default_grid():
- # beta case
- imagename = imagename + '_' + self.args['grid'].upper()
- else:
- # first look, etc
- imagename = imagename + '_' + self.channel_oneword().upper()
-
- sparsename = imagename + ".sparseimage"
- finalname = imagename + ".dmg"
- # make sure we don't have stale files laying about
- self.remove(sparsename, finalname)
-
- self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 400 -layout SPUD' % {
- 'sparse':sparsename,
- 'vol':volname})
-
- # mount the image and get the name of the mount point and device node
- hdi_output = self.run_command('hdiutil attach -private "' + sparsename + '"')
- devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip()
- volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip()
-
- # Copy everything in to the mounted .dmg
-
- if self.default_channel() and not self.default_grid():
- app_name = "Second Life " + self.args['grid']
- else:
- app_name = channel_standin.strip()
-
- # Hack:
- # Because there is no easy way to coerce the Finder into positioning
- # the app bundle in the same place with different app names, we are
- # adding multiple .DS_Store files to svn. There is one for release,
- # one for release candidate and one for first look. Any other channels
- # will use the release .DS_Store, and will look broken.
- # - Ambroff 2008-08-20
- dmg_template = os.path.join(
- 'installers',
- 'darwin',
- '%s-dmg' % "".join(self.channel_unique().split()).lower())
-
- if not os.path.exists (self.src_path_of(dmg_template)):
- dmg_template = os.path.join ('installers', 'darwin', 'release-dmg')
-
- for s,d in {self.get_dst_prefix():app_name + ".app",
- os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns",
- os.path.join(dmg_template, "background.jpg"): "background.jpg",
- os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items():
- print "Copying to dmg", s, d
- self.copy_action(self.src_path_of(s), os.path.join(volpath, d))
-
- # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit)
- self.run_command('SetFile -a V "' + os.path.join(volpath, ".VolumeIcon.icns") + '"')
- self.run_command('SetFile -a V "' + os.path.join(volpath, "background.jpg") + '"')
- self.run_command('SetFile -a V "' + os.path.join(volpath, ".DS_Store") + '"')
-
- # Create the alias file (which is a resource file) from the .r
- self.run_command('rez "' + self.src_path_of("installers/darwin/release-dmg/Applications-alias.r") + '" -o "' + os.path.join(volpath, "Applications") + '"')
-
- # Set the alias file's alias and custom icon bits
- self.run_command('SetFile -a AC "' + os.path.join(volpath, "Applications") + '"')
-
- # Set the disk image root's custom icon bit
- self.run_command('SetFile -a C "' + volpath + '"')
-
- # Unmount the image
- self.run_command('hdiutil detach -force "' + devfile + '"')
-
- print "Converting temp disk image to final disk image"
- self.run_command('hdiutil convert "%(sparse)s" -format UDZO -imagekey zlib-level=9 -o "%(final)s"' % {'sparse':sparsename, 'final':finalname})
- # get rid of the temp file
- self.package_file = finalname
- self.remove(sparsename)
-
-class LinuxManifest(ViewerManifest):
- def construct(self):
- super(LinuxManifest, self).construct()
- self.path("licenses-linux.txt","licenses.txt")
- self.path("res/ll_icon.png","secondlife_icon.png")
- if self.prefix("linux_tools", dst=""):
- self.path("client-readme.txt","README-linux.txt")
- self.path("client-readme-voice.txt","README-linux-voice.txt")
- self.path("client-readme-joystick.txt","README-linux-joystick.txt")
- self.path("wrapper.sh","secondlife")
- self.path("handle_secondlifeprotocol.sh", "etc/handle_secondlifeprotocol.sh")
- self.path("register_secondlifeprotocol.sh", "etc/register_secondlifeprotocol.sh")
- self.path("refresh_desktop_app_entry.sh", "etc/refresh_desktop_app_entry.sh")
- self.path("launch_url.sh","etc/launch_url.sh")
- self.path("install.sh")
- self.end_prefix("linux_tools")
-
- # Create an appropriate gridargs.dat for this package, denoting required grid.
- self.put_in_file(self.flags_list(), 'etc/gridargs.dat')
-
-
- def package_finish(self):
- if 'installer_name' in self.args:
- installer_name = self.args['installer_name']
- else:
- installer_name_components = ['SecondLife_', self.args.get('arch')]
- installer_name_components.extend(self.args['version'])
- installer_name = "_".join(installer_name_components)
- if self.default_channel():
- if not self.default_grid():
- installer_name += '_' + self.args['grid'].upper()
- else:
- installer_name += '_' + self.channel_oneword().upper()
-
- # Fix access permissions
- self.run_command("""
- find %(dst)s -type d | xargs --no-run-if-empty chmod 755;
- find %(dst)s -type f -perm 0700 | xargs --no-run-if-empty chmod 0755;
- find %(dst)s -type f -perm 0500 | xargs --no-run-if-empty chmod 0555;
- find %(dst)s -type f -perm 0600 | xargs --no-run-if-empty chmod 0644;
- find %(dst)s -type f -perm 0400 | xargs --no-run-if-empty chmod 0444;
- true""" % {'dst':self.get_dst_prefix() })
- self.package_file = installer_name + '.tar.bz2'
-
- # temporarily move directory tree so that it has the right
- # name in the tarfile
- self.run_command("mv %(dst)s %(inst)s" % {
- 'dst': self.get_dst_prefix(),
- 'inst': self.build_path_of(installer_name)})
- try:
- # --numeric-owner hides the username of the builder for
- # security etc.
- self.run_command('tar -C %(dir)s --numeric-owner -cjf '
- '%(inst_path)s.tar.bz2 %(inst_name)s' % {
- 'dir': self.get_build_prefix(),
- 'inst_name': installer_name,
- 'inst_path':self.build_path_of(installer_name)})
- finally:
- self.run_command("mv %(inst)s %(dst)s" % {
- 'dst': self.get_dst_prefix(),
- 'inst': self.build_path_of(installer_name)})
-
-class Linux_i686Manifest(LinuxManifest):
- def construct(self):
- super(Linux_i686Manifest, self).construct()
-
- # install either the libllkdu we just built, or a prebuilt one, in
- # decreasing order of preference. for linux package, this goes to bin/
- try:
- self.path(self.find_existing_file('../llkdu/libllkdu.so',
- '../../libraries/i686-linux/lib_release_client/libllkdu.so'),
- dst='bin/libllkdu.so')
- # keep this one to preserve syntax, open source mangling removes previous lines
- pass
- except:
- print "Skipping libllkdu.so - not found"
- pass
-
- self.path("secondlife-stripped","bin/do-not-directly-run-secondlife-bin")
- self.path("../linux_crash_logger/linux-crash-logger-stripped","bin/linux-crash-logger.bin")
- self.path("../linux_updater/linux-updater-stripped", "bin/linux-updater.bin")
- if self.prefix("res-sdl"):
- self.path("*")
- # recurse
- self.end_prefix("res-sdl")
-
- # plugins
- if self.prefix(src="", dst="bin/llplugin"):
- self.path("../llplugin/slplugin/SLPlugin", "SLPlugin")
- self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
- self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_quicktime.so")
- self.end_prefix("bin/llplugin")
-
- self.path("featuretable_linux.txt")
- #self.path("secondlife-i686.supp")
-
- if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
- #self.path("libkdu_v42R.so", "libkdu.so")
- self.path("libfmod-3.75.so")
- self.path("libapr-1.so.0")
- self.path("libaprutil-1.so.0")
- self.path("libdb-4.2.so")
- self.path("libcrypto.so.0.9.7")
- self.path("libexpat.so.1")
- self.path("libssl.so.0.9.7")
- self.path("libuuid.so", "libuuid.so.1")
- self.path("libSDL-1.2.so.0")
- self.path("libELFIO.so")
- self.path("libopenjpeg.so.1.3.0", "libopenjpeg.so.1.3")
- self.path("libalut.so")
- self.path("libopenal.so", "libopenal.so.1")
- self.end_prefix("lib")
-
- # Vivox runtimes
- if self.prefix(src="vivox-runtime/i686-linux", dst="bin"):
- self.path("SLVoice")
- self.end_prefix()
- if self.prefix(src="vivox-runtime/i686-linux", dst="lib"):
- self.path("libortp.so")
- self.path("libvivoxsdk.so")
- self.end_prefix("lib")
-
-class Linux_x86_64Manifest(LinuxManifest):
- def construct(self):
- super(Linux_x86_64Manifest, self).construct()
- self.path("secondlife-stripped","bin/do-not-directly-run-secondlife-bin")
- self.path("../linux_crash_logger/linux-crash-logger-stripped","linux-crash-logger.bin")
- if self.prefix("res-sdl"):
- self.path("*")
- # recurse
- self.end_prefix("res-sdl")
-
- self.path("featuretable_linux.txt")
- self.path("secondlife-i686.supp")
-
-if __name__ == "__main__":
- main()
+#!/usr/bin/python
+# @file viewer_manifest.py
+# @author Ryan Williams
+# @brief Description of all installer viewer files, and methods for packaging
+# them into installers for all supported platforms.
+#
+# $LicenseInfo:firstyear=2006&license=viewergpl$
+#
+# Copyright (c) 2006-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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+import sys
+import os.path
+import re
+import tarfile
+viewer_dir = os.path.dirname(__file__)
+# add llmanifest library to our path so we don't have to muck with PYTHONPATH
+sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util'))
+from llmanifest import LLManifest, main, proper_windows_path, path_ancestors
+
+class ViewerManifest(LLManifest):
+ def construct(self):
+ super(ViewerManifest, self).construct()
+ self.exclude("*.svn*")
+ self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg")
+ self.path(src="../../etc/message.xml", dst="app_settings/message.xml")
+
+ if self.prefix(src="app_settings"):
+ self.exclude("logcontrol.xml")
+ self.exclude("logcontrol-dev.xml")
+ self.path("*.pem")
+ self.path("*.ini")
+ self.path("*.xml")
+ self.path("*.db2")
+
+ # include the entire shaders directory recursively
+ self.path("shaders")
+ # ... and the entire windlight directory
+ self.path("windlight")
+ self.end_prefix("app_settings")
+
+ if self.prefix(src="character"):
+ self.path("*.llm")
+ self.path("*.xml")
+ self.path("*.tga")
+ self.end_prefix("character")
+
+ # Include our fonts
+ if self.prefix(src="fonts"):
+ self.path("*.ttf")
+ self.path("*.txt")
+ self.end_prefix("fonts")
+
+ # skins
+ if self.prefix(src="skins"):
+ self.path("paths.xml")
+ # include the entire textures directory recursively
+ if self.prefix(src="*/textures"):
+ self.path("*/*.tga")
+ self.path("*/*.j2c")
+ self.path("*/*.jpg")
+ self.path("*/*.png")
+ self.path("*.tga")
+ self.path("*.j2c")
+ self.path("*.jpg")
+ self.path("*.png")
+ self.path("textures.xml")
+ self.end_prefix("*/textures")
+ self.path("*/xui/*/*.xml")
+ self.path("*/xui/*/widgets/*.xml")
+ self.path("*/*.xml")
+
+ # Local HTML files (e.g. loading screen)
+ if self.prefix(src="*/html"):
+ self.path("*.png")
+ self.path("*/*/*.html")
+ self.path("*/*/*.gif")
+ self.end_prefix("*/html")
+ self.end_prefix("skins")
+
+ # Files in the newview/ directory
+ self.path("gpu_table.txt")
+
+ def login_channel(self):
+ """Channel reported for login and upgrade purposes ONLY;
+ used for A/B testing"""
+ # NOTE: Do not return the normal channel if login_channel
+ # is not specified, as some code may branch depending on
+ # whether or not this is present
+ return self.args.get('login_channel')
+
+ def grid(self):
+ return self.args['grid']
+ def channel(self):
+ return self.args['channel']
+ def channel_unique(self):
+ return self.channel().replace("Second Life", "").strip()
+ def channel_oneword(self):
+ return "".join(self.channel_unique().split())
+ def channel_lowerword(self):
+ return self.channel_oneword().lower()
+
+ def flags_list(self):
+ """ Convenience function that returns the command-line flags
+ for the grid"""
+
+ # Set command line flags relating to the target grid
+ grid_flags = ''
+ if not self.default_grid():
+ grid_flags = "--grid %(grid)s "\
+ "--helperuri http://preview-%(grid)s.secondlife.com/helpers/" %\
+ {'grid':self.grid()}
+
+ # set command line flags for channel
+ channel_flags = ''
+ if self.login_channel() and self.login_channel() != self.channel():
+ # Report a special channel during login, but use default
+ channel_flags = '--channel "%s"' % (self.login_channel())
+ elif not self.default_channel():
+ channel_flags = '--channel "%s"' % self.channel()
+
+ # Deal with settings
+ setting_flags = ''
+ if not self.default_channel() or not self.default_grid():
+ if self.default_grid():
+ setting_flags = '--settings settings_%s.xml'\
+ % self.channel_lowerword()
+ else:
+ setting_flags = '--settings settings_%s_%s.xml'\
+ % (self.grid(), self.channel_lowerword())
+
+ return " ".join((channel_flags, grid_flags, setting_flags)).strip()
+
+
+class WindowsManifest(ViewerManifest):
+ def final_exe(self):
+ if self.default_channel():
+ if self.default_grid():
+ return "SecondLife.exe"
+ else:
+ return "SecondLifePreview.exe"
+ else:
+ return ''.join(self.channel().split()) + '.exe'
+
+
+ def test_msvcrt_and_copy_action(self, src, dst):
+ # This can is used to test a dll manifest.
+ # It is used as a temporary override during the construct method
+ from test_win32_manifest import test_assembly_binding
+ if src and (os.path.exists(src) or os.path.islink(src)):
+ # ensure that destination path exists
+ self.cmakedirs(os.path.dirname(dst))
+ self.created_paths.append(dst)
+ if not os.path.isdir(src):
+ if(self.args['configuration'].lower() == 'debug'):
+ test_assembly_binding(src, "Microsoft.VC80.DebugCRT", "8.0.50727.4053")
+ else:
+ test_assembly_binding(src, "Microsoft.VC80.CRT", "8.0.50727.4053")
+ self.ccopy(src,dst)
+ else:
+ raise Exception("Directories are not supported by test_CRT_and_copy_action()")
+ else:
+ print "Doesn't exist:", src
+
+ def enable_crt_check(self):
+ WindowsManifest.copy_action = WindowsManifest.test_msvcrt_and_copy_action
+
+ def disable_crt_check(self):
+ del WindowsManifest.copy_action
+
+ def construct(self):
+ super(WindowsManifest, self).construct()
+ # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe.
+ self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe())
+
+ self.enable_crt_check()
+
+ # Plugin host application
+ self.path(os.path.join(os.pardir,
+ 'llplugin', 'slplugin', self.args['configuration'], "slplugin.exe"),
+ "slplugin.exe")
+
+ # need to get the llcommon.dll from the build directory as well
+ if self.prefix(src=self.args['configuration'], dst=""):
+ try:
+ self.path('llcommon.dll')
+ self.path('libapr-1.dll')
+ self.path('libaprutil-1.dll')
+ self.path('libapriconv-1.dll')
+ except RuntimeError:
+ print "Skipping llcommon.dll (assuming llcommon was linked statically)"
+ self.end_prefix()
+
+ # need to get the kdu dll from the build directory as well
+ try:
+ self.path('%s/llkdu.dll' % self.args['configuration'], dst='llkdu.dll')
+ except RuntimeError:
+ print "Skipping llkdu.dll"
+
+ self.disable_crt_check()
+
+ self.path(src="licenses-win32.txt", dst="licenses.txt")
+ self.path("featuretable.txt")
+
+ # For use in crash reporting (generates minidumps)
+ self.path("dbghelp.dll")
+
+ # For using FMOD for sound... DJS
+ self.path("fmod.dll")
+
+ self.enable_crt_check()
+
+ # For textures
+ if self.prefix(src=self.args['configuration'], dst=""):
+ if(self.args['configuration'].lower() == 'debug'):
+ self.path("openjpegd.dll")
+ else:
+ self.path("openjpeg.dll")
+ self.end_prefix()
+
+ # Media plugins - QuickTime
+ if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"):
+ self.path("media_plugin_quicktime.dll")
+ self.end_prefix()
+
+ # Media plugins - WebKit/Qt
+ if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
+ self.path("media_plugin_webkit.dll")
+ self.end_prefix()
+
+ if self.prefix(src="../../libraries/i686-win32/lib/release", dst="llplugin"):
+ self.path("libeay32.dll")
+ self.path("qtcore4.dll")
+ self.path("qtgui4.dll")
+ self.path("qtnetwork4.dll")
+ self.path("qtopengl4.dll")
+ self.path("qtwebkit4.dll")
+ self.path("ssleay32.dll")
+ self.end_prefix()
+
+ # For WebKit/Qt plugin runtimes (image format plugins)
+ if self.prefix(src="../../libraries/i686-win32/lib/release/imageformats", dst="llplugin/imageformats"):
+ self.path("qgif4.dll")
+ self.path("qico4.dll")
+ self.path("qjpeg4.dll")
+ self.path("qmng4.dll")
+ self.path("qsvg4.dll")
+ self.path("qtiff4.dll")
+ self.end_prefix()
+
+ self.disable_crt_check()
+
+ # These need to be installed as a SxS assembly, currently a 'private' assembly.
+ # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx
+ if self.prefix(src=self.args['configuration'], dst=""):
+ if self.args['configuration'] == 'Debug':
+ self.path("msvcr80d.dll")
+ self.path("msvcp80d.dll")
+ self.path("Microsoft.VC80.DebugCRT.manifest")
+ else:
+ self.path("msvcr80.dll")
+ self.path("msvcp80.dll")
+ self.path("Microsoft.VC80.CRT.manifest")
+ self.end_prefix()
+
+ # The config file name needs to match the exe's name.
+ self.path(src="%s/secondlife-bin.exe.config" % self.args['configuration'], dst=self.final_exe() + ".config")
+
+ # Vivox runtimes
+ if self.prefix(src=self.args['configuration'], dst=""):
+ self.path("SLVoice.exe")
+ self.path("alut.dll")
+ self.path("vivoxsdk.dll")
+ self.path("ortp.dll")
+ self.path("wrap_oal.dll")
+ self.end_prefix()
+
+ # pull in the crash logger and updater from other projects
+ # tag:"crash-logger" here as a cue to the exporter
+ self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'],
+ dst="win_crash_logger.exe")
+ self.path(src='../win_updater/%s/windows-updater.exe' % self.args['configuration'],
+ dst="updater.exe")
+
+ # For google-perftools tcmalloc allocator.
+ try:
+ self.path('%s/libtcmalloc_minimal.dll' % self.args['configuration'])
+ except:
+ print "Skipping libtcmalloc_minimal.dll"
+ pass
+
+ def nsi_file_commands(self, install=True):
+ def wpath(path):
+ if path.endswith('/') or path.endswith(os.path.sep):
+ path = path[:-1]
+ path = path.replace('/', '\\')
+ return path
+
+ result = ""
+ dest_files = [pair[1] for pair in self.file_list if pair[0] and os.path.isfile(pair[1])]
+ # sort deepest hierarchy first
+ dest_files.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
+ dest_files.reverse()
+ out_path = None
+ for pkg_file in dest_files:
+ rel_file = os.path.normpath(pkg_file.replace(self.get_dst_prefix()+os.path.sep,''))
+ installed_dir = wpath(os.path.join('$INSTDIR', os.path.dirname(rel_file)))
+ pkg_file = wpath(os.path.normpath(pkg_file))
+ if installed_dir != out_path:
+ if install:
+ out_path = installed_dir
+ result += 'SetOutPath ' + out_path + '\n'
+ if install:
+ result += 'File ' + pkg_file + '\n'
+ else:
+ result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n'
+ # at the end of a delete, just rmdir all the directories
+ if not install:
+ deleted_file_dirs = [os.path.dirname(pair[1].replace(self.get_dst_prefix()+os.path.sep,'')) for pair in self.file_list]
+ # find all ancestors so that we don't skip any dirs that happened to have no non-dir children
+ deleted_dirs = []
+ for d in deleted_file_dirs:
+ deleted_dirs.extend(path_ancestors(d))
+ # sort deepest hierarchy first
+ deleted_dirs.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
+ deleted_dirs.reverse()
+ prev = None
+ for d in deleted_dirs:
+ if d != prev: # skip duplicates
+ result += 'RMDir ' + wpath(os.path.join('$INSTDIR', os.path.normpath(d))) + '\n'
+ prev = d
+
+ return result
+
+ def package_finish(self):
+ # a standard map of strings for replacing in the templates
+ substitution_strings = {
+ 'version' : '.'.join(self.args['version']),
+ 'version_short' : '.'.join(self.args['version'][:-1]),
+ 'version_dashes' : '-'.join(self.args['version']),
+ 'final_exe' : self.final_exe(),
+ 'grid':self.args['grid'],
+ 'grid_caps':self.args['grid'].upper(),
+ # escape quotes becase NSIS doesn't handle them well
+ 'flags':self.flags_list().replace('"', '$\\"'),
+ 'channel':self.channel(),
+ 'channel_oneword':self.channel_oneword(),
+ 'channel_unique':self.channel_unique(),
+ }
+
+ version_vars = """
+ !define INSTEXE "%(final_exe)s"
+ !define VERSION "%(version_short)s"
+ !define VERSION_LONG "%(version)s"
+ !define VERSION_DASHES "%(version_dashes)s"
+ """ % substitution_strings
+ if self.default_channel():
+ if self.default_grid():
+ # release viewer
+ installer_file = "Second_Life_%(version_dashes)s_Setup.exe"
+ grid_vars_template = """
+ OutFile "%(installer_file)s"
+ !define INSTFLAGS "%(flags)s"
+ !define INSTNAME "SecondLife"
+ !define SHORTCUT "Second Life"
+ !define URLNAME "secondlife"
+ Caption "Second Life ${VERSION}"
+ """
+ else:
+ # beta grid viewer
+ installer_file = "Second_Life_%(version_dashes)s_(%(grid_caps)s)_Setup.exe"
+ grid_vars_template = """
+ OutFile "%(installer_file)s"
+ !define INSTFLAGS "%(flags)s"
+ !define INSTNAME "SecondLife%(grid_caps)s"
+ !define SHORTCUT "Second Life (%(grid_caps)s)"
+ !define URLNAME "secondlife%(grid)s"
+ !define UNINSTALL_SETTINGS 1
+ Caption "Second Life %(grid)s ${VERSION}"
+ """
+ else:
+ # some other channel on some grid
+ installer_file = "Second_Life_%(version_dashes)s_%(channel_oneword)s_Setup.exe"
+ grid_vars_template = """
+ OutFile "%(installer_file)s"
+ !define INSTFLAGS "%(flags)s"
+ !define INSTNAME "SecondLife%(channel_oneword)s"
+ !define SHORTCUT "%(channel)s"
+ !define URLNAME "secondlife"
+ !define UNINSTALL_SETTINGS 1
+ Caption "%(channel)s ${VERSION}"
+ """
+ if 'installer_name' in self.args:
+ installer_file = self.args['installer_name']
+ else:
+ installer_file = installer_file % substitution_strings
+ substitution_strings['installer_file'] = installer_file
+
+ tempfile = "secondlife_setup_tmp.nsi"
+ # the following replaces strings in the nsi template
+ # it also does python-style % substitution
+ self.replace_in("installers/windows/installer_template.nsi", tempfile, {
+ "%%VERSION%%":version_vars,
+ "%%SOURCE%%":self.get_src_prefix(),
+ "%%GRID_VARS%%":grid_vars_template % substitution_strings,
+ "%%INSTALL_FILES%%":self.nsi_file_commands(True),
+ "%%DELETE_FILES%%":self.nsi_file_commands(False)})
+
+ # We use the Unicode version of NSIS, available from
+ # http://www.scratchpaper.com/
+ # Check two paths, one for Program Files, and one for Program Files (x86).
+ # Yay 64bit windows.
+ NSIS_path = os.path.expandvars('${ProgramFiles}\\NSIS\\Unicode\\makensis.exe')
+ if not os.path.exists(NSIS_path):
+ NSIS_path = os.path.expandvars('${ProgramFiles(x86)}\\NSIS\\Unicode\\makensis.exe')
+ self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile))
+ # self.remove(self.dst_path_of(tempfile))
+ # If we're on a build machine, sign the code using our Authenticode certificate. JC
+ sign_py = os.path.expandvars("${SIGN}")
+ if not sign_py or sign_py == "${SIGN}":
+ sign_py = 'C:\\buildscripts\\code-signing\\sign.py'
+ else:
+ sign_py = sign_py.replace('\\', '\\\\\\\\')
+ python = os.path.expandvars("${PYTHON}")
+ if not python or python == "${PYTHON}":
+ python = 'python'
+ if os.path.exists(sign_py):
+ self.run_command("%s %s %s" % (python, sign_py, self.dst_path_of(installer_file).replace('\\', '\\\\\\\\')))
+ else:
+ print "Skipping code signing,", sign_py, "does not exist"
+ self.created_path(self.dst_path_of(installer_file))
+ self.package_file = installer_file
+
+
+class DarwinManifest(ViewerManifest):
+ def construct(self):
+ # copy over the build result (this is a no-op if run within the xcode script)
+ self.path(self.args['configuration'] + "/Second Life.app", dst="")
+
+ if self.prefix(src="", dst="Contents"): # everything goes in Contents
+ self.path("Info-SecondLife.plist", dst="Info.plist")
+
+ # copy additional libs in <bundle>/Contents/MacOS/
+ self.path("../../libraries/universal-darwin/lib_release/libndofdev.dylib", dst="MacOS/libndofdev.dylib")
+ self.path(os.path.join(os.pardir, "llplugin", "slplugin", self.args['configuration'],
+ "SLPlugin"),
+ os.path.join("MacOS", "SLPlugin"))
+
+ # most everything goes in the Resources directory
+ if self.prefix(src="", dst="Resources"):
+ super(DarwinManifest, self).construct()
+
+ if self.prefix("cursors_mac"):
+ self.path("*.tif")
+ self.end_prefix("cursors_mac")
+
+ self.path("licenses-mac.txt", dst="licenses.txt")
+ self.path("featuretable_mac.txt")
+ self.path("SecondLife.nib")
+
+ # If we are not using the default channel, use the 'Firstlook
+ # icon' to show that it isn't a stable release.
+ if self.default_channel() and self.default_grid():
+ self.path("secondlife.icns")
+ else:
+ self.path("secondlife_firstlook.icns", "secondlife.icns")
+ self.path("SecondLife.nib")
+
+ # Translations
+ self.path("English.lproj")
+ self.path("German.lproj")
+ self.path("Japanese.lproj")
+ self.path("Korean.lproj")
+ self.path("da.lproj")
+ self.path("es.lproj")
+ self.path("fr.lproj")
+ self.path("hu.lproj")
+ self.path("it.lproj")
+ self.path("nl.lproj")
+ self.path("pl.lproj")
+ self.path("pt.lproj")
+ self.path("ru.lproj")
+ self.path("tr.lproj")
+ self.path("uk.lproj")
+ self.path("zh-Hans.lproj")
+
+ # SLVoice and vivox lols
+ self.path("vivox-runtime/universal-darwin/libalut.dylib", "libalut.dylib")
+ self.path("vivox-runtime/universal-darwin/libopenal.dylib", "libopenal.dylib")
+ self.path("vivox-runtime/universal-darwin/libortp.dylib", "libortp.dylib")
+ self.path("vivox-runtime/universal-darwin/libvivoxsdk.dylib", "libvivoxsdk.dylib")
+ self.path("vivox-runtime/universal-darwin/SLVoice", "SLVoice")
+
+ libdir = "../../libraries/universal-darwin/lib_release"
+ dylibs = {}
+
+ # need to get the kdu dll from any of the build directories as well
+ for lib in "llkdu", "llcommon":
+ libfile = "lib%s.dylib" % lib
+ try:
+ self.path(self.find_existing_file(os.path.join(os.pardir,
+ lib,
+ self.args['configuration'],
+ libfile),
+ os.path.join(libdir, libfile)),
+ dst=libfile)
+ except RuntimeError:
+ print "Skipping %s" % libfile
+ dylibs[lib] = False
+ else:
+ dylibs[lib] = True
+
+ if dylibs["llcommon"]:
+ for libfile in ("libapr-1.0.3.7.dylib",
+ "libaprutil-1.0.3.8.dylib",
+ "libexpat.0.5.0.dylib"):
+ self.path(os.path.join(libdir, libfile), libfile)
+
+ #libfmodwrapper.dylib
+ self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib")
+
+ # our apps
+ self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
+ self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
+
+ # plugins
+ if self.prefix(src="", dst="llplugin"):
+ self.path("../media_plugins/quicktime/" + self.args['configuration'] + "/media_plugin_quicktime.dylib", "media_plugin_quicktime.dylib")
+ self.path("../media_plugins/webkit/" + self.args['configuration'] + "/media_plugin_webkit.dylib", "media_plugin_webkit.dylib")
+ self.path("../../libraries/universal-darwin/lib_release/libllqtwebkit.dylib", "libllqtwebkit.dylib")
+
+ self.end_prefix("llplugin")
+
+ # command line arguments for connecting to the proper grid
+ self.put_in_file(self.flags_list(), 'arguments.txt')
+
+ self.end_prefix("Resources")
+
+ self.end_prefix("Contents")
+
+ # NOTE: the -S argument to strip causes it to keep enough info for
+ # annotated backtraces (i.e. function names in the crash log). 'strip' with no
+ # arguments yields a slightly smaller binary but makes crash logs mostly useless.
+ # This may be desirable for the final release. Or not.
+ if ("package" in self.args['actions'] or
+ "unpacked" in self.args['actions']):
+ self.run_command('strip -S "%(viewer_binary)s"' %
+ { 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')})
+
+
+ def package_finish(self):
+ channel_standin = 'Second Life' # hah, our default channel is not usable on its own
+ if not self.default_channel():
+ channel_standin = self.channel()
+
+ imagename="SecondLife_" + '_'.join(self.args['version'])
+
+ # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning.
+ # If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick.
+
+ volname="Second Life Installer" # DO NOT CHANGE without understanding comment above
+
+ if self.default_channel():
+ if not self.default_grid():
+ # beta case
+ imagename = imagename + '_' + self.args['grid'].upper()
+ else:
+ # first look, etc
+ imagename = imagename + '_' + self.channel_oneword().upper()
+
+ sparsename = imagename + ".sparseimage"
+ finalname = imagename + ".dmg"
+ # make sure we don't have stale files laying about
+ self.remove(sparsename, finalname)
+
+ self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 400 -layout SPUD' % {
+ 'sparse':sparsename,
+ 'vol':volname})
+
+ # mount the image and get the name of the mount point and device node
+ hdi_output = self.run_command('hdiutil attach -private "' + sparsename + '"')
+ devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip()
+ volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip()
+
+ # Copy everything in to the mounted .dmg
+
+ if self.default_channel() and not self.default_grid():
+ app_name = "Second Life " + self.args['grid']
+ else:
+ app_name = channel_standin.strip()
+
+ # Hack:
+ # Because there is no easy way to coerce the Finder into positioning
+ # the app bundle in the same place with different app names, we are
+ # adding multiple .DS_Store files to svn. There is one for release,
+ # one for release candidate and one for first look. Any other channels
+ # will use the release .DS_Store, and will look broken.
+ # - Ambroff 2008-08-20
+ dmg_template = os.path.join(
+ 'installers',
+ 'darwin',
+ '%s-dmg' % "".join(self.channel_unique().split()).lower())
+
+ if not os.path.exists (self.src_path_of(dmg_template)):
+ dmg_template = os.path.join ('installers', 'darwin', 'release-dmg')
+
+ for s,d in {self.get_dst_prefix():app_name + ".app",
+ os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns",
+ os.path.join(dmg_template, "background.jpg"): "background.jpg",
+ os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items():
+ print "Copying to dmg", s, d
+ self.copy_action(self.src_path_of(s), os.path.join(volpath, d))
+
+ # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit)
+ self.run_command('SetFile -a V "' + os.path.join(volpath, ".VolumeIcon.icns") + '"')
+ self.run_command('SetFile -a V "' + os.path.join(volpath, "background.jpg") + '"')
+ self.run_command('SetFile -a V "' + os.path.join(volpath, ".DS_Store") + '"')
+
+ # Create the alias file (which is a resource file) from the .r
+ self.run_command('rez "' + self.src_path_of("installers/darwin/release-dmg/Applications-alias.r") + '" -o "' + os.path.join(volpath, "Applications") + '"')
+
+ # Set the alias file's alias and custom icon bits
+ self.run_command('SetFile -a AC "' + os.path.join(volpath, "Applications") + '"')
+
+ # Set the disk image root's custom icon bit
+ self.run_command('SetFile -a C "' + volpath + '"')
+
+ # Unmount the image
+ self.run_command('hdiutil detach -force "' + devfile + '"')
+
+ print "Converting temp disk image to final disk image"
+ self.run_command('hdiutil convert "%(sparse)s" -format UDZO -imagekey zlib-level=9 -o "%(final)s"' % {'sparse':sparsename, 'final':finalname})
+ # get rid of the temp file
+ self.package_file = finalname
+ self.remove(sparsename)
+
+class LinuxManifest(ViewerManifest):
+ def construct(self):
+ super(LinuxManifest, self).construct()
+ self.path("licenses-linux.txt","licenses.txt")
+ self.path("res/ll_icon.png","secondlife_icon.png")
+ if self.prefix("linux_tools", dst=""):
+ self.path("client-readme.txt","README-linux.txt")
+ self.path("client-readme-voice.txt","README-linux-voice.txt")
+ self.path("client-readme-joystick.txt","README-linux-joystick.txt")
+ self.path("wrapper.sh","secondlife")
+ self.path("handle_secondlifeprotocol.sh", "etc/handle_secondlifeprotocol.sh")
+ self.path("register_secondlifeprotocol.sh", "etc/register_secondlifeprotocol.sh")
+ self.path("refresh_desktop_app_entry.sh", "etc/refresh_desktop_app_entry.sh")
+ self.path("launch_url.sh","etc/launch_url.sh")
+ self.path("install.sh")
+ self.end_prefix("linux_tools")
+
+ # Create an appropriate gridargs.dat for this package, denoting required grid.
+ self.put_in_file(self.flags_list(), 'etc/gridargs.dat')
+
+
+ def package_finish(self):
+ if 'installer_name' in self.args:
+ installer_name = self.args['installer_name']
+ else:
+ installer_name_components = ['SecondLife_', self.args.get('arch')]
+ installer_name_components.extend(self.args['version'])
+ installer_name = "_".join(installer_name_components)
+ if self.default_channel():
+ if not self.default_grid():
+ installer_name += '_' + self.args['grid'].upper()
+ else:
+ installer_name += '_' + self.channel_oneword().upper()
+
+ # Fix access permissions
+ self.run_command("""
+ find %(dst)s -type d | xargs --no-run-if-empty chmod 755;
+ find %(dst)s -type f -perm 0700 | xargs --no-run-if-empty chmod 0755;
+ find %(dst)s -type f -perm 0500 | xargs --no-run-if-empty chmod 0555;
+ find %(dst)s -type f -perm 0600 | xargs --no-run-if-empty chmod 0644;
+ find %(dst)s -type f -perm 0400 | xargs --no-run-if-empty chmod 0444;
+ true""" % {'dst':self.get_dst_prefix() })
+ self.package_file = installer_name + '.tar.bz2'
+
+ # temporarily move directory tree so that it has the right
+ # name in the tarfile
+ self.run_command("mv %(dst)s %(inst)s" % {
+ 'dst': self.get_dst_prefix(),
+ 'inst': self.build_path_of(installer_name)})
+ try:
+ # --numeric-owner hides the username of the builder for
+ # security etc.
+ self.run_command('tar -C %(dir)s --numeric-owner -cjf '
+ '%(inst_path)s.tar.bz2 %(inst_name)s' % {
+ 'dir': self.get_build_prefix(),
+ 'inst_name': installer_name,
+ 'inst_path':self.build_path_of(installer_name)})
+ finally:
+ self.run_command("mv %(inst)s %(dst)s" % {
+ 'dst': self.get_dst_prefix(),
+ 'inst': self.build_path_of(installer_name)})
+
+class Linux_i686Manifest(LinuxManifest):
+ def construct(self):
+ super(Linux_i686Manifest, self).construct()
+
+ # install either the libllkdu we just built, or a prebuilt one, in
+ # decreasing order of preference. for linux package, this goes to bin/
+ for lib, destdir in ("llkdu", "bin"), ("llcommon", "lib"):
+ libfile = "lib%s.so" % lib
+ try:
+ self.path(self.find_existing_file(os.path.join(os.pardir, lib, libfile),
+ '../../libraries/i686-linux/lib_release_client/%s' % libfile),
+ dst=os.path.join(destdir, libfile))
+ # keep this one to preserve syntax, open source mangling removes previous lines
+ pass
+ except RuntimeError:
+ print "Skipping %s - not found" % libfile
+ pass
+
+ self.path("secondlife-stripped","bin/do-not-directly-run-secondlife-bin")
+ self.path("../linux_crash_logger/linux-crash-logger-stripped","bin/linux-crash-logger.bin")
+ self.path("../linux_updater/linux-updater-stripped", "bin/linux-updater.bin")
+ self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin")
+ if self.prefix("res-sdl"):
+ self.path("*")
+ # recurse
+ self.end_prefix("res-sdl")
+
+ # plugins
+ if self.prefix(src="", dst="bin/llplugin"):
+ self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
+ self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_quicktime.so")
+ self.end_prefix("bin/llplugin")
+
+ self.path("featuretable_linux.txt")
+ #self.path("secondlife-i686.supp")
+
+ if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
+ #self.path("libkdu_v42R.so", "libkdu.so")
+ self.path("libfmod-3.75.so")
+ self.path("libapr-1.so.0")
+ self.path("libaprutil-1.so.0")
+ self.path("libdb-4.2.so")
+ self.path("libcrypto.so.0.9.7")
+ self.path("libexpat.so.1")
+ self.path("libssl.so.0.9.7")
+ self.path("libuuid.so", "libuuid.so.1")
+ self.path("libSDL-1.2.so.0")
+ self.path("libELFIO.so")
+ self.path("libopenjpeg.so.1.3.0", "libopenjpeg.so.1.3")
+ self.path("libalut.so")
+ self.path("libopenal.so", "libopenal.so.1")
+ self.end_prefix("lib")
+
+ # Vivox runtimes
+ if self.prefix(src="vivox-runtime/i686-linux", dst="bin"):
+ self.path("SLVoice")
+ self.end_prefix()
+ if self.prefix(src="vivox-runtime/i686-linux", dst="lib"):
+ self.path("libortp.so")
+ self.path("libvivoxsdk.so")
+ self.end_prefix("lib")
+
+class Linux_x86_64Manifest(LinuxManifest):
+ def construct(self):
+ super(Linux_x86_64Manifest, self).construct()
+ self.path("secondlife-stripped","bin/do-not-directly-run-secondlife-bin")
+ self.path("../linux_crash_logger/linux-crash-logger-stripped","linux-crash-logger.bin")
+ if self.prefix("res-sdl"):
+ self.path("*")
+ # recurse
+ self.end_prefix("res-sdl")
+
+ self.path("featuretable_linux.txt")
+ self.path("secondlife-i686.supp")
+
+if __name__ == "__main__":
+ main()
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt
index 98ad8af02d..6a93537a38 100644
--- a/indra/test/CMakeLists.txt
+++ b/indra/test/CMakeLists.txt
@@ -13,7 +13,7 @@ include(LLXML)
include(LScript)
include(Linking)
include(Tut)
-include(Boost)
+
include(GoogleMock)
include_directories(
@@ -95,6 +95,7 @@ set(test_SOURCE_FILES
set(test_HEADER_FILES
CMakeLists.txt
+ debug.h
llpipeutil.h
llsdtraits.h
lltut.h
@@ -128,6 +129,7 @@ target_link_libraries(test
${LLXML_LIBRARIES}
${LSCRIPT_LIBRARIES}
${LLCOMMON_LIBRARIES}
+ ${EXPAT_LIBRARIES}
${GOOGLEMOCK_LIBRARIES}
${APRICONV_LIBRARIES}
${PTHREAD_LIBRARY}
@@ -148,22 +150,21 @@ endif (WINDOWS)
get_target_property(TEST_EXE test LOCATION)
-SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
-
-SET(TEST_LD_CMD
- ${CMAKE_COMMAND}
- -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
- -DTEST_CMD:STRING="${TEST_CMD}"
- -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
- )
+IF(WINDOWS)
+ set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+ELSE(WINDOWS)
+ set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib)
+ENDIF(WINDOWS)
-add_custom_command(
+LL_TEST_COMMAND("${LD_LIBRARY_PATH}"
+ "${TEST_EXE}" "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt")
+ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt
- COMMAND ${TEST_LD_CMD}
+ COMMAND ${LL_TEST_COMMAND_value}
DEPENDS test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "C++ unit tests"
- )
+ )
set(test_results ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt)
diff --git a/indra/test/debug.h b/indra/test/debug.h
new file mode 100644
index 0000000000..a00659d880
--- /dev/null
+++ b/indra/test/debug.h
@@ -0,0 +1,68 @@
+/**
+ * @file debug.h
+ * @author Nat Goodspeed
+ * @date 2009-05-28
+ * @brief Debug output for unit test code
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_DEBUG_H)
+#define LL_DEBUG_H
+
+#include <iostream>
+
+/*****************************************************************************
+* Debugging stuff
+*****************************************************************************/
+// This class is intended to illuminate entry to a given block, exit from the
+// same block and checkpoints along the way. It also provides a convenient
+// place to turn std::cout output on and off.
+class Debug
+{
+public:
+ Debug(const std::string& block):
+ mBlock(block)
+ {
+ (*this)("entry");
+ }
+
+ ~Debug()
+ {
+ (*this)("exit");
+ }
+
+ void operator()(const std::string& status)
+ {
+#if defined(DEBUG_ON)
+ std::cout << mBlock << ' ' << status << std::endl;
+#endif
+ }
+
+private:
+ const std::string mBlock;
+};
+
+// It's often convenient to use the name of the enclosing function as the name
+// of the Debug block.
+#define DEBUG Debug debug(__FUNCTION__)
+
+// These BEGIN/END macros are specifically for debugging output -- please
+// don't assume you must use such for coroutines in general! They only help to
+// make control flow (as well as exception exits) explicit.
+#define BEGIN \
+{ \
+ DEBUG; \
+ try
+
+#define END \
+ catch (...) \
+ { \
+ debug("*** exceptional "); \
+ throw; \
+ } \
+}
+
+#endif /* ! defined(LL_DEBUG_H) */
diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp
index e401f89b22..31130c3c79 100644
--- a/indra/test/llevents_tut.cpp
+++ b/indra/test/llevents_tut.cpp
@@ -32,96 +32,10 @@
// other Linden headers
#include "lltut.h"
#include "stringize.h"
+#include "tests/listener.h"
using boost::assign::list_of;
-/*****************************************************************************
-* test listener class
-*****************************************************************************/
-class Listener;
-std::ostream& operator<<(std::ostream&, const Listener&);
-
-class Listener
-{
-public:
- Listener(const std::string& name):
- mName(name)
- {
-// std::cout << *this << ": ctor\n";
- }
- Listener(const Listener& that):
- mName(that.mName),
- mLastEvent(that.mLastEvent)
- {
-// std::cout << *this << ": copy\n";
- }
- virtual ~Listener()
- {
-// std::cout << *this << ": dtor\n";
- }
- std::string getName() const { return mName; }
- bool call(const LLSD& event)
- {
-// std::cout << *this << "::call(" << event << ")\n";
- mLastEvent = event;
- return false;
- }
- bool callstop(const LLSD& event)
- {
-// std::cout << *this << "::callstop(" << event << ")\n";
- mLastEvent = event;
- return true;
- }
- LLSD getLastEvent() const
- {
-// std::cout << *this << "::getLastEvent() -> " << mLastEvent << "\n";
- return mLastEvent;
- }
- void reset(const LLSD& to = LLSD())
- {
-// std::cout << *this << "::reset(" << to << ")\n";
- mLastEvent = to;
- }
-
-private:
- std::string mName;
- LLSD mLastEvent;
-};
-
-std::ostream& operator<<(std::ostream& out, const Listener& listener)
-{
- out << "Listener(" << listener.getName() /* << "@" << &listener */ << ')';
- return out;
-}
-
-struct Collect
-{
- bool add(const std::string& bound, const LLSD& event)
- {
- result.push_back(bound);
- return false;
- }
- void clear() { result.clear(); }
- typedef std::vector<std::string> StringList;
- StringList result;
-};
-
-std::ostream& operator<<(std::ostream& out, const Collect::StringList& strings)
-{
- out << '(';
- Collect::StringList::const_iterator begin(strings.begin()), end(strings.end());
- if (begin != end)
- {
- out << '"' << *begin << '"';
- while (++begin != end)
- {
- out << ", \"" << *begin << '"';
- }
- }
- out << ')';
- return out;
-}
-
template<typename T>
T make(const T& value) { return value; }
@@ -174,14 +88,7 @@ namespace tut
// default combiner is defined to return the value returned by the
// last listener, which is meaningless if there were no listeners.
per_frame.post(0);
- // NOTE: boost::bind() saves its arguments by VALUE! If you pass an
- // object instance rather than a pointer, you'll end up binding to an
- // internal copy of that instance! Use boost::ref() to capture a
- // reference instead.
- LLBoundListener connection = per_frame.listen(listener0.getName(),
- boost::bind(&Listener::call,
- boost::ref(listener0),
- _1));
+ LLBoundListener connection = listener0.listenTo(per_frame);
ensure("connected", connection.connected());
ensure("not blocked", ! connection.blocked());
per_frame.post(1);
@@ -207,6 +114,10 @@ namespace tut
bool threw = false;
try
{
+ // NOTE: boost::bind() saves its arguments by VALUE! If you pass
+ // an object instance rather than a pointer, you'll end up binding
+ // to an internal copy of that instance! Use boost::ref() to
+ // capture a reference instead.
per_frame.listen(listener0.getName(), // note bug, dup name
boost::bind(&Listener::call, boost::ref(listener1), _1));
}
@@ -221,8 +132,7 @@ namespace tut
}
ensure("threw DupListenerName", threw);
// do it right this time
- per_frame.listen(listener1.getName(),
- boost::bind(&Listener::call, boost::ref(listener1), _1));
+ listener1.listenTo(per_frame);
per_frame.post(5);
check_listener("got", listener0, 5);
check_listener("got", listener1, 5);
@@ -252,16 +162,10 @@ namespace tut
LLEventPump& per_frame(pumps.obtain("per-frame"));
listener0.reset(0);
listener1.reset(0);
- LLBoundListener bound0 = per_frame.listen(listener0.getName(),
- boost::bind(&Listener::callstop,
- boost::ref(listener0),
- _1));
- LLBoundListener bound1 = per_frame.listen(listener1.getName(),
- boost::bind(&Listener::call,
- boost::ref(listener1),
- _1),
- // after listener0
- make<LLEventPump::NameList>(list_of(listener0.getName())));
+ LLBoundListener bound0 = listener0.listenTo(per_frame, &Listener::callstop);
+ LLBoundListener bound1 = listener1.listenTo(per_frame, &Listener::call,
+ // after listener0
+ make<LLEventPump::NameList>(list_of(listener0.getName())));
ensure("enabled", per_frame.enabled());
ensure("connected 0", bound0.connected());
ensure("unblocked 0", ! bound0.blocked());
@@ -301,7 +205,7 @@ namespace tut
// LLEventQueue.
LLEventPump& mainloop(pumps.obtain("mainloop"));
ensure("LLEventQueue leaf class", dynamic_cast<LLEventQueue*>(&login));
- login.listen(listener0.getName(), boost::bind(&Listener::call, boost::ref(listener0), _1));
+ listener0.listenTo(login);
listener0.reset(0);
login.post(1);
check_listener("waiting for queued event", listener0, 0);
@@ -354,11 +258,10 @@ namespace tut
{
set_test_name("stopListening()");
LLEventPump& login(pumps.obtain("login"));
- login.listen(listener0.getName(), boost::bind(&Listener::call, boost::ref(listener0), _1));
+ listener0.listenTo(login);
login.stopListening(listener0.getName());
// should not throw because stopListening() should have removed name
- login.listen(listener0.getName(),
- boost::bind(&Listener::callstop, boost::ref(listener0), _1));
+ listener0.listenTo(login, &Listener::callstop);
LLBoundListener wrong = login.getListener("bogus");
ensure("bogus connection disconnected", ! wrong.connected());
ensure("bogus connection blocked", wrong.blocked());
@@ -378,10 +281,8 @@ namespace tut
boost::bind(&LLEventPump::post, boost::ref(filter0), _1));
upstream.listen(filter1.getName(),
boost::bind(&LLEventPump::post, boost::ref(filter1), _1));
- filter0.listen(listener0.getName(),
- boost::bind(&Listener::call, boost::ref(listener0), _1));
- filter1.listen(listener1.getName(),
- boost::bind(&Listener::call, boost::ref(listener1), _1));
+ listener0.listenTo(filter0);
+ listener1.listenTo(filter1);
listener0.reset(0);
listener1.reset(0);
upstream.post(1);
@@ -536,7 +437,7 @@ namespace tut
// Passing a string LLEventPump name to LLListenerOrPumpName
listener0.reset(0);
LLEventStream random("random");
- random.listen(listener0.getName(), boost::bind(&Listener::call, boost::ref(listener0), _1));
+ listener0.listenTo(random);
eventSource("random");
check_listener("got by pump name", listener0, 17);
bool threw = false;
diff --git a/indra/test/llsdmessagebuilder_tut.cpp b/indra/test/llsdmessagebuilder_tut.cpp
index 34f3530308..ca15314e69 100755
--- a/indra/test/llsdmessagebuilder_tut.cpp
+++ b/indra/test/llsdmessagebuilder_tut.cpp
@@ -44,6 +44,8 @@
#include "v3dmath.h"
#include "v3math.h"
#include "v4math.h"
+#include "llsdutil.h"
+//#include "llsdutil.cpp"
#include "llsdutil_math.cpp"
#include "lltemplatemessagebuilder.h"
diff --git a/indra/test/llsdmessagereader_tut.cpp b/indra/test/llsdmessagereader_tut.cpp
index 36cfe5ebfc..f11e148cca 100755
--- a/indra/test/llsdmessagereader_tut.cpp
+++ b/indra/test/llsdmessagereader_tut.cpp
@@ -42,6 +42,7 @@
#include "message.h"
#include "llsdmessagereader.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
namespace tut
{
diff --git a/indra/test/llsdutil_tut.cpp b/indra/test/llsdutil_tut.cpp
index 0c4bbc2e62..d125bb0005 100644
--- a/indra/test/llsdutil_tut.cpp
+++ b/indra/test/llsdutil_tut.cpp
@@ -44,12 +44,42 @@
#include "v4math.h"
#include "llquaternion.h"
#include "llsdutil.h"
-
+#include "llsdutil_math.h"
+#include "stringize.h"
+#include <set>
+#include <boost/range.hpp>
namespace tut
{
struct llsdutil_data
{
+ void test_matches(const std::string& proto_key, const LLSD& possibles,
+ const char** begin, const char** end)
+ {
+ std::set<std::string> succeed(begin, end);
+ LLSD prototype(possibles[proto_key]);
+ for (LLSD::map_const_iterator pi(possibles.beginMap()), pend(possibles.endMap());
+ pi != pend; ++pi)
+ {
+ std::string match(llsd_matches(prototype, pi->second));
+ std::set<std::string>::const_iterator found = succeed.find(pi->first);
+ if (found != succeed.end())
+ {
+ // This test is supposed to succeed. Comparing to the
+ // empty string ensures that if the test fails, it will
+ // display the string received so we can tell what failed.
+ ensure_equals("match", match, "");
+ }
+ else
+ {
+ // This test is supposed to fail. If we get a false match,
+ // the string 'match' will be empty, which doesn't tell us
+ // much about which case went awry. So construct a more
+ // detailed description string.
+ ensure(proto_key + " shouldn't match " + pi->first, ! match.empty());
+ }
+ }
+ }
};
typedef test_group<llsdutil_data> llsdutil_test;;
typedef llsdutil_test::object llsdutil_object;
@@ -159,4 +189,207 @@ namespace tut
LLSD sd1 = ll_sd_from_color4(c1);
ensure_equals("sd -> LLColor4 -> sd", sd, sd1);
}
+
+ template<> template<>
+ void llsdutil_object::test<9>()
+ {
+ set_test_name("llsd_matches");
+
+ // for this test, construct a map of all possible LLSD types
+ LLSD map;
+ map.insert("empty", LLSD());
+ map.insert("Boolean", LLSD::Boolean());
+ map.insert("Integer", LLSD::Integer(0));
+ map.insert("Real", LLSD::Real(0.0));
+ map.insert("String", LLSD::String("bah"));
+ map.insert("NumString", LLSD::String("1"));
+ map.insert("UUID", LLSD::UUID());
+ map.insert("Date", LLSD::Date());
+ map.insert("URI", LLSD::URI());
+ map.insert("Binary", LLSD::Binary());
+ map.insert("Map", LLSD().insert("foo", LLSD()));
+ // Only an empty array can be constructed on the fly
+ LLSD array;
+ array.append(LLSD());
+ map.insert("Array", array);
+
+ // These iterators are declared outside our various for loops to avoid
+ // fatal MSVC warning: "I used to be broken, but I'm all better now!"
+ LLSD::map_const_iterator mi, mend(map.endMap());
+
+ /*-------------------------- llsd_matches --------------------------*/
+
+ // empty prototype matches anything
+ for (mi = map.beginMap(); mi != mend; ++mi)
+ {
+ ensure_equals(std::string("empty matches ") + mi->first, llsd_matches(LLSD(), mi->second), "");
+ }
+
+ LLSD proto_array, data_array;
+ for (int i = 0; i < 3; ++i)
+ {
+ proto_array.append(LLSD());
+ data_array.append(LLSD());
+ }
+
+ // prototype array matches only array
+ for (mi = map.beginMap(); mi != mend; ++mi)
+ {
+ ensure(std::string("array doesn't match ") + mi->first,
+ ! llsd_matches(proto_array, mi->second).empty());
+ }
+
+ // data array must be at least as long as prototype array
+ proto_array.append(LLSD());
+ ensure_equals("data array too short", llsd_matches(proto_array, data_array),
+ "Array size 4 required instead of Array size 3");
+ data_array.append(LLSD());
+ ensure_equals("data array just right", llsd_matches(proto_array, data_array), "");
+ data_array.append(LLSD());
+ ensure_equals("data array longer", llsd_matches(proto_array, data_array), "");
+
+ // array element matching
+ data_array[0] = LLSD::String();
+ ensure_equals("undefined prototype array entry", llsd_matches(proto_array, data_array), "");
+ proto_array[0] = LLSD::Binary();
+ ensure_equals("scalar prototype array entry", llsd_matches(proto_array, data_array),
+ "[0]: Binary required instead of String");
+ data_array[0] = LLSD::Binary();
+ ensure_equals("matching prototype array entry", llsd_matches(proto_array, data_array), "");
+
+ // build a coupla maps
+ LLSD proto_map, data_map;
+ data_map["got"] = LLSD();
+ data_map["found"] = LLSD();
+ for (LLSD::map_const_iterator dmi(data_map.beginMap()), dmend(data_map.endMap());
+ dmi != dmend; ++dmi)
+ {
+ proto_map[dmi->first] = dmi->second;
+ }
+ proto_map["foo"] = LLSD();
+ proto_map["bar"] = LLSD();
+
+ // prototype map matches only map
+ for (mi = map.beginMap(); mi != mend; ++mi)
+ {
+ ensure(std::string("map doesn't match ") + mi->first,
+ ! llsd_matches(proto_map, mi->second).empty());
+ }
+
+ // data map must contain all keys in prototype map
+ std::string error(llsd_matches(proto_map, data_map));
+ ensure_contains("missing keys", error, "missing keys");
+ ensure_contains("missing foo", error, "foo");
+ ensure_contains("missing bar", error, "bar");
+ ensure_does_not_contain("found found", error, "found");
+ ensure_does_not_contain("got got", error, "got");
+ data_map["bar"] = LLSD();
+ error = llsd_matches(proto_map, data_map);
+ ensure_contains("missing foo", error, "foo");
+ ensure_does_not_contain("got bar", error, "bar");
+ data_map["foo"] = LLSD();
+ ensure_equals("data map just right", llsd_matches(proto_map, data_map), "");
+ data_map["extra"] = LLSD();
+ ensure_equals("data map with extra", llsd_matches(proto_map, data_map), "");
+
+ // map element matching
+ data_map["foo"] = LLSD::String();
+ ensure_equals("undefined prototype map entry", llsd_matches(proto_map, data_map), "");
+ proto_map["foo"] = LLSD::Binary();
+ ensure_equals("scalar prototype map entry", llsd_matches(proto_map, data_map),
+ "['foo']: Binary required instead of String");
+ data_map["foo"] = LLSD::Binary();
+ ensure_equals("matching prototype map entry", llsd_matches(proto_map, data_map), "");
+
+ // String
+ {
+ static const char* matches[] = { "String", "NumString", "Boolean", "Integer",
+ "Real", "UUID", "Date", "URI" };
+ test_matches("String", map, boost::begin(matches), boost::end(matches));
+ }
+
+ // Boolean, Integer, Real
+ static const char* numerics[] = { "Boolean", "Integer", "Real" };
+ for (const char **ni = boost::begin(numerics), **nend = boost::end(numerics);
+ ni != nend; ++ni)
+ {
+ static const char* matches[] = { "Boolean", "Integer", "Real", "String", "NumString" };
+ test_matches(*ni, map, boost::begin(matches), boost::end(matches));
+ }
+
+ // UUID
+ {
+ static const char* matches[] = { "UUID", "String", "NumString" };
+ test_matches("UUID", map, boost::begin(matches), boost::end(matches));
+ }
+
+ // Date
+ {
+ static const char* matches[] = { "Date", "String", "NumString" };
+ test_matches("Date", map, boost::begin(matches), boost::end(matches));
+ }
+
+ // URI
+ {
+ static const char* matches[] = { "URI", "String", "NumString" };
+ test_matches("URI", map, boost::begin(matches), boost::end(matches));
+ }
+
+ // Binary
+ {
+ static const char* matches[] = { "Binary" };
+ test_matches("Binary", map, boost::begin(matches), boost::end(matches));
+ }
+
+ /*-------------------------- llsd_equals ---------------------------*/
+
+ // Cross-product of each LLSD type with every other
+ for (LLSD::map_const_iterator lmi(map.beginMap()), lmend(map.endMap());
+ lmi != lmend; ++lmi)
+ {
+ for (LLSD::map_const_iterator rmi(map.beginMap()), rmend(map.endMap());
+ rmi != rmend; ++rmi)
+ {
+ // Name this test based on the map keys naming the types of
+ // interest, e.g "String::Integer".
+ // We expect the values (xmi->second) to be equal if and only
+ // if the type names (xmi->first) are equal.
+ ensure(STRINGIZE(lmi->first << "::" << rmi->first),
+ bool(lmi->first == rmi->first) ==
+ bool(llsd_equals(lmi->second, rmi->second)));
+ }
+ }
+
+ // Array cases
+ LLSD rarray;
+ rarray.append(1.0);
+ rarray.append(2);
+ rarray.append("3");
+ LLSD larray(rarray);
+ ensure("llsd_equals(equal arrays)", llsd_equals(larray, rarray));
+ rarray[2] = "4";
+ ensure("llsd_equals(different [2])", ! llsd_equals(larray, rarray));
+ rarray = larray;
+ rarray.append(LLSD::Date());
+ ensure("llsd_equals(longer right array)", ! llsd_equals(larray, rarray));
+ rarray = larray;
+ rarray.erase(2);
+ ensure("llsd_equals(shorter right array)", ! llsd_equals(larray, rarray));
+
+ // Map cases
+ LLSD rmap;
+ rmap["San Francisco"] = 65;
+ rmap["Phoenix"] = 92;
+ rmap["Boston"] = 77;
+ LLSD lmap(rmap);
+ ensure("llsd_equals(equal maps)", llsd_equals(lmap, rmap));
+ rmap["Boston"] = 80;
+ ensure("llsd_equals(different [\"Boston\"])", ! llsd_equals(lmap, rmap));
+ rmap = lmap;
+ rmap["Atlanta"] = 95;
+ ensure("llsd_equals(superset right map)", ! llsd_equals(lmap, rmap));
+ rmap = lmap;
+ lmap["Seattle"] = 72;
+ ensure("llsd_equals(superset left map)", ! llsd_equals(lmap, rmap));
+ }
}
diff --git a/indra/test/lltut.cpp b/indra/test/lltut.cpp
index 201e174f9c..e4e0de1ff1 100644
--- a/indra/test/lltut.cpp
+++ b/indra/test/lltut.cpp
@@ -76,9 +76,13 @@ namespace tut
void ensure_equals(const char* m, const LLSD& actual,
const LLSD& expected)
+ {
+ ensure_equals(std::string(m), actual, expected);
+ }
+
+ void ensure_equals(const std::string& msg, const LLSD& actual,
+ const LLSD& expected)
{
- const std::string& msg = m ? m : "";
-
ensure_equals(msg + " type", actual.type(), expected.type());
switch (actual.type())
{
@@ -128,7 +132,7 @@ namespace tut
{
ensure_equals(msg + " map keys",
actual_iter->first, expected_iter->first);
- ensure_equals((msg + "[" + actual_iter->first + "]").c_str(),
+ ensure_equals(msg + "[" + actual_iter->first + "]",
actual_iter->second, expected_iter->second);
++actual_iter;
++expected_iter;
@@ -141,7 +145,7 @@ namespace tut
for(int i = 0; i < actual.size(); ++i)
{
- ensure_equals((msg + llformat("[%d]", i)).c_str(),
+ ensure_equals(msg + llformat("[%d]", i),
actual[i], expected[i]);
}
return;
diff --git a/indra/test/lltut.h b/indra/test/lltut.h
index 47ea9d3f9e..ba3791cbd4 100644
--- a/indra/test/lltut.h
+++ b/indra/test/lltut.h
@@ -121,6 +121,9 @@ namespace tut
void ensure_equals(const char* msg,
const LLSD& actual, const LLSD& expected);
+
+ void ensure_equals(const std::string& msg,
+ const LLSD& actual, const LLSD& expected);
void ensure_starts_with(const std::string& msg,
const std::string& actual, const std::string& expectedStart);
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index e7ba8e33b8..07e187ce45 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -69,13 +69,14 @@ namespace tut
class LLTestCallback : public tut::callback
{
public:
- LLTestCallback(bool verbose_mode, std::ostream *stream) :
+ LLTestCallback(bool verbose_mode, std::ostream *stream, bool wait) :
mVerboseMode(verbose_mode),
mTotalTests(0),
mPassedTests(0),
mFailedTests(0),
mSkippedTests(0),
- mStream(stream)
+ mStream(stream),
+ mWaitAtExit(wait)
{
}
@@ -142,6 +143,11 @@ public:
}
run_completed_(std::cout);
+ if(mWaitAtExit) {
+ std::cerr << "Waiting for input before exiting..." << std::endl;
+ std::cin.get();
+ }
+
if (mFailedTests > 0)
{
exit(1);
@@ -181,6 +187,7 @@ protected:
int mFailedTests;
int mSkippedTests;
std::ostream *mStream;
+ bool mWaitAtExit;
};
static const apr_getopt_option_t TEST_CL_OPTIONS[] =
@@ -338,7 +345,7 @@ int main(int argc, char **argv)
}
// run the tests
- LLTestCallback callback(verbose_mode, output);
+ LLTestCallback callback(verbose_mode, output, wait_at_exit);
tut::runner.get().set_callback(&callback);
if(test_group.empty())
@@ -349,12 +356,6 @@ int main(int argc, char **argv)
{
tut::runner.get().run_tests(test_group);
}
-
- if (wait_at_exit)
- {
- std::cerr << "Waiting for input before exiting..." << std::endl;
- std::cin.get();
- }
if (output)
{
diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt
index 789ead04fe..7164f86026 100644
--- a/indra/test_apps/llplugintest/CMakeLists.txt
+++ b/indra/test_apps/llplugintest/CMakeLists.txt
@@ -136,7 +136,7 @@ endif (DARWIN)
# ${media_simple_test_SOURCE_FILES}
#)
#
-#add_dependencies(media_simple_test copy_win_libs)
+#add_dependencies(media_simple_test stage_third_party_libs)
#
#set_target_properties(media_simple_test
# PROPERTIES
@@ -177,7 +177,7 @@ endif (DARWIN)
#)
#
#add_dependencies(media_plugin_test
-# copy_win_libs
+# stage_third_party_libs
# SLPlugin
# demo_media_plugin
# ${LLPLUGIN_LIBRARIES}
@@ -281,7 +281,7 @@ target_link_libraries(llmediaplugintest
)
add_dependencies(llmediaplugintest
- copy_win_libs
+ stage_third_party_libs
SLPlugin
media_plugin_quicktime
media_plugin_webkit
diff --git a/indra/viewer_components/CMakeLists.txt b/indra/viewer_components/CMakeLists.txt
new file mode 100644
index 0000000000..c95c854b7c
--- /dev/null
+++ b/indra/viewer_components/CMakeLists.txt
@@ -0,0 +1,5 @@
+# -*- cmake -*-
+
+add_subdirectory(login)
+add_subdirectory(eventhost)
+
diff --git a/indra/viewer_components/login/CMakeLists.txt b/indra/viewer_components/login/CMakeLists.txt
new file mode 100644
index 0000000000..fb65779eb7
--- /dev/null
+++ b/indra/viewer_components/login/CMakeLists.txt
@@ -0,0 +1,56 @@
+# -*- cmake -*-
+
+project(login)
+
+include(00-Common)
+include(LLAddBuildTest)
+include(LLCommon)
+include(LLMath)
+include(LLXML)
+include(Pth)
+
+include_directories(
+ ${LLCOMMON_INCLUDE_DIRS}
+ ${LLMATH_INCLUDE_DIRS}
+ ${LLXML_INCLUDE_DIRS}
+ ${PTH_INCLUDE_DIRS}
+ )
+
+set(login_SOURCE_FILES
+ lllogin.cpp
+ )
+
+set(login_HEADER_FILES
+ lllogin.h
+ )
+
+set_source_files_properties(${login_HEADER_FILES}
+ PROPERTIES HEADER_FILE_ONLY TRUE)
+
+list(APPEND
+ login_SOURCE_FILES
+ ${login_HEADER_FILES}
+ )
+
+add_library(lllogin
+ ${login_SOURCE_FILES}
+ )
+
+target_link_libraries(lllogin
+ ${LLCOMMON_LIBRARIES}
+ ${LLMATH_LIBRARIES}
+ ${LLXML_LIBRARIES}
+ ${PTH_LIBRARIES}
+ )
+
+SET(lllogin_TEST_SOURCE_FILES
+ lllogin.cpp
+ )
+
+set_source_files_properties(
+ lllogin.cpp
+ PROPERTIES
+ LL_TEST_ADDITIONAL_LIBRARIES "${PTH_LIBRARIES}"
+ )
+
+LL_ADD_PROJECT_UNIT_TESTS(lllogin "${lllogin_TEST_SOURCE_FILES}")
diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp
new file mode 100644
index 0000000000..c0d35f31d3
--- /dev/null
+++ b/indra/viewer_components/login/lllogin.cpp
@@ -0,0 +1,367 @@
+/**
+ * @file lllogin.cpp
+ *
+ * $LicenseInfo:firstyear=2009&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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 <boost/coroutine/coroutine.hpp>
+#include "linden_common.h"
+#include "llsd.h"
+#include "llsdutil.h"
+
+/*==========================================================================*|
+#ifdef LL_WINDOWS
+ // non-virtual destructor warning, boost::statechart does this intentionally.
+ #pragma warning (disable : 4265)
+#endif
+|*==========================================================================*/
+
+#include "lllogin.h"
+
+#include <boost/bind.hpp>
+
+#include "llcoros.h"
+#include "llevents.h"
+#include "lleventfilter.h"
+#include "lleventcoro.h"
+
+//*********************
+// LLLogin
+// *NOTE:Mani - Is this Impl needed now that the state machine runs the show?
+class LLLogin::Impl
+{
+public:
+ Impl():
+ mPump("login", true) // Create the module's event pump with a tweaked (unique) name.
+ {
+ mValidAuthResponse["status"] = LLSD();
+ mValidAuthResponse["errorcode"] = LLSD();
+ mValidAuthResponse["error"] = LLSD();
+ mValidAuthResponse["transfer_rate"] = LLSD();
+ }
+
+ void connect(const std::string& uri, const LLSD& credentials);
+ void disconnect();
+ LLEventPump& getEventPump() { return mPump; }
+
+private:
+ void sendProgressEvent(const std::string& desc, const LLSD& data = LLSD::emptyMap())
+ {
+ LLSD status_data;
+ status_data["state"] = desc;
+ status_data["progress"] = 0.0f;
+
+ if(mAuthResponse.has("transfer_rate"))
+ {
+ status_data["transfer_rate"] = mAuthResponse["transfer_rate"];
+ }
+
+ if(data.size() != 0)
+ {
+ status_data["data"] = data;
+ }
+
+ mPump.post(status_data);
+ }
+
+ LLSD validateResponse(const std::string& pumpName, const LLSD& response)
+ {
+ // Validate the response. If we don't recognize it, things
+ // could get ugly.
+ std::string mismatch(llsd_matches(mValidAuthResponse, response));
+ if (! mismatch.empty())
+ {
+ LL_ERRS("LLLogin") << "Received unrecognized event (" << mismatch << ") on "
+ << pumpName << "pump: " << response
+ << LL_ENDL;
+ return LLSD();
+ }
+
+ return response;
+ }
+
+ // In a coroutine's top-level function args, do NOT NOT NOT accept
+ // references (const or otherwise) to anything but the self argument! Pass
+ // by value only!
+ void login_(LLCoros::self& self, std::string uri, LLSD credentials);
+
+ LLEventStream mPump;
+ LLSD mAuthResponse, mValidAuthResponse;
+};
+
+void LLLogin::Impl::connect(const std::string& uri, const LLSD& credentials)
+{
+ // Launch a coroutine with our login_() method. Run the coroutine until
+ // its first wait; at that point, return here.
+ std::string coroname =
+ LLCoros::instance().launch("LLLogin::Impl::login_",
+ boost::bind(&Impl::login_, this, _1, uri, credentials));
+}
+
+void LLLogin::Impl::login_(LLCoros::self& self, std::string uri, LLSD credentials)
+{
+ LL_INFOS("LLLogin") << "Entering coroutine " << LLCoros::instance().getName(self)
+ << " with uri '" << uri << "', credentials " << credentials << LL_ENDL;
+ // Arriving in SRVRequest state
+ LLEventStream replyPump("reply", true);
+ // Should be an array of one or more uri strings.
+ LLSD rewrittenURIs;
+ {
+ LLEventTimeout filter(replyPump);
+ sendProgressEvent("srvrequest");
+
+ // Request SRV record.
+ LL_INFOS("LLLogin") << "Requesting SRV record from " << uri << LL_ENDL;
+
+ // *NOTE:Mani - Completely arbitrary timeout value for SRV request.
+ filter.errorAfter(5, "SRV Request timed out!");
+
+ // Make request
+ LLSD request;
+ request["op"] = "rewriteURI";
+ request["uri"] = uri;
+ request["reply"] = replyPump.getName();
+ rewrittenURIs = postAndWait(self, request, "LLAres", filter);
+ } // we no longer need the filter
+
+ LLEventPump& xmlrpcPump(LLEventPumps::instance().obtain("LLXMLRPCTransaction"));
+
+ // Loop through the rewrittenURIs, counting attempts along the way.
+ // Because of possible redirect responses, we may make more than one
+ // attempt per rewrittenURIs entry.
+ LLSD::Integer attempts = 0;
+ for (LLSD::array_const_iterator urit(rewrittenURIs.beginArray()),
+ urend(rewrittenURIs.endArray());
+ urit != urend; ++urit)
+ {
+ LLSD request(credentials);
+ request["reply"] = replyPump.getName();
+ request["uri"] = *urit;
+ std::string status;
+
+ // Loop back to here if login attempt redirects to a different
+ // request["uri"]
+ for (;;)
+ {
+ ++attempts;
+ LLSD progress_data;
+ progress_data["attempt"] = attempts;
+ progress_data["request"] = request;
+ sendProgressEvent("authenticating", progress_data);
+
+ // We expect zero or more "Downloading" status events, followed by
+ // exactly one event with some other status. Use postAndWait() the
+ // first time, because -- at least in unit-test land -- it's
+ // possible for the reply to arrive before the post() call
+ // returns. Subsequent responses, of course, must be awaited
+ // without posting again.
+ for (mAuthResponse = validateResponse(replyPump.getName(),
+ postAndWait(self, request, xmlrpcPump, replyPump, "reply"));
+ mAuthResponse["status"].asString() == "Downloading";
+ mAuthResponse = validateResponse(replyPump.getName(),
+ waitForEventOn(self, replyPump)))
+ {
+ // Still Downloading -- send progress update.
+ sendProgressEvent("downloading");
+ }
+ status = mAuthResponse["status"].asString();
+
+ // Okay, we've received our final status event for this
+ // request. Unless we got a redirect response, break the retry
+ // loop for the current rewrittenURIs entry.
+ if (! (status == "Complete" &&
+ mAuthResponse["responses"]["login"].asString() == "indeterminate"))
+ {
+ break;
+ }
+
+ // Here the login service at the current URI is redirecting us
+ // to some other URI ("indeterminate" -- why not "redirect"?).
+ // The response should contain another uri to try, with its
+ // own auth method.
+ request["uri"] = mAuthResponse["next_url"];
+ request["method"] = mAuthResponse["next_method"];
+ } // loop back to try the redirected URI
+
+ // Here we're done with redirects for the current rewrittenURIs
+ // entry.
+ if (status == "Complete")
+ {
+ // StatusComplete does not imply auth success. Check the
+ // actual outcome of the request. We've already handled the
+ // "indeterminate" case in the loop above.
+ sendProgressEvent((mAuthResponse["responses"]["login"].asString() == "true")?
+ "online" : "offline",
+ mAuthResponse["responses"]);
+ return; // Done!
+ }
+ // If we don't recognize status at all, trouble
+ if (! (status == "CURLError"
+ || status == "XMLRPCError"
+ || status == "OtherError"))
+ {
+ LL_ERRS("LLLogin") << "Unexpected status from " << xmlrpcPump.getName() << " pump: "
+ << mAuthResponse << LL_ENDL;
+ return;
+ }
+
+ // Here status IS one of the errors tested above.
+ } // Retry if there are any more rewrittenURIs.
+
+ // Here we got through all the rewrittenURIs without succeeding. Tell
+ // caller this didn't work out so well. Of course, the only failure data
+ // we can reasonably show are from the last of the rewrittenURIs.
+ sendProgressEvent("offline", mAuthResponse["responses"]);
+}
+
+void LLLogin::Impl::disconnect()
+{
+ sendProgressEvent("offline", mAuthResponse["responses"]);
+}
+
+//*********************
+// LLLogin
+LLLogin::LLLogin() :
+ mImpl(new LLLogin::Impl())
+{
+}
+
+LLLogin::~LLLogin()
+{
+}
+
+void LLLogin::connect(const std::string& uri, const LLSD& credentials)
+{
+ mImpl->connect(uri, credentials);
+}
+
+
+void LLLogin::disconnect()
+{
+ mImpl->disconnect();
+}
+
+LLEventPump& LLLogin::getEventPump()
+{
+ return mImpl->getEventPump();
+}
+
+// The following is the list of important functions that happen in the
+// current login process that we want to move to this login module.
+
+// The list associates to event with the original idle_startup() 'STATE'.
+
+// Rewrite URIs
+ // State_LOGIN_AUTH_INIT
+// Given a vector of login uris (usually just one), perform a dns lookup for the
+// SRV record from each URI. I think this is used to distribute login requests to
+// a single URI to multiple hosts.
+// This is currently a synchronous action. (See LLSRV::rewriteURI() implementation)
+// On dns lookup error the output uris == the input uris.
+//
+// Input: A vector of login uris
+// Output: A vector of login uris
+//
+// Code:
+// std::vector<std::string> uris;
+// LLViewerLogin::getInstance()->getLoginURIs(uris);
+// std::vector<std::string>::const_iterator iter, end;
+// for (iter = uris.begin(), end = uris.end(); iter != end; ++iter)
+// {
+// std::vector<std::string> rewritten;
+// rewritten = LLSRV::rewriteURI(*iter);
+// sAuthUris.insert(sAuthUris.end(),
+// rewritten.begin(), rewritten.end());
+// }
+// sAuthUriNum = 0;
+
+// Authenticate
+// STATE_LOGIN_AUTHENTICATE
+// Connect to the login server, presumably login.cgi, requesting the login
+// and a slew of related initial connection information.
+// This is an asynch action. The final response, whether success or error
+// is handled by STATE_LOGIN_PROCESS_REPONSE.
+// There is no immediate error or output from this call.
+//
+// Input:
+// URI
+// Credentials (first, last, password)
+// Start location
+// Bool Flags:
+// skip optional update
+// accept terms of service
+// accept critical message
+// Last exec event. (crash state of previous session)
+// requested optional data (inventory skel, initial outfit, etc.)
+// local mac address
+// viewer serial no. (md5 checksum?)
+
+//sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1);
+//LLUserAuth::getInstance()->authenticate(
+// sAuthUris[sAuthUriNum],
+// auth_method,
+// firstname,
+// lastname,
+// password, // web_login_key,
+// start.str(),
+// gSkipOptionalUpdate,
+// gAcceptTOS,
+// gAcceptCriticalMessage,
+// gLastExecEvent,
+// requested_options,
+// hashed_mac_string,
+// LLAppViewer::instance()->getSerialNumber());
+
+//
+// Download the Response
+// STATE_LOGIN_NO_REPONSE_YET and STATE_LOGIN_DOWNLOADING
+// I had assumed that this was default behavior of the message system. However...
+// During login, the message system is checked only by these two states in idle_startup().
+// I guess this avoids the overhead of checking network messages for those login states
+// that don't need to do so, but geez!
+// There are two states to do this one function just to update the login
+// status text from 'Logging In...' to 'Downloading...'
+//
+
+//
+// Handle Login Response
+// STATE_LOGIN_PROCESS_RESPONSE
+//
+// This state handle the result of the request to login. There is a metric ton of
+// code in this case. This state will transition to:
+// STATE_WORLD_INIT, on success.
+// STATE_AUTHENTICATE, on failure.
+// STATE_UPDATE_CHECK, to handle user during login interaction like TOS display.
+//
+// Much of the code in this case belongs on the viewer side of the fence and not in login.
+// Login should probably return with a couple of events, success and failure.
+// Failure conditions can be specified in the events data pacet to allow the viewer
+// to re-engauge login as is appropriate. (Or should there be multiple failure messages?)
+// Success is returned with the data requested from the login. According to OGP specs
+// there may be intermediate steps before reaching this result in future login
+// implementations.
diff --git a/indra/viewer_components/login/lllogin.h b/indra/viewer_components/login/lllogin.h
new file mode 100644
index 0000000000..0598b4e457
--- /dev/null
+++ b/indra/viewer_components/login/lllogin.h
@@ -0,0 +1,133 @@
+/**
+ * @file lllogin.h
+ *
+ * $LicenseInfo:firstyear=2009&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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$
+ */
+
+#ifndef LL_LLLOGIN_H
+#define LL_LLLOGIN_H
+
+#include <boost/scoped_ptr.hpp>
+
+class LLSD;
+class LLEventPump;
+
+/**
+ * @class LLLogin
+ * @brief Class to encapsulate the action and state of grid login.
+ */
+class LLLogin
+{
+public:
+ LLLogin();
+ ~LLLogin();
+
+ /**
+ * Make a connection to a grid.
+ * @param uri The 'well known and published' authentication URL.
+ * @param credentials LLSD data that contians the credentials.
+ * *NOTE:Mani The credential data can vary depending upon the authentication
+ * method used. The current interface matches the values passed to
+ * the XMLRPC login request.
+ {
+ method : string,
+ first : string,
+ last : string,
+ passwd : string,
+ start : string,
+ skipoptional : bool,
+ agree_to_tos : bool,
+ read_critical : bool,
+ last_exec_event : int,
+ version : string,
+ channel : string,
+ mac : string,
+ id0 : string,
+ options : [ strings ]
+ }
+
+ */
+ void connect(const std::string& uri, const LLSD& credentials);
+
+ /**
+ * Disconnect from a the current connection.
+ */
+ void disconnect();
+
+ /**
+ * Retrieve the event pump from this login class.
+ */
+ LLEventPump& getEventPump();
+
+ /*
+ Event API
+
+ LLLogin will issue multiple events to it pump to indicate the
+ progression of states through login. The most important
+ states are "offline" and "online" which indicate auth failure
+ and auth success respectively.
+
+ pump: login (tweaked)
+ These are the events posted to the 'login'
+ event pump from the login module.
+ {
+ state : string, // See below for the list of states.
+ progress : real // for progress bar.
+ data : LLSD // Dependent upon state.
+ }
+
+ States for method 'login_to_simulator'
+ offline - set initially state and upon failure. data is the server response.
+ srvrequest - upon uri rewrite request. no data.
+ authenticating - upon auth request. data, 'attempt' number and 'request' llsd.
+ downloading - upon ack from auth server, before completion. no data
+ online - upon auth success. data is server response.
+
+
+ Dependencies:
+ pump: LLAres
+ LLLogin makes a request for a SRV record from the uri provided by the connect method.
+ The following event pump should exist to service that request.
+ pump name: LLAres
+ request = {
+ op : "rewriteURI"
+ uri : string
+ reply : string
+
+ pump: LLXMLRPCListener
+ The request merely passes the credentials LLSD along, with one additional
+ member, 'reply', which is the string name of the event pump to reply on.
+
+ */
+
+private:
+ class Impl;
+ boost::scoped_ptr<Impl> mImpl;
+};
+
+#endif // LL_LLLOGIN_H
diff --git a/indra/viewer_components/login/tests/lllogin_test.cpp b/indra/viewer_components/login/tests/lllogin_test.cpp
new file mode 100644
index 0000000000..e43065d49f
--- /dev/null
+++ b/indra/viewer_components/login/tests/lllogin_test.cpp
@@ -0,0 +1,417 @@
+/**
+ * @file lllogin_test.cpp
+ * @author Mark Palange
+ * @date 2009-02-26
+ * @brief Tests of lllogin.cpp.
+ *
+ * $LicenseInfo:firstyear=2009&license=internal$
+ * Copyright (c) 2009, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if LL_WINDOWS
+#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
+#endif
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "../lllogin.h"
+// STL headers
+// std headers
+#include <iostream>
+// external library headers
+// other Linden headers
+#include "llsd.h"
+#include "../../../test/lltut.h"
+//#define DEBUG_ON
+#include "../../../test/debug.h"
+#include "llevents.h"
+#include "stringize.h"
+
+/*****************************************************************************
+* Helper classes
+*****************************************************************************/
+// This is a listener to receive results from lllogin.
+class LoginListener: public LLEventTrackable
+{
+ std::string mName;
+ LLSD mLastEvent;
+ Debug mDebug;
+public:
+ LoginListener(const std::string& name) :
+ mName(name),
+ mDebug(stringize(*this))
+ {}
+
+ bool call(const LLSD& event)
+ {
+ mDebug(STRINGIZE("LoginListener called!: " << event));
+ mLastEvent = event;
+ return false;
+ }
+
+ LLBoundListener listenTo(LLEventPump& pump)
+ {
+ return pump.listen(mName, boost::bind(&LoginListener::call, this, _1));
+ }
+
+ LLSD lastEvent() { return mLastEvent; }
+
+ friend std::ostream& operator<<(std::ostream& out, const LoginListener& listener)
+ {
+ return out << "LoginListener(" << listener.mName << ')';
+ }
+};
+
+class LLAresListener: public LLEventTrackable
+{
+ std::string mName;
+ LLSD mEvent;
+ bool mImmediateResponse;
+ bool mMultipleURIResponse;
+ Debug mDebug;
+
+public:
+ LLAresListener(const std::string& name,
+ bool i = false,
+ bool m = false
+ ) :
+ mName(name),
+ mImmediateResponse(i),
+ mMultipleURIResponse(m),
+ mDebug(stringize(*this))
+ {}
+
+ bool handle_event(const LLSD& event)
+ {
+ mDebug(STRINGIZE("LLAresListener called!: " << event));
+ mEvent = event;
+ if(mImmediateResponse)
+ {
+ sendReply();
+ }
+ return false;
+ }
+
+ void sendReply()
+ {
+ if(mEvent["op"].asString() == "rewriteURI")
+ {
+ LLSD result;
+ if(mMultipleURIResponse)
+ {
+ result.append(LLSD("login.foo.com"));
+ }
+ result.append(mEvent["uri"]);
+ LLEventPumps::instance().obtain(mEvent["reply"]).post(result);
+ }
+ }
+
+ LLBoundListener listenTo(LLEventPump& pump)
+ {
+ return pump.listen(mName, boost::bind(&LLAresListener::handle_event, this, _1));
+ }
+
+ friend std::ostream& operator<<(std::ostream& out, const LLAresListener& listener)
+ {
+ return out << "LLAresListener(" << listener.mName << ')';
+ }
+};
+
+class LLXMLRPCListener: public LLEventTrackable
+{
+ std::string mName;
+ LLSD mEvent;
+ bool mImmediateResponse;
+ LLSD mResponse;
+ Debug mDebug;
+
+public:
+ LLXMLRPCListener(const std::string& name,
+ bool i = false,
+ const LLSD& response = LLSD()
+ ) :
+ mName(name),
+ mImmediateResponse(i),
+ mResponse(response),
+ mDebug(stringize(*this))
+ {
+ if(mResponse.isUndefined())
+ {
+ mResponse["status"] = "Complete"; // StatusComplete
+ mResponse["errorcode"] = 0;
+ mResponse["error"] = "dummy response";
+ mResponse["transfer_rate"] = 0;
+ mResponse["responses"]["login"] = true;
+ }
+ }
+
+ void setResponse(const LLSD& r)
+ {
+ mResponse = r;
+ }
+
+ bool handle_event(const LLSD& event)
+ {
+ mDebug(STRINGIZE("LLXMLRPCListener called!: " << event));
+ mEvent = event;
+ if(mImmediateResponse)
+ {
+ sendReply();
+ }
+ return false;
+ }
+
+ void sendReply()
+ {
+ LLEventPumps::instance().obtain(mEvent["reply"]).post(mResponse);
+ }
+
+ LLBoundListener listenTo(LLEventPump& pump)
+ {
+ return pump.listen(mName, boost::bind(&LLXMLRPCListener::handle_event, this, _1));
+ }
+
+ friend std::ostream& operator<<(std::ostream& out, const LLXMLRPCListener& listener)
+ {
+ return out << "LLXMLRPCListener(" << listener.mName << ')';
+ }
+};
+
+/*****************************************************************************
+* TUT
+*****************************************************************************/
+namespace tut
+{
+ struct llviewerlogin_data
+ {
+ llviewerlogin_data() :
+ pumps(LLEventPumps::instance())
+ {}
+ LLEventPumps& pumps;
+ };
+
+ typedef test_group<llviewerlogin_data> llviewerlogin_group;
+ typedef llviewerlogin_group::object llviewerlogin_object;
+ llviewerlogin_group llviewerlogingrp("llviewerlogin");
+
+ template<> template<>
+ void llviewerlogin_object::test<1>()
+ {
+ DEBUG;
+ // Testing login with immediate repsonses from Ares and XMLPRC
+ // The response from both requests will come before the post request exits.
+ // This tests an edge case of the login state handling.
+ LLEventStream llaresPump("LLAres"); // Dummy LLAres pump.
+ LLEventStream xmlrpcPump("LLXMLRPCTransaction"); // Dummy XMLRPC pump
+
+ bool respond_immediately = true;
+ // Have 'dummy ares' repsond immediately.
+ LLAresListener dummyLLAres("dummy_llares", respond_immediately);
+ dummyLLAres.listenTo(llaresPump);
+
+ // Have dummy XMLRPC respond immediately.
+ LLXMLRPCListener dummyXMLRPC("dummy_xmlrpc", respond_immediately);
+ dummyXMLRPC.listenTo(xmlrpcPump);
+
+ LLLogin login;
+
+ LoginListener listener("test_ear");
+ listener.listenTo(login.getEventPump());
+
+ LLSD credentials;
+ credentials["first"] = "foo";
+ credentials["last"] = "bar";
+ credentials["passwd"] = "secret";
+
+ login.connect("login.bar.com", credentials);
+
+ ensure_equals("Online state", listener.lastEvent()["state"].asString(), "online");
+ }
+
+ template<> template<>
+ void llviewerlogin_object::test<2>()
+ {
+ DEBUG;
+ // Tests a successful login in with delayed responses.
+ // Also includes 'failure' that cause the login module
+ // To re-attempt connection, once from a basic failure
+ // and once from the 'indeterminate' response.
+
+ set_test_name("LLLogin multiple srv uris w/ success");
+
+ // Testing normal login procedure.
+ LLEventStream llaresPump("LLAres"); // Dummy LLAres pump.
+ LLEventStream xmlrpcPump("LLXMLRPCTransaction"); // Dummy XMLRPC pump
+
+ bool respond_immediately = false;
+ bool multiple_addresses = true;
+ LLAresListener dummyLLAres("dummy_llares", respond_immediately, multiple_addresses);
+ dummyLLAres.listenTo(llaresPump);
+
+ LLXMLRPCListener dummyXMLRPC("dummy_xmlrpc");
+ dummyXMLRPC.listenTo(xmlrpcPump);
+
+ LLLogin login;
+
+ LoginListener listener("test_ear");
+ listener.listenTo(login.getEventPump());
+
+ LLSD credentials;
+ credentials["first"] = "foo";
+ credentials["last"] = "bar";
+ credentials["passwd"] = "secret";
+
+ login.connect("login.bar.com", credentials);
+
+ ensure_equals("SRV state", listener.lastEvent()["state"].asString(), "srvrequest");
+
+ dummyLLAres.sendReply();
+
+ // Test Authenticating State prior to first response.
+ ensure_equals("Auth state 1", listener.lastEvent()["state"].asString(), "authenticating");
+ ensure_equals("Attempt 1", listener.lastEvent()["data"]["attempt"].asInteger(), 1);
+ ensure_equals("URI 1", listener.lastEvent()["data"]["request"]["uri"].asString(), "login.foo.com");
+
+ // First send emulated LLXMLRPCListener failure,
+ // this should return login to the authenticating step and increase the attempt
+ // count.
+ LLSD data;
+ data["status"] = "OtherError";
+ data["errorcode"] = 0;
+ data["error"] = "dummy response";
+ data["transfer_rate"] = 0;
+ dummyXMLRPC.setResponse(data);
+ dummyXMLRPC.sendReply();
+
+ ensure_equals("Fail back to authenticate 1", listener.lastEvent()["state"].asString(), "authenticating");
+ ensure_equals("Attempt 2", listener.lastEvent()["data"]["attempt"].asInteger(), 2);
+ ensure_equals("URI 2", listener.lastEvent()["data"]["request"]["uri"].asString(), "login.bar.com");
+
+ // Now send the 'indeterminate' response.
+ data.clear();
+ data["status"] = "Complete"; // StatusComplete
+ data["errorcode"] = 0;
+ data["error"] = "dummy response";
+ data["transfer_rate"] = 0;
+ data["responses"]["login"] = "indeterminate";
+ data["next_url"] = "login.indeterminate.com";
+ data["next_method"] = "test_login_method";
+ dummyXMLRPC.setResponse(data);
+ dummyXMLRPC.sendReply();
+
+ ensure_equals("Fail back to authenticate 2", listener.lastEvent()["state"].asString(), "authenticating");
+ ensure_equals("Attempt 3", listener.lastEvent()["data"]["attempt"].asInteger(), 3);
+ ensure_equals("URI 3", listener.lastEvent()["data"]["request"]["uri"].asString(), "login.indeterminate.com");
+
+ // Finally let the auth succeed.
+ data.clear();
+ data["status"] = "Complete"; // StatusComplete
+ data["errorcode"] = 0;
+ data["error"] = "dummy response";
+ data["transfer_rate"] = 0;
+ data["responses"]["login"] = "true";
+ dummyXMLRPC.setResponse(data);
+ dummyXMLRPC.sendReply();
+
+ ensure_equals("Success state", listener.lastEvent()["state"].asString(), "online");
+
+ login.disconnect();
+
+ ensure_equals("Disconnected state", listener.lastEvent()["state"].asString(), "offline");
+ }
+
+ template<> template<>
+ void llviewerlogin_object::test<3>()
+ {
+ DEBUG;
+ // Test completed response, that fails to login.
+ set_test_name("LLLogin valid response, failure (eg. bad credentials)");
+
+ // Testing normal login procedure.
+ LLEventStream llaresPump("LLAres"); // Dummy LLAres pump.
+ LLEventStream xmlrpcPump("LLXMLRPCTransaction"); // Dummy XMLRPC pump
+
+ LLAresListener dummyLLAres("dummy_llares");
+ dummyLLAres.listenTo(llaresPump);
+
+ LLXMLRPCListener dummyXMLRPC("dummy_xmlrpc");
+ dummyXMLRPC.listenTo(xmlrpcPump);
+
+ LLLogin login;
+ LoginListener listener("test_ear");
+ listener.listenTo(login.getEventPump());
+
+ LLSD credentials;
+ credentials["first"] = "who";
+ credentials["last"] = "what";
+ credentials["passwd"] = "badpasswd";
+
+ login.connect("login.bar.com", credentials);
+
+ ensure_equals("SRV state", listener.lastEvent()["state"].asString(), "srvrequest");
+
+ dummyLLAres.sendReply();
+
+ ensure_equals("Auth state", listener.lastEvent()["state"].asString(), "authenticating");
+
+ // Send the failed auth request reponse
+ LLSD data;
+ data["status"] = "Complete";
+ data["errorcode"] = 0;
+ data["error"] = "dummy response";
+ data["transfer_rate"] = 0;
+ data["responses"]["login"] = "false";
+ dummyXMLRPC.setResponse(data);
+ dummyXMLRPC.sendReply();
+
+ ensure_equals("Failed to offline", listener.lastEvent()["state"].asString(), "offline");
+ }
+
+ template<> template<>
+ void llviewerlogin_object::test<4>()
+ {
+ DEBUG;
+ // Test incomplete response, that end the attempt.
+ set_test_name("LLLogin valid response, failure (eg. bad credentials)");
+
+ // Testing normal login procedure.
+ LLEventStream llaresPump("LLAres"); // Dummy LLAres pump.
+ LLEventStream xmlrpcPump("LLXMLRPCTransaction"); // Dummy XMLRPC pump
+
+ LLAresListener dummyLLAres("dummy_llares");
+ dummyLLAres.listenTo(llaresPump);
+
+ LLXMLRPCListener dummyXMLRPC("dummy_xmlrpc");
+ dummyXMLRPC.listenTo(xmlrpcPump);
+
+ LLLogin login;
+ LoginListener listener("test_ear");
+ listener.listenTo(login.getEventPump());
+
+ LLSD credentials;
+ credentials["first"] = "these";
+ credentials["last"] = "don't";
+ credentials["passwd"] = "matter";
+
+ login.connect("login.bar.com", credentials);
+
+ ensure_equals("SRV state", listener.lastEvent()["state"].asString(), "srvrequest");
+
+ dummyLLAres.sendReply();
+
+ ensure_equals("Auth state", listener.lastEvent()["state"].asString(), "authenticating");
+
+ // Send the failed auth request reponse
+ LLSD data;
+ data["status"] = "OtherError";
+ data["errorcode"] = 0;
+ data["error"] = "dummy response";
+ data["transfer_rate"] = 0;
+ dummyXMLRPC.setResponse(data);
+ dummyXMLRPC.sendReply();
+
+ ensure_equals("Failed to offline", listener.lastEvent()["state"].asString(), "offline");
+ }
+}
diff --git a/install.xml b/install.xml
index 9b5ad22948..4a7d266d30 100644
--- a/install.xml
+++ b/install.xml
@@ -85,9 +85,9 @@
<key>darwin</key>
<map>
<key>md5sum</key>
- <string>abd07d760cdc7d23da3b861f34b09c92</string>
+ <string>115d8ac44a91efdb173e9b3e478c46b6</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/apr_suite-1.2.8-darwin-20080812.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/apr_suite-1.3.7-darwin-20090805.tar.bz2</uri>
</map>
<key>linux</key>
<map>
@@ -106,9 +106,9 @@
<key>windows</key>
<map>
<key>md5sum</key>
- <string>b9d23a69a25fdeed96dcc3bf696b6514</string>
+ <string>abb339b5147f90e20b6090ee235d77a6</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/apr_suite-1.2.12-windows-20080806.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/apr_suite-1.2.12-windows-20090702.tar.bz2</uri>
</map>
</map>
</map>
@@ -207,30 +207,30 @@
<key>darwin</key>
<map>
<key>md5sum</key>
- <string>6be5bca5f4b031b1b79824da5cfd4ddf</string>
+ <string>74f3a765644927c93fa3bc7acc730552</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-darwin-20090702a.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-darwin-20090805.tar.bz2</uri>
</map>
<key>linux</key>
<map>
<key>md5sum</key>
- <string>113ca35011c916660a8aa55bc1ca462a</string>
+ <string>8fb4151b883b5f5d2b12da19a6ff8e7d</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-linux-20090702.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-linux-20090804.tar.bz2</uri>
</map>
<key>linux64</key>
<map>
<key>md5sum</key>
- <string>270f64d3aa416cec96f445d58dfcfb6d</string>
+ <string>77237f33b1740daef0dc1e6c801f68e1</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-linux64-20090702.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-linux64-20090804.tar.bz2</uri>
</map>
<key>windows</key>
<map>
<key>md5sum</key>
- <string>44d4fdf386742b94419c93ad2baa1616</string>
+ <string>76a436d78f34286a7d13faca5f522f6b</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-windows-20090702.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.34.1-windows-20090803.tar.bz2</uri>
</map>
</map>
</map>
@@ -340,9 +340,9 @@
<key>darwin</key>
<map>
<key>md5sum</key>
- <string>9c5603e328e9f543e0a599d6b25be973</string>
+ <string>c457a0a041ac4946265889a503d26c3d</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/expat-1.95.8-darwin-20080812.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/expat-1.95.8-darwin-20090805.tar.bz2</uri>
</map>
<key>linux</key>
<map>
@@ -1233,6 +1233,53 @@ anguage Infrstructure (CLI) international standard</string>
</map>
</map>
</map>
+ <key>pth</key>
+ <map>
+ <key>copyright</key>
+ <string>Copyright (c) 1999-2006 Ralf S. Engelschall &lt;rse@gnu.org&gt;</string>
+ <key>description</key>
+ <string>Portable cooperative threads package, used to support Boost.Coroutine on Mac OS X 10.4</string>
+ <key>license</key>
+ <string>lgpl</string>
+ <key>packages</key>
+ <map>
+ <key>darwin</key>
+ <map>
+ <key>md5sum</key>
+ <string>533f4c710a209a6c4f205f81ccc0cfce</string>
+ <key>url</key>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/pth-2.0.7-darwin-20090427.tar.bz2</uri>
+ </map>
+ <key>linux</key>
+ <map>
+ <key>md5sum</key>
+ <string>c5c2f73847c126e679d925beab48c7d4</string>
+ <key>url</key>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/pth-2.0.7-linux-20090427.tar.bz2</uri>
+ </map>
+ <key>linux32</key>
+ <map>
+ <key>md5sum</key>
+ <string>c5c2f73847c126e679d925beab48c7d4</string>
+ <key>url</key>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/pth-2.0.7-linux32-20090427.tar.bz2</uri>
+ </map>
+ <key>linux64</key>
+ <map>
+ <key>md5sum</key>
+ <string>c5c2f73847c126e679d925beab48c7d4</string>
+ <key>url</key>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/pth-2.0.7-linux64-20090427.tar.bz2</uri>
+ </map>
+ <key>windows</key>
+ <map>
+ <key>md5sum</key>
+ <string>c5c2f73847c126e679d925beab48c7d4</string>
+ <key>url</key>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/pth-2.0.7-windows-20090427.tar.bz2</uri>
+ </map>
+ </map>
+ </map>
<key>quicktime</key>
<map>
<key>copyright</key>
@@ -1388,9 +1435,9 @@ anguage Infrstructure (CLI) international standard</string>
<key>windows</key>
<map>
<key>md5sum</key>
- <string>789988ea1fd8615137f843fbbe5b6bfa</string>
+ <string>af723ab6a9b0222613b2de060bcec98c</string>
<key>url</key>
- <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc-epi-0.51-windows-20080723.tar.bz2</uri>
+ <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc-epi-0.51-windows-20090727.tar.bz2</uri>
</map>
</map>
</map>