diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/lib/python/uuid.py | 477 | ||||
| -rw-r--r-- | indra/llimagej2coj/llimagej2coj.cpp | 11 | ||||
| -rw-r--r-- | indra/llui/llresmgr.cpp | 4 | ||||
| -rw-r--r-- | indra/llvfs/lldir_mac.cpp | 2 | ||||
| -rw-r--r-- | indra/llvfs/lldir_mac.h | 2 | ||||
| -rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llface.cpp | 32 | ||||
| -rw-r--r-- | indra/newview/llfilepicker.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 14 | ||||
| -rw-r--r-- | indra/newview/llfloaterland.cpp | 42 | ||||
| -rw-r--r-- | indra/newview/llfloaterland.h | 19 | ||||
| -rw-r--r-- | indra/newview/llfloatermap.cpp | 44 | ||||
| -rw-r--r-- | indra/newview/llfloatermap.h | 1 | ||||
| -rw-r--r-- | indra/newview/llpanellogin.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llpreviewanim.cpp | 24 | ||||
| -rw-r--r-- | indra/newview/llstartup.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llviewercontrol.h | 2 | ||||
| -rw-r--r-- | indra/newview/llviewerdisplay.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 17 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 8 | 
20 files changed, 613 insertions, 108 deletions
| diff --git a/indra/lib/python/uuid.py b/indra/lib/python/uuid.py new file mode 100644 index 0000000000..75d189ff7e --- /dev/null +++ b/indra/lib/python/uuid.py @@ -0,0 +1,477 @@ +r"""UUID objects (universally unique identifiers) according to RFC 4122. + +This module provides immutable UUID objects (class UUID) and the functions +uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 +UUIDs as specified in RFC 4122. + +If all you want is a unique ID, you should probably call uuid1() or uuid4(). +Note that uuid1() may compromise privacy since it creates a UUID containing +the computer's network address.  uuid4() creates a random UUID. + +Typical usage: + +    >>> import uuid + +    # make a UUID based on the host ID and current time +    >>> uuid.uuid1() +    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e') + +    # make a UUID using an MD5 hash of a namespace UUID and a name +    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org') +    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e') + +    # make a random UUID +    >>> uuid.uuid4() +    UUID('16fd2706-8baf-433b-82eb-8c7fada847da') + +    # make a UUID using a SHA-1 hash of a namespace UUID and a name +    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') +    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d') + +    # make a UUID from a string of hex digits (braces and hyphens ignored) +    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}') + +    # convert a UUID to a string of hex digits in standard form +    >>> str(x) +    '00010203-0405-0607-0809-0a0b0c0d0e0f' + +    # get the raw 16 bytes of the UUID +    >>> x.bytes +    '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f' + +    # make a UUID from a 16-byte string +    >>> uuid.UUID(bytes=x.bytes) +    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f') + +This module works with Python 2.3 or higher.""" + +__author__ = 'Ka-Ping Yee <ping@zesty.ca>' +__date__ = '$Date: 2006/06/12 23:15:40 $'.split()[1].replace('/', '-') +__version__ = '$Revision: 1.30 $'.split()[1] + +RESERVED_NCS, RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE = [ +    'reserved for NCS compatibility', 'specified in RFC 4122', +    'reserved for Microsoft compatibility', 'reserved for future definition'] + +class UUID(object): +    """Instances of the UUID class represent UUIDs as specified in RFC 4122. +    UUID objects are immutable, hashable, and usable as dictionary keys. +    Converting a UUID to a string with str() yields something in the form +    '12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts +    four possible forms: a similar string of hexadecimal digits, or a +    string of 16 raw bytes as an argument named 'bytes', or a tuple of +    six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and +    48-bit values respectively) as an argument named 'fields', or a single +    128-bit integer as an argument named 'int'. +     +    UUIDs have these read-only attributes: + +        bytes       the UUID as a 16-byte string + +        fields      a tuple of the six integer fields of the UUID, +                    which are also available as six individual attributes +                    and two derived attributes: + +            time_low                the first 32 bits of the UUID +            time_mid                the next 16 bits of the UUID +            time_hi_version         the next 16 bits of the UUID +            clock_seq_hi_variant    the next 8 bits of the UUID +            clock_seq_low           the next 8 bits of the UUID +            node                    the last 48 bits of the UUID + +            time                    the 60-bit timestamp +            clock_seq               the 14-bit sequence number + +        hex         the UUID as a 32-character hexadecimal string + +        int         the UUID as a 128-bit integer + +        urn         the UUID as a URN as specified in RFC 4122 + +        variant     the UUID variant (one of the constants RESERVED_NCS, +                    RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE) + +        version     the UUID version number (1 through 5, meaningful only +                    when the variant is RFC_4122) +    """ + +    def __init__(self, hex=None, bytes=None, fields=None, int=None, +                       version=None): +        r"""Create a UUID from either a string of 32 hexadecimal digits, +        a string of 16 bytes as the 'bytes' argument, a tuple of six +        integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version, +        8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as +        the 'fields' argument, or a single 128-bit integer as the 'int' +        argument.  When a string of hex digits is given, curly braces, +        hyphens, and a URN prefix are all optional.  For example, these +        expressions all yield the same UUID: + +        UUID('{12345678-1234-5678-1234-567812345678}') +        UUID('12345678123456781234567812345678') +        UUID('urn:uuid:12345678-1234-5678-1234-567812345678') +        UUID(bytes='\x12\x34\x56\x78'*4) +        UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) +        UUID(int=0x12345678123456781234567812345678) + +        Exactly one of 'hex', 'bytes', 'fields', or 'int' must be given. +        The 'version' argument is optional; if given, the resulting UUID +        will have its variant and version number set according to RFC 4122, +        overriding bits in the given 'hex', 'bytes', 'fields', or 'int'. +        """ + +        if [hex, bytes, fields, int].count(None) != 3: +            raise TypeError('need just one of hex, bytes, fields, or int') +        if hex is not None: +            hex = hex.replace('urn:', '').replace('uuid:', '') +            hex = hex.strip('{}').replace('-', '') +            if len(hex) != 32: +                raise ValueError('badly formed hexadecimal UUID string') +            int = long(hex, 16) +        if bytes is not None: +            if len(bytes) != 16: +                raise ValueError('bytes is not a 16-char string') +            int = long(('%02x'*16) % tuple(map(ord, bytes)), 16) +        if fields is not None: +            if len(fields) != 6: +                raise ValueError('fields is not a 6-tuple') +            (time_low, time_mid, time_hi_version, +             clock_seq_hi_variant, clock_seq_low, node) = fields +            if not 0 <= time_low < 1<<32L: +                raise ValueError('field 1 out of range (need a 32-bit value)') +            if not 0 <= time_mid < 1<<16L: +                raise ValueError('field 2 out of range (need a 16-bit value)') +            if not 0 <= time_hi_version < 1<<16L: +                raise ValueError('field 3 out of range (need a 16-bit value)') +            if not 0 <= clock_seq_hi_variant < 1<<8L: +                raise ValueError('field 4 out of range (need an 8-bit value)') +            if not 0 <= clock_seq_low < 1<<8L: +                raise ValueError('field 5 out of range (need an 8-bit value)') +            if not 0 <= node < 1<<48L: +                raise ValueError('field 6 out of range (need a 48-bit value)') +            clock_seq = (clock_seq_hi_variant << 8L) | clock_seq_low +            int = ((time_low << 96L) | (time_mid << 80L) | +                   (time_hi_version << 64L) | (clock_seq << 48L) | node) +        if int is not None: +            if not 0 <= int < 1<<128L: +                raise ValueError('int is out of range (need a 128-bit value)') +        if version is not None: +            if not 1 <= version <= 5: +                raise ValueError('illegal version number') +            # Set the variant to RFC 4122. +            int &= ~(0xc000 << 48L) +            int |= 0x8000 << 48L +            # Set the version number. +            int &= ~(0xf000 << 64L) +            int |= version << 76L +        self.__dict__['int'] = int + +    def __cmp__(self, other): +        if isinstance(other, UUID): +            return cmp(self.int, other.int) +        return NotImplemented + +    def __hash__(self): +        return hash(self.int) + +    def __int__(self): +        return self.int + +    def __repr__(self): +        return 'UUID(%r)' % str(self) + +    def __setattr__(self, name, value): +        raise TypeError('UUID objects are immutable') + +    def __str__(self): +        hex = '%032x' % self.int +        return '%s-%s-%s-%s-%s' % ( +            hex[:8], hex[8:12], hex[12:16], hex[16:20], hex[20:]) + +    def get_bytes(self): +        bytes = '' +        for shift in range(0, 128, 8): +            bytes = chr((self.int >> shift) & 0xff) + bytes +        return bytes + +    bytes = property(get_bytes) + +    def get_fields(self): +        return (self.time_low, self.time_mid, self.time_hi_version, +                self.clock_seq_hi_variant, self.clock_seq_low, self.node) + +    fields = property(get_fields) + +    def get_time_low(self): +        return self.int >> 96L +    +    time_low = property(get_time_low) + +    def get_time_mid(self): +        return (self.int >> 80L) & 0xffff + +    time_mid = property(get_time_mid) + +    def get_time_hi_version(self): +        return (self.int >> 64L) & 0xffff +     +    time_hi_version = property(get_time_hi_version) + +    def get_clock_seq_hi_variant(self): +        return (self.int >> 56L) & 0xff + +    clock_seq_hi_variant = property(get_clock_seq_hi_variant) +     +    def get_clock_seq_low(self): +        return (self.int >> 48L) & 0xff + +    clock_seq_low = property(get_clock_seq_low) + +    def get_time(self): +        return (((self.time_hi_version & 0x0fffL) << 48L) | +                (self.time_mid << 32L) | self.time_low) + +    time = property(get_time) + +    def get_clock_seq(self): +        return (((self.clock_seq_hi_variant & 0x3fL) << 8L) | +                self.clock_seq_low) + +    clock_seq = property(get_clock_seq) +     +    def get_node(self): +        return self.int & 0xffffffffffff + +    node = property(get_node) + +    def get_hex(self): +        return '%032x' % self.int + +    hex = property(get_hex) + +    def get_urn(self): +        return 'urn:uuid:' + str(self) + +    urn = property(get_urn) + +    def get_variant(self): +        if not self.int & (0x8000 << 48L): +            return RESERVED_NCS +        elif not self.int & (0x4000 << 48L): +            return RFC_4122 +        elif not self.int & (0x2000 << 48L): +            return RESERVED_MICROSOFT +        else: +            return RESERVED_FUTURE + +    variant = property(get_variant) + +    def get_version(self): +        # The version bits are only meaningful for RFC 4122 UUIDs. +        if self.variant == RFC_4122: +            return int((self.int >> 76L) & 0xf) + +    version = property(get_version) + +def _ifconfig_getnode(): +    """Get the hardware address on Unix by running ifconfig.""" +    import os +    for dir in ['', '/sbin/', '/usr/sbin']: +        try: +            pipe = os.popen(os.path.join(dir, 'ifconfig')) +        except IOError: +            continue +        for line in pipe: +            words = line.lower().split() +            for i in range(len(words)): +                if words[i] in ['hwaddr', 'ether']: +                    return int(words[i + 1].replace(':', ''), 16) + +def _ipconfig_getnode(): +    """Get the hardware address on Windows by running ipconfig.exe.""" +    import os, re +    dirs = ['', r'c:\windows\system32', r'c:\winnt\system32'] +    try: +        import ctypes +        buffer = ctypes.create_string_buffer(300) +        ctypes.windll.kernel32.GetSystemDirectoryA(buffer, 300) +        dirs.insert(0, buffer.value.decode('mbcs')) +    except: +        pass +    for dir in dirs: +        try: +            pipe = os.popen(os.path.join(dir, 'ipconfig') + ' /all') +        except IOError: +            continue +        for line in pipe: +            value = line.split(':')[-1].strip().lower() +            if re.match('([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value): +                return int(value.replace('-', ''), 16) + +def _netbios_getnode(): +    """Get the hardware address on Windows using NetBIOS calls. +    See http://support.microsoft.com/kb/118623 for details.""" +    import win32wnet, netbios +    ncb = netbios.NCB() +    ncb.Command = netbios.NCBENUM +    ncb.Buffer = adapters = netbios.LANA_ENUM() +    adapters._pack() +    if win32wnet.Netbios(ncb) != 0: +        return +    adapters._unpack() +    for i in range(adapters.length): +        ncb.Reset() +        ncb.Command = netbios.NCBRESET +        ncb.Lana_num = ord(adapters.lana[i]) +        if win32wnet.Netbios(ncb) != 0: +            continue +        ncb.Reset() +        ncb.Command = netbios.NCBASTAT +        ncb.Lana_num = ord(adapters.lana[i]) +        ncb.Callname = '*'.ljust(16) +        ncb.Buffer = status = netbios.ADAPTER_STATUS() +        if win32wnet.Netbios(ncb) != 0: +            continue +        status._unpack() +        bytes = map(ord, status.adapter_address) +        return ((bytes[0]<<40L) + (bytes[1]<<32L) + (bytes[2]<<24L) + +                (bytes[3]<<16L) + (bytes[4]<<8L) + bytes[5]) + +# Thanks to Thomas Heller for ctypes and for his help with its use here. + +# If ctypes is available, use it to find system routines for UUID generation. +_uuid_generate_random = _uuid_generate_time = _UuidCreate = None +try: +    import ctypes, ctypes.util +    _buffer = ctypes.create_string_buffer(16) + +    # The uuid_generate_* routines are provided by libuuid on at least +    # Linux and FreeBSD, and provided by libc on Mac OS X. +    for libname in ['uuid', 'c']: +        try: +            lib = ctypes.CDLL(ctypes.util.find_library(libname)) +        except: +            continue +        if hasattr(lib, 'uuid_generate_random'): +            _uuid_generate_random = lib.uuid_generate_random +        if hasattr(lib, 'uuid_generate_time'): +            _uuid_generate_time = lib.uuid_generate_time + +    # On Windows prior to 2000, UuidCreate gives a UUID containing the +    # hardware address.  On Windows 2000 and later, UuidCreate makes a +    # random UUID and UuidCreateSequential gives a UUID containing the +    # hardware address.  These routines are provided by the RPC runtime. +    try: +        lib = ctypes.windll.rpcrt4 +    except: +        lib = None +    _UuidCreate = getattr(lib, 'UuidCreateSequential', +                          getattr(lib, 'UuidCreate', None)) +except: +    pass + +def _unixdll_getnode(): +    """Get the hardware address on Unix using ctypes.""" +    _uuid_generate_time(_buffer) +    return UUID(bytes=_buffer.raw).node + +def _windll_getnode(): +    """Get the hardware address on Windows using ctypes.""" +    if _UuidCreate(_buffer) == 0: +        return UUID(bytes=_buffer.raw).node + +def _random_getnode(): +    """Get a random node ID, with eighth bit set as suggested by RFC 4122.""" +    import random +    return random.randrange(0, 1<<48L) | 0x010000000000L + +_node = None + +def getnode(): +    """Get the hardware address as a 48-bit integer.  The first time this +    runs, it may launch a separate program, which could be quite slow.  If +    all attempts to obtain the hardware address fail, we choose a random +    48-bit number with its eighth bit set to 1 as recommended in RFC 4122.""" + +    global _node +    if _node is not None: +        return _node + +    import sys +    if sys.platform == 'win32': +        getters = [_windll_getnode, _netbios_getnode, _ipconfig_getnode] +    else: +        getters = [_unixdll_getnode, _ifconfig_getnode] + +    for getter in getters + [_random_getnode]: +        try: +            _node = getter() +        except: +            continue +        if _node is not None: +            return _node + +def uuid1(node=None, clock_seq=None): +    """Generate a UUID from a host ID, sequence number, and the current time. +    If 'node' is not given, getnode() is used to obtain the hardware +    address.  If 'clock_seq' is given, it is used as the sequence number; +    otherwise a random 14-bit sequence number is chosen.""" + +    # When the system provides a version-1 UUID generator, use it (but don't +    # use UuidCreate here because its UUIDs don't conform to RFC 4122). +    if _uuid_generate_time and node is clock_seq is None: +        _uuid_generate_time(_buffer) +        return UUID(bytes=_buffer.raw) + +    import time +    nanoseconds = int(time.time() * 1e9) +    # 0x01b21dd213814000 is the number of 100-ns intervals between the +    # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. +    timestamp = int(nanoseconds/100) + 0x01b21dd213814000L +    if clock_seq is None: +        import random +        clock_seq = random.randrange(1<<14L) # instead of stable storage +    time_low = timestamp & 0xffffffffL +    time_mid = (timestamp >> 32L) & 0xffffL +    time_hi_version = (timestamp >> 48L) & 0x0fffL +    clock_seq_low = clock_seq & 0xffL +    clock_seq_hi_variant = (clock_seq >> 8L) & 0x3fL +    if node is None: +        node = getnode() +    return UUID(fields=(time_low, time_mid, time_hi_version, +                        clock_seq_hi_variant, clock_seq_low, node), version=1) + +def uuid3(namespace, name): +    """Generate a UUID from the MD5 hash of a namespace UUID and a name.""" +    import md5 +    hash = md5.md5(namespace.bytes + name).digest() +    return UUID(bytes=hash[:16], version=3) + +def uuid4(): +    """Generate a random UUID.""" + +    # When the system provides a version-4 UUID generator, use it. +    if _uuid_generate_random: +        _uuid_generate_random(_buffer) +        return UUID(bytes=_buffer.raw) + +    # Otherwise, get randomness from urandom or the 'random' module. +    try: +        import os +        return UUID(bytes=os.urandom(16), version=4) +    except: +        import random +        bytes = [chr(random.randrange(256)) for i in range(16)] +        return UUID(bytes=bytes, version=4) + +def uuid5(namespace, name): +    """Generate a UUID from the SHA-1 hash of a namespace UUID and a name.""" +    import sha +    hash = sha.sha(namespace.bytes + name).digest() +    return UUID(bytes=hash[:16], version=5) + +# The following standard UUIDs are for use with uuid3() or uuid5(). + +NAMESPACE_DNS = UUID('6ba7b810-9dad-11d1-80b4-00c04fd430c8') +NAMESPACE_URL = UUID('6ba7b811-9dad-11d1-80b4-00c04fd430c8') +NAMESPACE_OID = UUID('6ba7b812-9dad-11d1-80b4-00c04fd430c8') +NAMESPACE_X500 = UUID('6ba7b814-9dad-11d1-80b4-00c04fd430c8') diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 1587b6a21c..94e79ba4f2 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -32,21 +32,21 @@ sample error callback expecting a FILE* client object  */  void error_callback(const char* msg, void*)  { -	llwarns << "LLImageJ2CImpl: " << msg << llendl; +	lldebugs << "LLImageJ2CImpl error_callback: " << msg << llendl;  }  /**  sample warning callback expecting a FILE* client object  */  void warning_callback(const char* msg, void*)  { -	llinfos << "LLImageJ2CImpl: " << msg << llendl; +	lldebugs << "LLImageJ2CImpl warning_callback: " << msg << llendl;  }  /**  sample debug callback expecting no client object  */  void info_callback(const char* msg, void*)  { -	lldebugs << "LLImageJ2CImpl: " << msg << llendl; +	lldebugs << "LLImageJ2CImpl info_callback: " << msg << llendl;  } @@ -271,9 +271,10 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con  	/* encode the image */  	bool bSuccess = opj_encode(cinfo, cio, image, parameters.index); -	if (!bSuccess) { +	if (!bSuccess) +	{  		opj_cio_close(cio); -		fprintf(stderr, "failed to encode image\n"); +		llinfos << "Failed to encode image." << llendl;  		return FALSE;  	}  	codestream_length = cio_tell(cio); diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 96ca5637e6..0d78a45b26 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -421,8 +421,8 @@ const LLString LLLocale::SYSTEM_LOCALE("English_United States.1252");  const LLString LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLString::null;  const LLString LLLocale::SYSTEM_LOCALE("en_US.iso8859-1");  #else // LL_LINUX likes this -const LLString LLLocale::USER_LOCALE("en_US.utf8");// = LLString::null; -const LLString LLLocale::SYSTEM_LOCALE("en_US.utf8"); +const LLString LLLocale::USER_LOCALE("en_US.utf8"); +const LLString LLLocale::SYSTEM_LOCALE("C");  #endif diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index 82d27a11e7..a74bbefb0c 100644 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -1,6 +1,6 @@  /**    * @file lldir_mac.cpp - * @brief Implementation of directory utilities for linux + * @brief Implementation of directory utilities for Mac OS X   *   * Copyright (c) 2002-$CurrentYear$, Linden Research, Inc.   * $License$ diff --git a/indra/llvfs/lldir_mac.h b/indra/llvfs/lldir_mac.h index 24fb1ac583..1375f142f4 100644 --- a/indra/llvfs/lldir_mac.h +++ b/indra/llvfs/lldir_mac.h @@ -1,6 +1,6 @@  /**    * @file lldir_mac.h - * @brief Definition of directory utilities class for Mac OS X  + * @brief Definition of directory utilities class for Mac OS X   *   * Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.   * $License$ diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index ba007abb5c..3f1aa1a469 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1852,7 +1852,7 @@ void LLWindowSDL::gatherInput()  	    // the locale to protect it, as exotic/non-C locales  	    // causes our code lots of general critical weirdness  	    // and crashness. (SL-35450) -	    char *saved_locale = setlocale(LC_ALL, NULL); +	    std::string saved_locale = setlocale(LC_ALL, NULL);  	    // Do a limited number of pumps so SL doesn't starve!  	    // FIXME - this should ideally be time-limited, not count-limited. @@ -1861,8 +1861,7 @@ void LLWindowSDL::gatherInput()  		    if (gtk_events_pending())  			    gtk_main_iteration(); -	    if (saved_locale) -		    setlocale(LC_ALL, saved_locale); +	    setlocale(LC_ALL, saved_locale.c_str() );      }  #endif // LL_GTK && LL_LIBXUL_ENABLED diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index b3e68e24df..b96ffa46fe 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -729,7 +729,18 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,  		{  			size.scaleVec(mDrawablep->getVObj()->getScale());  		} -		LLQuaternion rotation = LLQuaternion(mat_normal); + +		LLMatrix3 mat = mat_normal; +		LLVector3 x = mat.getFwdRow(); +		LLVector3 y = mat.getLeftRow(); +		LLVector3 z = mat.getUpRow(); +		x.normVec(); +		y.normVec(); +		z.normVec(); + +		mat.setRows(x,y,z); + +		LLQuaternion rotation = LLQuaternion(mat);  		LLVector3 v[4];  		//get 4 corners of bounding box @@ -948,20 +959,11 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,  		}  		else  		{ -			//if (mode & LLViewerTextureAnim::TRANSLATE) -			{ -				os = ot = 0.f; -			} -			//if (mode & LLViewerTextureAnim::ROTATE) -			{ -				r = 0.f; -				cos_ang = 1.f; -				sin_ang = 0.f; -			} -			//if (mode & LLViewerTextureAnim::SCALE) -			{ -				ms = mt = 1.f; -			} +			os = ot = 0.f; +			r = 0.f; +			cos_ang = 1.f; +			sin_ang = 0.f; +			ms = mt = 1.f;  		}  	} diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 2b2a9fa859..4a69286493 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -260,6 +260,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)  			wcsncpy( mFilesW,L"untitled.wav", FILENAME_BUFFER_SIZE);	/*Flawfinder: ignore*/  		}  		mOFN.lpstrDefExt = L"wav"; +		mOFN.lpstrFilter =  			L"WAV Sounds (*.wav)\0*.wav\0" \  			L"\0";  		break; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 559b29379c..b541b279d0 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -167,11 +167,12 @@ void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata)  	}  	std::vector<LLScrollListItem*> items = self->mListNames->getAllSelected(); -	std::vector<LLScrollListItem*>::iterator itor; -	for (itor = items.begin(); itor != items.end(); ++itor) +	for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); +		 iter != items.end(); ++iter)  	{ -		self->mAvatarNames.push_back((*itor)->getColumn(0)->getText()); -		self->mAvatarIDs.push_back((*itor)->getUUID()); +		LLScrollListItem* item = *iter; +		self->mAvatarNames.push_back(item->getColumn(0)->getText()); +		self->mAvatarIDs.push_back(item->getUUID());  		self->childSetEnabled("Select", TRUE);  	}  } @@ -313,7 +314,10 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*  				self->mListNames->setEnabled(TRUE);  				found_one = TRUE;  			} -			self->mListNames->addSimpleElement(avatar_name); +			LLSD element; +			element["id"] = avatar_id; // value +			element["columns"][0]["value"] = avatar_name; +			self->mListNames->addElement(element);  		}  		if (found_one) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 45570f6aa2..9b28211476 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1035,65 +1035,39 @@ BOOL LLPanelLandObjects::postBuild()  	mFirstReply = TRUE;  	mParcelObjectBonus = LLUICtrlFactory::getTextBoxByName(this, "Simulator Primitive Bonus Factor: 1.00"); -	 -	mSWTotalObjectsLabel = LLUICtrlFactory::getTextBoxByName(this, "Simulator primitive usage:");  	mSWTotalObjects = LLUICtrlFactory::getTextBoxByName(this, "0 out of 0 available"); -	 -	mObjectContributionLabel = LLUICtrlFactory::getTextBoxByName(this, "Primitives parcel supports:");  	mObjectContribution = LLUICtrlFactory::getTextBoxByName(this, "object_contrib_text"); - -	 -	mTotalObjectsLabel = LLUICtrlFactory::getTextBoxByName(this, "Primitives on parcel:");  	mTotalObjects = LLUICtrlFactory::getTextBoxByName(this, "total_objects_text"); - -	 -	mOwnerObjectsLabel = LLUICtrlFactory::getTextBoxByName(this, "Owned by parcel owner:");  	mOwnerObjects = LLUICtrlFactory::getTextBoxByName(this, "owner_objects_text"); -  	mBtnShowOwnerObjects = LLUICtrlFactory::getButtonByName(this, "ShowOwner");  	mBtnShowOwnerObjects->setClickedCallback(onClickShowOwnerObjects, this); - +	  	mBtnReturnOwnerObjects = LLUICtrlFactory::getButtonByName(this, "ReturnOwner...");  	mBtnReturnOwnerObjects->setClickedCallback(onClickReturnOwnerObjects, this); - -	mGroupObjectsLabel = LLUICtrlFactory::getTextBoxByName(this, "Set to group:");  	mGroupObjects = LLUICtrlFactory::getTextBoxByName(this, "group_objects_text"); - -	  	mBtnShowGroupObjects = LLUICtrlFactory::getButtonByName(this, "ShowGroup");  	mBtnShowGroupObjects->setClickedCallback(onClickShowGroupObjects, this); - +	  	mBtnReturnGroupObjects = LLUICtrlFactory::getButtonByName(this, "ReturnGroup...");  	mBtnReturnGroupObjects->setClickedCallback(onClickReturnGroupObjects, this); - -	mOtherObjectsLabel = LLUICtrlFactory::getTextBoxByName(this, "Owned by others:");  	mOtherObjects = LLUICtrlFactory::getTextBoxByName(this, "other_objects_text"); -	  	mBtnShowOtherObjects = LLUICtrlFactory::getButtonByName(this, "ShowOther");  	mBtnShowOtherObjects->setClickedCallback(onClickShowOtherObjects, this); - +	  	mBtnReturnOtherObjects = LLUICtrlFactory::getButtonByName(this, "ReturnOther...");  	mBtnReturnOtherObjects->setClickedCallback(onClickReturnOtherObjects, this); - -	mSelectedObjectsLabel = LLUICtrlFactory::getTextBoxByName(this, "Selected / sat upon:"); -	mSelectedObjects = LLUICtrlFactory::getTextBoxByName(this, "selected_objects_text"); -	mCleanOtherObjectsLabel = LLUICtrlFactory::getTextBoxByName(this, "Autoreturn other resident's objects (minutes, 0 for off):"); - +	mSelectedObjects = LLUICtrlFactory::getTextBoxByName(this, "selected_objects_text");  	mCleanOtherObjectsTime = LLUICtrlFactory::getLineEditorByName(this, "clean other time");  	mCleanOtherObjectsTime->setFocusLostCallback(onLostFocus);	  	childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32);  	childSetUserData("clean other time", this); -	mOwnerListText = LLUICtrlFactory::getTextBoxByName(this, "Object Owners:"); - -	  	mBtnRefresh = LLUICtrlFactory::getButtonByName(this, "Refresh List");  	mBtnRefresh->setClickedCallback(onClickRefresh, this); -  	mBtnReturnOwnerList = LLUICtrlFactory::getButtonByName(this, "Return objects...");  	mBtnReturnOwnerList->setClickedCallback(onClickReturnOwnerList, this); @@ -2515,6 +2489,7 @@ BOOL LLPanelLandAccess::postBuild()  	childSetCommitCallback("AccessCheck", onCommitAny, this);  	mListAccess = LLUICtrlFactory::getNameListByName(this, "AccessList"); +	mListAccess->sortByColumn(0, TRUE); // ascending  	mBtnAddAccess = LLUICtrlFactory::getButtonByName(this, "Add..."); @@ -2601,9 +2576,9 @@ void LLPanelLandAccess::refresh()  				}  				suffix.append(" remaining)");  			} -			mListAccess->addNameItem(entry.mID, ADD_BOTTOM, TRUE, suffix); +			mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);  		} - +		  		BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED);  		BOOL enable_add = can_manage_allowed && (count < PARCEL_MAX_ACCESS_LIST); @@ -2793,6 +2768,7 @@ BOOL LLPanelLandBan::postBuild()  	childSetCommitCallback("LandBanCheck", onCommitAny, this);  	mList = LLUICtrlFactory::getNameListByName(this, "LandBanList"); +	mList->sortByColumn(0, TRUE); // ascending  	mBtnAdd = LLUICtrlFactory::getButtonByName(this, "Add..."); @@ -2870,7 +2846,7 @@ void LLPanelLandBan::refresh()  				}  				suffix.append(" remaining)");  			} -			mList->addNameItem(entry.mID, ADD_BOTTOM, TRUE, suffix); +			mList->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);  		}  		BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index cfd009c335..6c0fb7319f 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -243,39 +243,22 @@ public:  protected:  	void sortBtnCore(S32 column); -	LLTextBox		*mSWTotalObjectsLabel; -	LLTextBox		*mSWTotalObjects; -  	LLTextBox		*mParcelObjectBonus; - -	LLTextBox		*mObjectContributionLabel; +	LLTextBox		*mSWTotalObjects;  	LLTextBox		*mObjectContribution; -	LLTextBox		*mTotalObjectsLabel;  	LLTextBox		*mTotalObjects; - -	LLTextBox		*mOwnerObjectsLabel;  	LLTextBox		*mOwnerObjects;  	LLButton		*mBtnShowOwnerObjects;  	LLButton		*mBtnReturnOwnerObjects; - -	LLTextBox		*mGroupObjectsLabel;  	LLTextBox		*mGroupObjects;  	LLButton		*mBtnShowGroupObjects;  	LLButton		*mBtnReturnGroupObjects; - -	LLTextBox		*mOtherObjectsLabel;  	LLTextBox		*mOtherObjects;  	LLButton		*mBtnShowOtherObjects;  	LLButton		*mBtnReturnOtherObjects; - -	LLTextBox		*mSelectedObjectsLabel;  	LLTextBox		*mSelectedObjects; - -	LLTextBox		*mCleanOtherObjectsLabel;  	LLLineEditor	*mCleanOtherObjectsTime;  	S32				mOtherTime; - -	LLTextBox		*mOwnerListText;  	LLButton		*mBtnRefresh;  	LLButton		*mBtnReturnOwnerList;  	LLButton        *mBtnType;			// column 0 diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index d53929272c..242f5b7991 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -197,3 +197,47 @@ void LLFloaterMap::toggle(void*)  		}  	}  } + + +BOOL process_secondlife_url(LLString url) +{ +	S32 strpos, strpos2; + +	LLString slurlID = "slurl.com/secondlife/"; +	strpos = url.find(slurlID); +	 +	if (strpos < 0) +	{ +		slurlID="secondlife://"; +		strpos = url.find(slurlID); +	} +	 +	if (strpos >= 0)  +	{ +		LLString simname; + +		strpos+=slurlID.length(); +		strpos2=url.find("/",strpos); +		if (strpos2 < strpos) strpos2=url.length(); +		simname="secondlife://" + url.substr(strpos,url.length() - strpos); + +		LLURLSimString::setString( simname ); +		LLURLSimString::parse(); + +		// if there is a world map +		if ( gFloaterWorldMap ) +		{ +			// mark where the destination is +			gFloaterWorldMap->trackURL( LLURLSimString::sInstance.mSimName.c_str(), +										LLURLSimString::sInstance.mX, +										LLURLSimString::sInstance.mY, +										LLURLSimString::sInstance.mZ ); + +			// display map +			LLFloaterWorldMap::show( NULL, TRUE ); +		}; + +		return TRUE; +	} +	return FALSE; +} diff --git a/indra/newview/llfloatermap.h b/indra/newview/llfloatermap.h index 00a483d17c..5b581c0fe5 100644 --- a/indra/newview/llfloatermap.h +++ b/indra/newview/llfloatermap.h @@ -46,5 +46,6 @@ protected:  extern LLFloaterMap *gFloaterMap; +BOOL process_secondlife_url(LLString url);  #endif  // LL_LLFLOATERMAP_H diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 05897c6bd9..94773e21ba 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -382,7 +382,7 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent)  		if ( KEY_F1 == key )  		{  			llinfos << "Spawning HTML help window" << llendl; -			LLHtmlHelp::show( ); +			LLHtmlHelp::show();  			return TRUE;  		};  			#if ! LL_RELEASE_FOR_DOWNLOAD diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 25273d035d..99cff4b718 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -73,11 +73,14 @@ LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const  // static  void LLPreviewAnim::endAnimCallback( void *userdata )  { -	LLPreviewAnim* self = (LLPreviewAnim*) userdata; - -	self->childSetValue("Anim play btn", FALSE); -	self->childSetValue("Anim audition btn", FALSE); - +	LLViewHandle* handlep = ((LLViewHandle*)userdata); +	LLFloater* self = getFloaterByHandle(*handlep); +	delete handlep; // done with the handle +	if (self) +	{ +		self->childSetValue("Anim play btn", FALSE); +		self->childSetValue("Anim audition btn", FALSE); +	}  }  // static @@ -105,7 +108,9 @@ void LLPreviewAnim::playAnim( void *userdata )  			LLMotion*   motion = avatar->findMotion(itemID);  			if (motion) -				motion->setDeactivateCallback(&endAnimCallback, (void *)self); +			{ +				motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLViewHandle(self->getHandle()))); +			}  		}  		else  		{ @@ -140,7 +145,9 @@ void LLPreviewAnim::auditionAnim( void *userdata )  			LLMotion*   motion = avatar->findMotion(itemID);  			if (motion) -				motion->setDeactivateCallback(&endAnimCallback, (void *)self); +			{ +				motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLViewHandle(self->getHandle()))); +			}  		}  		else  		{ @@ -190,8 +197,9 @@ void LLPreviewAnim::onClose(bool app_quitting)  		LLMotion*   motion = avatar->findMotion(item->getAssetUUID());  		if (motion) +		{  			motion->setDeactivateCallback(NULL, (void *)NULL); - +		}  	}  	destroy();  } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d57292e23d..f3a2c629fd 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -128,8 +128,8 @@  #include "viewer.h"  #include "llmediaengine.h"  #include "llfasttimerview.h" +#include "llfloatermap.h"  #include "llweb.h" -#include "llfloaterhtml.h"  #if LL_LIBXUL_ENABLED  #include "llmozlib.h" @@ -503,12 +503,11 @@ BOOL idle_startup()  		// the locale to protect it, as exotic/non-C locales  		// causes our code lots of general critical weirdness  		// and crashness. (SL-35450) -		char *saved_locale = setlocale(LC_ALL, NULL); +		std::string saved_locale = setlocale(LC_ALL, NULL);  #endif // LL_LINUX  		LLMozLib::getInstance()->init( profileBaseDir, gDirUtilp->getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) );  #if LL_LINUX -		if (saved_locale) -			setlocale(LC_ALL, saved_locale); +		setlocale(LC_ALL, saved_locale.c_str() );  #endif // LL_LINUX  		std::ostringstream codec; diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index 389f0e8bc6..2203df4287 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -36,7 +36,7 @@ protected:  //setting variables are declared in this function  void declare_settings(); -void settings_version_fixup(); +void fixup_settings();  // saved at end of session  extern LLControlGroup gSavedSettings; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index f6fa23c6f6..df5b0f1182 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -138,12 +138,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)  	LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE, GL_LEQUAL);  	// No clue where this is getting unset, but safe enough to reset it here. -	for (S32 j = 7; j >=0; j--) -	{ -		glActiveTextureARB(GL_TEXTURE0_ARB+j); -		glClientActiveTextureARB(GL_TEXTURE0_ARB+j); -		j == 0 ? glEnable(GL_TEXTURE_2D) : glDisable(GL_TEXTURE_2D); -	} +	LLGLState::resetTextureStates();  #ifndef LL_RELEASE_FOR_DOWNLOAD  	LLGLState::checkStates(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 89665171c9..114c90a4d8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -81,6 +81,7 @@  #include "llfloatergodtools.h"  #include "llfloatergroupinfo.h"  #include "llfloatergroups.h" +#include "llfloaterhtml.h"  #include "llfloaterhtmlhelp.h"  #include "llfloaterhtmlfind.h"  #include "llfloaterimport.h" @@ -6477,10 +6478,22 @@ class LLShowFloater : public view_listener_t  		{  			LLFloaterScriptDebug::show(LLUUID::null);  		} -		else if (floater_name == "help") +		else if (floater_name == "help f1")  		{  #if LL_LIBXUL_ENABLED -			LLHtmlHelp::show(NULL); +			LLHtmlHelp::show(); +#endif +		} +		else if (floater_name == "help in-world") +		{ +#if LL_LIBXUL_ENABLED +			LLFloaterHtml::getInstance()->show( "in-world_help" ); +#endif +		} +		else if (floater_name == "help additional") +		{ +#if LL_LIBXUL_ENABLED +			LLFloaterHtml::getInstance()->show( "additional_help" );  #endif  		}  		else if (floater_name == "complaint reporter") diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 52ceb481d9..44ebb2503b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1916,11 +1916,13 @@ void LLPipeline::renderGeom(LLCamera& camera)  	//  	//	  	stop_glerror(); -	BOOL did_hud_elements = FALSE; +	BOOL did_hud_elements = LLDrawPoolWater::sSkipScreenCopy;  	BOOL occlude = sUseOcclusion;  	U32 cur_type = 0; +	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); +  	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PICKING))  	{  		gObjectList.renderObjectsForSelect(camera); @@ -1928,7 +1930,6 @@ void LLPipeline::renderGeom(LLCamera& camera)  	else  	{  		LLFastTimer t(LLFastTimer::FTM_POOLS); -		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);  		calcNearbyLights(camera);  		pool_set_t::iterator iter1 = mPools.begin();  		while ( iter1 != mPools.end() ) @@ -2002,7 +2003,6 @@ void LLPipeline::renderGeom(LLCamera& camera)  			iter1 = iter2;  			stop_glerror();  		} -		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);  	}  #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -2039,6 +2039,8 @@ void LLPipeline::renderGeom(LLCamera& camera)  	// have touch-handlers.  	mHighlightFaces.clear(); +	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); +  	if (!hasRenderType(LLPipeline::RENDER_TYPE_HUD) &&   		!LLDrawPoolWater::sSkipScreenCopy &&  		sRenderGlow && | 
