aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorelektrahesse2010-09-17 20:34:46 +0200
committerelektrahesse2010-09-17 20:34:46 +0200
commitfec7893de067992b496025e2eb922785a557a368 (patch)
treed37498dc5cb75373f4985148b6bc4566130060dc
parentOoops forgot to remove a debug printout :P (diff)
downloadmeta-impy-fec7893de067992b496025e2eb922785a557a368.zip
meta-impy-fec7893de067992b496025e2eb922785a557a368.tar.gz
meta-impy-fec7893de067992b496025e2eb922785a557a368.tar.bz2
meta-impy-fec7893de067992b496025e2eb922785a557a368.tar.xz
Fixed events handling on osx to behave correctly on 10.5+ compilation runs.
Added ShellEx(std::string &) method to execute local applications based on file type.
-rw-r--r--linden/indra/llwindow/llwindowmacosx.cpp35
-rw-r--r--linden/indra/llwindow/llwindowmacosx.h1
2 files changed, 30 insertions, 6 deletions
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp
index 7e7e0af..7efba51 100644
--- a/linden/indra/llwindow/llwindowmacosx.cpp
+++ b/linden/indra/llwindow/llwindowmacosx.cpp
@@ -1153,16 +1153,15 @@ void LLWindowMacOSX::gatherInput()
1153 } 1153 }
1154 break; 1154 break;
1155 1155
1156 case kHighLevelEvent:
1157 AEProcessAppleEvent (&evt);
1158 break;
1159
1160 case updateEvt: 1156 case updateEvt:
1161 // We shouldn't be getting these regularly (since our window will be buffered), but we need to handle them correctly... 1157 // We shouldn't be getting these regularly (since our window will be buffered), but we need to handle them correctly...
1162 BeginUpdate((WindowRef)evt.message); 1158 BeginUpdate((WindowRef)evt.message);
1163 EndUpdate((WindowRef)evt.message); 1159 EndUpdate((WindowRef)evt.message);
1164 break; 1160 break;
1165 1161
1162 default:
1163 AEProcessAppleEvent (&evt);
1164 break;
1166 } 1165 }
1167 } 1166 }
1168} 1167}
@@ -3163,8 +3162,6 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url)
3163 OSStatus result = noErr; 3162 OSStatus result = noErr;
3164 CFURLRef urlRef = NULL; 3163 CFURLRef urlRef = NULL;
3165 3164
3166 llinfos << "Opening URL " << escaped_url << llendl;
3167
3168 CFStringRef stringRef = CFStringCreateWithCString(NULL, escaped_url.c_str(), kCFStringEncodingUTF8); 3165 CFStringRef stringRef = CFStringCreateWithCString(NULL, escaped_url.c_str(), kCFStringEncodingUTF8);
3169 if (stringRef) 3166 if (stringRef)
3170 { 3167 {
@@ -3194,6 +3191,32 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url)
3194 } 3191 }
3195} 3192}
3196 3193
3194void LLWindowMacOSX::ShellEx(const std::string& command)
3195{
3196 OSStatus result = noErr;
3197 CFURLRef urlRef = NULL;
3198
3199 CFStringRef stringRef = CFStringCreateWithCString(NULL, command.c_str(), kCFStringEncodingUTF8);
3200 if (stringRef)
3201 {
3202 urlRef = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, stringRef, kCFURLPOSIXPathStyle, false);
3203 CFRelease(stringRef);
3204 }
3205
3206 if (urlRef)
3207 {
3208 result = LSOpenCFURLRef(urlRef, NULL);
3209 if (result != noErr)
3210 llinfos << "Error " << result << " on open." << llendl;
3211
3212 CFRelease(urlRef);
3213 }
3214 else
3215 {
3216 llinfos << "Error: couldn't create URL." << llendl;
3217 }
3218}
3219
3197BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b) 3220BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b)
3198{ 3221{
3199 BOOL retval = FALSE; 3222 BOOL retval = FALSE;
diff --git a/linden/indra/llwindow/llwindowmacosx.h b/linden/indra/llwindow/llwindowmacosx.h
index bf5bfc0..9e87e9f 100644
--- a/linden/indra/llwindow/llwindowmacosx.h
+++ b/linden/indra/llwindow/llwindowmacosx.h
@@ -113,6 +113,7 @@ public:
113 /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); 113 /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b);
114 /*virtual*/ void interruptLanguageTextInput(); 114 /*virtual*/ void interruptLanguageTextInput();
115 /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); 115 /*virtual*/ void spawnWebBrowser(const std::string& escaped_url);
116 /*virtual*/ void ShellEx(const std::string& command);
116 117
117 static std::vector<std::string> getDynamicFallbackFontList(); 118 static std::vector<std::string> getDynamicFallbackFontList();
118 119