summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindow.h3
-rw-r--r--indra/llwindow/llwindowmacosx.cpp42
-rw-r--r--indra/llwindow/llwindowmacosx.h1
-rw-r--r--indra/llwindow/llwindowsdl.cpp25
-rw-r--r--indra/llwindow/llwindowsdl.h2
-rw-r--r--indra/llwindow/llwindowwin32.cpp19
6 files changed, 11 insertions, 81 deletions
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 9a3542d3fb..8ef7066a31 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -355,9 +355,6 @@ extern const char* gURLProtocolWhitelistHandler[];
// Loads a URL with the user's default browser
void spawn_web_browser(const char* escaped_url);
-// Opens a file with ShellExecute. Security risk!
-void shell_open(const char* file_path);
-
void simpleEscapeString ( std::string& stringIn );
#endif // _LL_window_h_
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 943b98e9d5..0a2f9cfb6c 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -70,7 +70,6 @@ const S32 MAX_NUM_RESOLUTIONS = 32;
void show_window_creation_error(const char* title)
{
llwarns << title << llendl;
- shell_open( "help/window_creation_error.html");
/*
OSMessageBox(
"Second Life is unable to run because it can't set up your display.\n"
@@ -735,7 +734,6 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
if (check_for_card(RENDERER, CARD_LIST[i]))
{
close();
- shell_open( "help/unsupported_card.html" );
return FALSE;
}
}
@@ -3200,46 +3198,6 @@ void spawn_web_browser(const char* escaped_url)
}
}
-void shell_open( const char* file_path )
-{
- OSStatus result = noErr;
-
- llinfos << "Opening " << file_path << llendl;
- CFURLRef urlRef = NULL;
-
- CFStringRef stringRef = CFStringCreateWithCString(NULL, file_path, kCFStringEncodingUTF8);
- if (stringRef)
- {
- // This will succeed if the string is a full URL, including the http://
- // Note that URLs specified this way need to be properly percent-escaped.
- urlRef = CFURLCreateWithString(NULL, stringRef, NULL);
-
- if(urlRef == NULL)
- {
- // This will succeed if the string is a full or partial posix path.
- // This will work even if the path contains characters that would need to be percent-escaped
- // in the URL (such as spaces).
- urlRef = CFURLCreateWithFileSystemPath(NULL, stringRef, kCFURLPOSIXPathStyle, false);
- }
-
- CFRelease(stringRef);
- }
-
- if (urlRef)
- {
- result = LSOpenCFURLRef(urlRef, NULL);
-
- if (result != noErr)
- {
- llinfos << "Error " << result << " on open." << llendl;
- }
- CFRelease(urlRef);
- }
- else
- {
- llinfos << "Error: couldn't create URL." << llendl;
- }
-}
BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b)
{
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 2a4cf97308..2fdf80ee82 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -218,6 +218,5 @@ private:
S32 OSMessageBoxMacOSX(const char* text, const char* caption, U32 type);
void load_url_external(const char* url);
-void shell_open( const char* file_path );
#endif //LL_LLWINDOWMACOSX_H
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index ad39c84ac8..cbf4b7dc3a 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -2230,11 +2230,11 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty
bmpsurface->w,
bmpsurface->h,
32,
- 0xFFU,
- 0xFF00U,
- 0xFF0000U,
- 0xFF000000U);
- SDL_FillRect(cursurface, NULL, 0x00000000U);
+ SDL_SwapLE32(0xFFU),
+ SDL_SwapLE32(0xFF00U),
+ SDL_SwapLE32(0xFF0000U),
+ SDL_SwapLE32(0xFF000000U));
+ SDL_FillRect(cursurface, NULL, SDL_SwapLE32(0x00000000U));
// Blit the cursor pixel data onto a 32-bit RGBA surface so we
// only have to cope with processing one type of pixel format.
@@ -2253,13 +2253,13 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty
// is inferred by color-keying against 200,200,200
for (i=0; i<cursurface->h; ++i) {
for (j=0; j<cursurface->w; ++j) {
- unsigned char *pixelp =
- ((unsigned char *)cursurface->pixels)
+ U8 *pixelp =
+ ((U8*)cursurface->pixels)
+ cursurface->pitch * i
+ j*cursurface->format->BytesPerPixel;
- unsigned char srcred = pixelp[0];
- unsigned char srcgreen = pixelp[1];
- unsigned char srcblue = pixelp[2];
+ U8 srcred = pixelp[0];
+ U8 srcgreen = pixelp[1];
+ U8 srcblue = pixelp[2];
BOOL mask_bit = (srcred != 200)
|| (srcgreen != 200)
|| (srcblue != 200);
@@ -2741,11 +2741,6 @@ void spawn_web_browser(const char* escaped_url)
llinfos << "spawn_web_browser returning." << llendl;
}
-void shell_open( const char* file_path )
-{
- // *TODO: This function is deprecated and should probably go away.
- llwarns << "Deprecated shell_open(): " << file_path << llendl;
-}
void *LLWindowSDL::getPlatformWindow()
{
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index aa331ed742..2c411e03fd 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -37,6 +37,7 @@
#include "llwindow.h"
#include "SDL/SDL.h"
+#include "SDL/SDL_endian.h"
#if LL_X11
// get X11-specific headers for use in low-level stuff like copy-and-paste support
@@ -222,7 +223,6 @@ public:
S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type);
void load_url_external(const char* url);
-void shell_open( const char* file_path );
#if LL_GTK
// Lazily initialize and check the runtime GTK version for goodness.
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 4e4bed6485..b8fd9948e3 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -84,7 +84,6 @@ LLW32MsgCallback gAsyncMsgCallback = NULL;
void show_window_creation_error(const char* title)
{
llwarns << title << llendl;
- shell_open( "help/window_creation_error.html");
}
//static
@@ -3398,24 +3397,6 @@ void spawn_web_browser(const char* escaped_url )
}
}
-void shell_open( const char* file_path )
-{
- llinfos << "Opening " << file_path << llendl;
-
- WCHAR wstr[1024];
- mbstowcs(wstr, file_path, 1024);
-
- HWND our_window = NULL;
- int retval = (int) ShellExecute(our_window, L"open", wstr, NULL, NULL, SW_SHOWNORMAL); /* Flawfinder: ignore */
- if (retval > 32)
- {
- llinfos << "ShellExecute success with " << retval << llendl;
- }
- else
- {
- llinfos << "ShellExecute failure with " << retval << llendl;
- }
-}
BOOL LLWindowWin32::dialog_color_picker ( F32 *r, F32 *g, F32 *b )
{