From c8aa1fb7c8ed44886599ea4e04eed403392e2e34 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 17 Dec 2012 18:00:30 -0500 Subject: LLWindow: Move to using Cocoa for window and view creation along with setting up callbacks for event handling as such. --- indra/newview/llviewerkeyboard.cpp | 2 ++ indra/newview/llviewerwindow.cpp | 1 + 2 files changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 1aa9fd8a45..6d91dad70e 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -653,6 +653,8 @@ BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode) BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL repeated) { + LL_INFOS("Keyboard Handling") << "Handling key " << translated_key << LL_ENDL; + LL_INFOS("Keyboard Handling") << "Keyboard has focus? " << gFocusMgr.getKeyboardFocus() << LL_ENDL; // check for re-map EKeyboardMode mode = gViewerKeyboard.getMode(); U32 keyidx = (translated_mask<<16) | translated_key; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1def2db829..7c0d49d1e2 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2428,6 +2428,7 @@ void LLViewerWindow::draw() // Takes a single keydown event, usually when UI is visible BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { + LL_INFOS("Keyboard Handling") << "Handling key " << key << LL_ENDL; // hide tooltips on keypress LLToolTipMgr::instance().blockToolTips(); -- cgit v1.2.3 From bd152c1fb75c4a8d4b9271896c44243ca8759e58 Mon Sep 17 00:00:00 2001 From: Geenz Date: Sat, 29 Dec 2012 06:59:43 -0500 Subject: Huge amount of refactoring to use Cocoa here: - Updated to .xib format. To produce a new nib (which is required after changing the xib file), use "ibtool SecondLife.xib --compile SecondLife.nib" within the newview directory. - xib file now defines the viewer's window. VIews are still being pragmatically added to the main window. This may change in the future. - LLAppViewer's main loop has been slightly refactored to be executed on a timer for OS X. This probably needs a bit more work. - Event handling still needs more work to work within a timer based event loop. It works fairly sporadically at the moment, as if events are being dropped between timer executions, at least for the mouse. - Carbon has been purged from the viewer's startup, and from LLWindow entirely. There's likely still a few odds and ends fragmented throughout the viewer and its dependencies. Need to track these down. - LLAppViewerMacOSX now uses NSApplicationMain, and also implements the NSApplicationDelegate protocol in LLAppDelegate. - Fullscreen support has been implemented for OS X 10.7+ This is still a work in progress, however at this stage everything needed for a functional viewer is (mostly) complete. From here, it's mostly just bug hunting and fixing. --- indra/newview/CMakeLists.txt | 6 +- indra/newview/Info-SecondLife.plist | 4 + indra/newview/SecondLife.nib/classes.nib | 4 - indra/newview/SecondLife.nib/info.nib | 23 - indra/newview/SecondLife.nib/objects.xib | 259 ---- indra/newview/SecondLife.xib | 1848 +++++++++++++++++++++++++++ indra/newview/llappviewer.cpp | 118 +- indra/newview/llappviewer.h | 3 + indra/newview/llappviewermacosx-delegate.h | 24 + indra/newview/llappviewermacosx-delegate.mm | 49 + indra/newview/llappviewermacosx-objc.h | 19 + indra/newview/llappviewermacosx-objc.mm | 20 + indra/newview/llappviewermacosx.cpp | 234 +--- indra/newview/macutil_Prefix.h | 1 - 14 files changed, 2075 insertions(+), 537 deletions(-) delete mode 100644 indra/newview/SecondLife.nib/classes.nib delete mode 100644 indra/newview/SecondLife.nib/info.nib delete mode 100644 indra/newview/SecondLife.nib/objects.xib create mode 100644 indra/newview/SecondLife.xib create mode 100644 indra/newview/llappviewermacosx-delegate.h create mode 100644 indra/newview/llappviewermacosx-delegate.mm create mode 100644 indra/newview/llappviewermacosx-objc.h create mode 100644 indra/newview/llappviewermacosx-objc.mm (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dff2c04fbc..73f5ecc38c 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1231,6 +1231,10 @@ source_group("CMake Rules" FILES ViewerInstall.cmake) if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) + LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.h) + LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.mm) + LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-delegate.h) + LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-delegate.mm) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) @@ -1251,7 +1255,7 @@ if (DARWIN) macview.r gpu_table.txt Info-SecondLife.plist - SecondLife.nib/ + SecondLife.xib/ # CMake doesn't seem to support Xcode language variants well just yet English.lproj/InfoPlist.strings English.lproj/language.txt diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index f7b11b217c..5db52f040f 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -61,6 +61,10 @@ CFBundleVersion 2.1.0.13828 + NSPrincipalClass + NSApplication + NSMainNibFile + SecondLife CSResourcesFileMapped diff --git a/indra/newview/SecondLife.nib/classes.nib b/indra/newview/SecondLife.nib/classes.nib deleted file mode 100644 index ea58db1189..0000000000 --- a/indra/newview/SecondLife.nib/classes.nib +++ /dev/null @@ -1,4 +0,0 @@ -{ -IBClasses = (); -IBVersion = 1; -} diff --git a/indra/newview/SecondLife.nib/info.nib b/indra/newview/SecondLife.nib/info.nib deleted file mode 100644 index 1b531de104..0000000000 --- a/indra/newview/SecondLife.nib/info.nib +++ /dev/null @@ -1,23 +0,0 @@ - - - - - IBDocumentLocation - 85 13 356 240 0 0 1280 1002 - IBEditorPositions - - 29 - 27 314 247 44 0 0 1280 1002 - - IBFramework Version - 362.0 - IBOpenObjects - - 191 - - IBSystem Version - 7D24 - targetFramework - IBCarbonFramework - - diff --git a/indra/newview/SecondLife.nib/objects.xib b/indra/newview/SecondLife.nib/objects.xib deleted file mode 100644 index b7ff30f2b2..0000000000 --- a/indra/newview/SecondLife.nib/objects.xib +++ /dev/null @@ -1,259 +0,0 @@ - - - IBCarbonFramework - - NSApplication - - - - SecondLife - - - Second Life - - Second Life - - - TRUE - TRUE - About Second Life - 0 - abou - - - _NSAppleMenu - - - - File - - File - - - - Edit - - Edit - - - TRUE - Undo - z - undo - - - TRUE - Redo - Z - redo - - - TRUE - - - TRUE - Cut - x - cut - - - TRUE - Copy - c - copy - - - TRUE - Paste - v - past - - - TRUE - Delete - clea - - - TRUE - Select All - a - sall - - - TRUE - - - TRUE - Special Characters… - chrp - - - - - - Window - - Window - - - TRUE - TRUE - Minimize Window - m - mini - - - TRUE - TRUE - Minimize All Windows - m - 1572864 - mina - - - TRUE - Zoom - zoom - - - TRUE - - - TRUE - TRUE - Bring All to Front - bfrt - - - TRUE - TRUE - Arrange in Front - 1572864 - frnt - - - _NSWindowsMenu - - - - _NSMainMenu - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 0 482 694 - 0 0 694 482 - - - 442 604 462 674 - 604 442 70 20 - OK - ok - - 2 - 2 - - 1 - - - 20 20 422 674 - 20 20 654 402 - - - 20 20 422 659 - 0 0 639 402 - text - 5 - TRUE - - - FALSE - - - - - 84 72 566 766 - Release Notes - - FALSE - FALSE - FALSE - FALSE - FALSE - FALSE - TRUE - TRUE - 4 - 1 - FALSE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Files Owner - - MenuBar - - Release Notes - - - 202 - diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib new file mode 100644 index 0000000000..2fc83bd009 --- /dev/null +++ b/indra/newview/SecondLife.xib @@ -0,0 +1,1848 @@ + + + + 1060 + 12C60 + 2844 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + NSCustomObject + NSMenu + NSMenuItem + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + NSApplication + + + FirstResponder + + + NSApplication + + + Main Menu + + + + Second Life + + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Second Life + + + + About Second Life + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Services + + 2147483647 + + + submenuAction: + + Services + + _NSServicesMenu + + + + + YES + YES + + + 2147483647 + + + + + + Hide NewApplication + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Quit NewApplication + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 2147483647 + + + submenuAction: + + File + + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 2147483647 + + + submenuAction: + + Open Recent + + + + Clear Menu + + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save… + s + 1048576 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 2147483647 + + + submenuAction: + + Edit + + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Find + + 2147483647 + + + submenuAction: + + Find + + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find and Replace… + f + 1572864 + 2147483647 + + + 12 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1048576 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 2147483647 + + + submenuAction: + + Spelling + + + + Show Spelling and Grammar + : + 1048576 + 2147483647 + + + + + + Check Document Now + ; + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Check Spelling While Typing + + 2147483647 + + + + + + Check Grammar With Spelling + + 2147483647 + + + + + + Correct Spelling Automatically + + 2147483647 + + + + + + + + + Substitutions + + 2147483647 + + + submenuAction: + + Substitutions + + + + Show Substitutions + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Smart Copy/Paste + + 2147483647 + + + + + + Smart Quotes + + 2147483647 + + + + + + Smart Dashes + + 2147483647 + + + + + + Smart Links + + 2147483647 + + + + + + Data Detectors + + 2147483647 + + + + + + Text Replacement + + 2147483647 + + + + + + + + + Transformations + + 2147483647 + + + submenuAction: + + Transformations + + + + Make Upper Case + + 2147483647 + + + + + + Make Lower Case + + 2147483647 + + + + + + Capitalize + + 2147483647 + + + + + + + + + Speech + + 2147483647 + + + submenuAction: + + Speech + + + + Start Speaking + + 2147483647 + + + + + + Stop Speaking + + 2147483647 + + + + + + + + + + + + Window + + 2147483647 + + + submenuAction: + + Window + + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 2147483647 + + + + + + Enter Full Screen + f + 1310720 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bring All to Front + + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + + + NewApplication Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + LLAppDelegate + + + 15 + 2 + {{196, 240}, {1024, 768}} + 74974208 + Second Life + LLNSWindow + + + {1024, 768} + + + 256 + + {1024, 768} + + + + _NS:20 + + {{0, 0}, {1920, 1178}} + {1024, 790} + {10000000000000, 10000000000000} + 128 + YES + + + + + + + terminate: + + + + 823 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 845 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + performClose: + + + + 193 + + + + performZoom: + + + + 240 + + + + showHelp: + + + + 360 + + + + saveDocument: + + + + 362 + + + + revertDocumentToSaved: + + + + 364 + + + + hide: + + + + 369 + + + + hideOtherApplications: + + + + 370 + + + + unhideAllApplications: + + + + 372 + + + + cut: + + + + 768 + + + + paste: + + + + 769 + + + + toggleSmartInsertDelete: + + + + 770 + + + + toggleAutomaticDashSubstitution: + + + + 773 + + + + toggleContinuousSpellChecking: + + + + 774 + + + + toggleAutomaticDataDetection: + + + + 775 + + + + undo: + + + + 776 + + + + startSpeaking: + + + + 778 + + + + showGuessPanel: + + + + 779 + + + + checkSpelling: + + + + 780 + + + + copy: + + + + 782 + + + + delete: + + + + 783 + + + + selectAll: + + + + 785 + + + + stopSpeaking: + + + + 786 + + + + orderFrontSubstitutionsPanel: + + + + 787 + + + + toggleAutomaticTextReplacement: + + + + 788 + + + + toggleAutomaticSpellingCorrection: + + + + 790 + + + + toggleFullScreen: + + + + 842 + + + + window + + + + 850 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + + + + + + + + Main Menu + + + 19 + + + + + + + + 56 + + + + + + + + 103 + + + + + + + + 83 + + + + + + + + 81 + + + + + + + + + + + + + + + + + 75 + + + + + 78 + + + + + 72 + + + + + 82 + + + + + 124 + + + + + + + + 77 + + + + + 73 + + + + + 79 + + + + + 112 + + + + + 74 + + + + + 125 + + + + + + + + 126 + + + + + 106 + + + + + + + + 111 + + + + + 57 + + + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 711 + + + + + + + + 712 + + + + + + + + + + + + + + + + + + + + + + 713 + + + + + 714 + + + + + 715 + + + + + 716 + + + + + 717 + + + + + 718 + + + + + 719 + + + + + 720 + + + + + 721 + + + + + 722 + + + + + 723 + + + + + + + + 724 + + + + + + + + 725 + + + + + + + + 726 + + + + + + + + 727 + + + + + + + + 738 + + + + + + + + + 739 + + + + + 740 + + + + + 741 + + + + + + + + + + 742 + + + + + 743 + + + + + 744 + + + + + 745 + + + + + + + + + + + + + + + 746 + + + + + 747 + + + + + 748 + + + + + 749 + + + + + 750 + + + + + 751 + + + + + 752 + + + + + 753 + + + + + 754 + + + + + + + + + + + + + 755 + + + + + 756 + + + + + 757 + + + + + 758 + + + + + 759 + + + + + 760 + + + + + 761 + + + + + + + + + + + + + 762 + + + + + 763 + + + + + 764 + + + + + 765 + + + + + 766 + + + + + 821 + + + + + 824 + + + + + 841 + + + + + 828 + + + + + + + + 829 + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 852 + + + + + LLAppDelegate + NSObject + + LLOpenGLView + LLNSWindow + + + + glview + LLOpenGLView + + + window + LLNSWindow + + + + IBProjectSource + ./Classes/LLAppDelegate.h + + + + LLNSWindow + NSWindow + + IBProjectSource + ./Classes/LLNSWindow.h + + + + LLOpenGLView + NSOpenGLView + + IBProjectSource + ./Classes/LLOpenGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + 3 + + {11, 11} + {10, 3} + + YES + + diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 30f82926f1..6a87f7306d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -250,10 +250,6 @@ static LLAppViewerListener sAppViewerListener(LLAppViewer::instance); //---------------------------------------------------------------------------- // viewer.cpp - these are only used in viewer, should be easily moved. -#if LL_DARWIN -extern void init_apple_menu(const char* product); -#endif // LL_DARWIN - extern BOOL gRandomizeFramerate; extern BOOL gPeriodicSlowFrame; extern BOOL gDebugGL; @@ -1196,43 +1192,56 @@ static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback"); static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot"); static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update"); +LLMemType mt1(LLMemType::MTYPE_MAIN); + bool LLAppViewer::mainLoop() { - LLMemType mt1(LLMemType::MTYPE_MAIN); - mMainloopTimeout = new LLWatchdogTimeout(); + if (!mMainLoopInitialized) + { + mMainloopTimeout = new LLWatchdogTimeout(); + + //------------------------------------------- + // Run main loop until time to quit + //------------------------------------------- + + // Create IO Pump to use for HTTP Requests. + gServicePump = new LLPumpIO(gAPRPoolp); + LLHTTPClient::setPump(*gServicePump); + LLCurl::setCAFile(gDirUtilp->getCAFile()); + + // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. + + LLVoiceChannel::initClass(); + LLVoiceClient::getInstance()->init(gServicePump); + LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::sOnCurrentChannelChanged, _1), true); + + joystick = LLViewerJoystick::getInstance(); + joystick->setNeedsReset(true); + + + // As we do not (yet) send data on the mainloop LLEventPump that varies + // with each frame, no need to instantiate a new LLSD event object each + // time. Obviously, if that changes, just instantiate the LLSD at the + // point of posting. + mMainLoopInitialized = true; + } + LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); + + LLSD newFrame; - //------------------------------------------- - // Run main loop until time to quit - //------------------------------------------- - - // Create IO Pump to use for HTTP Requests. - gServicePump = new LLPumpIO(gAPRPoolp); - LLHTTPClient::setPump(*gServicePump); - LLCurl::setCAFile(gDirUtilp->getCAFile()); - - // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. - - LLVoiceChannel::initClass(); - LLVoiceClient::getInstance()->init(gServicePump); - LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::sOnCurrentChannelChanged, _1), true); LLTimer frameTimer,idleTimer; LLTimer debugTime; - LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); - joystick->setNeedsReset(true); - - LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); - // As we do not (yet) send data on the mainloop LLEventPump that varies - // with each frame, no need to instantiate a new LLSD event object each - // time. Obviously, if that changes, just instantiate the LLSD at the - // point of posting. - LLSD newFrame; - + //LLPrivateMemoryPoolTester::getInstance()->run(false) ; //LLPrivateMemoryPoolTester::getInstance()->run(true) ; //LLPrivateMemoryPoolTester::destroy() ; // Handle messages +#ifdef LL_DARWIN + if (!LLApp::isExiting()) +#else while (!LLApp::isExiting()) +#endif { LLFastTimer::nextFrame(); // Should be outside of any timer instances @@ -1510,34 +1519,37 @@ bool LLAppViewer::mainLoop() } } - // Save snapshot for next time, if we made it through initialization - if (STATE_STARTED == LLStartUp::getStartupState()) + if (LLApp::isExiting()) { - try + // Save snapshot for next time, if we made it through initialization + if (STATE_STARTED == LLStartUp::getStartupState()) { - saveFinalSnapshot(); - } - catch(std::bad_alloc) - { - llwarns << "Bad memory allocation when saveFinalSnapshot() is called!" << llendl ; - - //stop memory leaking simulation - LLFloaterMemLeak* mem_leak_instance = - LLFloaterReg::findTypedInstance("mem_leaking"); - if(mem_leak_instance) + try { - mem_leak_instance->stop() ; - } + saveFinalSnapshot(); + } + catch(std::bad_alloc) + { + llwarns << "Bad memory allocation when saveFinalSnapshot() is called!" << llendl ; + + //stop memory leaking simulation + LLFloaterMemLeak* mem_leak_instance = + LLFloaterReg::findTypedInstance("mem_leaking"); + if(mem_leak_instance) + { + mem_leak_instance->stop() ; + } + } } + + delete gServicePump; + + destroyMainloopTimeout(); + + llinfos << "Exiting main_loop" << llendflush; } - - delete gServicePump; - - destroyMainloopTimeout(); - - llinfos << "Exiting main_loop" << llendflush; - return true; + return LLApp::isExiting(); } void LLAppViewer::flushVFSIO() @@ -2618,8 +2630,6 @@ bool LLAppViewer::initConfiguration() //} #if LL_DARWIN - // Initialize apple menubar and various callbacks - init_apple_menu(LLTrans::getString("APP_NAME").c_str()); #if __ppc__ // If the CPU doesn't have Altivec (i.e. it's not at least a G4), don't go any further. diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 7a474f9122..a09bdb2496 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -41,6 +41,7 @@ class LLImageDecodeThread; class LLTextureFetch; class LLWatchdogTimeout; class LLUpdaterService; +class LLViewerJoystick; class LLAppViewer : public LLApp { @@ -250,6 +251,8 @@ private: std::string mSerialNumber; bool mPurgeCache; bool mPurgeOnExit; + bool mMainLoopInitialized; + LLViewerJoystick* joystick; bool mSavedFinalSnapshot; bool mSavePerAccountSettings; // only save per account settings if login succeeded diff --git a/indra/newview/llappviewermacosx-delegate.h b/indra/newview/llappviewermacosx-delegate.h new file mode 100644 index 0000000000..ac234c14be --- /dev/null +++ b/indra/newview/llappviewermacosx-delegate.h @@ -0,0 +1,24 @@ +// +// LLAppDelegate.h +// SecondLife +// +// Created by Geenz on 12/16/12. +// +// + +#import +#import "llopenglview-objc.h" +#include "llappviewermacosx-objc.h" + +@interface LLAppDelegate : NSObject { + LLNSWindow *window; + LLOpenGLView *glview; + NSTimer *frameTimer; +} + +@property (assign) IBOutlet LLNSWindow *window; +@property (assign) IBOutlet LLOpenGLView *glview; + +- (void) mainLoop; + +@end diff --git a/indra/newview/llappviewermacosx-delegate.mm b/indra/newview/llappviewermacosx-delegate.mm new file mode 100644 index 0000000000..80cc1010e9 --- /dev/null +++ b/indra/newview/llappviewermacosx-delegate.mm @@ -0,0 +1,49 @@ +// +// LLAppDelegate.m +// SecondLife +// +// Created by Geenz on 12/16/12. +// +// + +#import "llappviewermacosx-delegate.h" + +@implementation LLAppDelegate + +@synthesize window; +@synthesize glview; + +- (void)dealloc +{ + [super dealloc]; +} + +- (void) applicationDidFinishLaunching:(NSNotification *)notification +{ + frameTimer = nil; + + setLLNSWindowRef([self window]); + setLLOpenGLViewRef([self glview]); + if (initViewer()) + { + frameTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/60 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; + } else { + handleQuit(); + } +} + +- (void) applicationWillTerminate:(NSNotification *)notification +{ +} + +- (void) mainLoop +{ + bool appExiting = runMainLoop(); + if (appExiting) + { + [frameTimer release]; + handleQuit(); + } +} + +@end diff --git a/indra/newview/llappviewermacosx-objc.h b/indra/newview/llappviewermacosx-objc.h new file mode 100644 index 0000000000..9ece6a1a6a --- /dev/null +++ b/indra/newview/llappviewermacosx-objc.h @@ -0,0 +1,19 @@ +// +// NSObject_llappviewermacosx_objc.h +// SecondLife +// +// Created by Geenz on 12/16/12. +// +// + +#include +typedef std::tr1::function VoidCallback; +typedef void* ViewerAppRef; + +int createNSApp(int argc, const char **argv); + +bool initViewer(); +void handleQuit(); +bool runMainLoop(); +void initMainLoop(); +void destroyMainLoop(); \ No newline at end of file diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm new file mode 100644 index 0000000000..ca2090b790 --- /dev/null +++ b/indra/newview/llappviewermacosx-objc.mm @@ -0,0 +1,20 @@ +// +// llappviewermacosx.m +// SecondLife +// +// Created by Geenz on 12/12/12. +// +// + +#import +#import +#include "llappviewermacosx-objc.h" +#import "llappviewermacosx-delegate.h" + +int createNSApp(int argc, const char *argv[]) +{ + return NSApplicationMain(argc, argv); +} + + + diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index c2916717bd..a1c8b7699d 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -31,6 +31,7 @@ #endif #include "llappviewermacosx.h" +#include "llappviewermacosx-objc.h" #include "llcommandlineparser.h" #include "llmemtype.h" @@ -53,7 +54,7 @@ namespace int gArgC; char** gArgV; - bool sCrashReporterIsRunning = false; + LLAppViewerMacOSX* gViewerAppPtr; OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) { @@ -65,55 +66,61 @@ namespace } } -int main( int argc, char **argv ) +bool initViewer() { LLMemType mt1(LLMemType::MTYPE_STARTUP); - -#if LL_SOLARIS && defined(__sparc) - asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC -#endif - + // Set the working dir to /Contents/Resources if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1) { llwarns << "Could not change directory to " - << gDirUtilp->getAppRODataDir() << ": " << strerror(errno) - << llendl; + << gDirUtilp->getAppRODataDir() << ": " << strerror(errno) + << llendl; } - - LLAppViewerMacOSX* viewer_app_ptr = new LLAppViewerMacOSX(); - - viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); - - // Store off the command line args for use later. - gArgC = argc; - gArgV = argv; - bool ok = viewer_app_ptr->init(); + gViewerAppPtr = new LLAppViewerMacOSX(); + + gViewerAppPtr->setErrorHandler(LLAppViewer::handleViewerCrash); + + + + bool ok = gViewerAppPtr->init(); if(!ok) { llwarns << "Application init failed." << llendl; - return -1; } + + return ok; +} - // Run the application main loop - if(!LLApp::isQuitting()) +void handleQuit() +{ + if(!LLApp::isError()) { - viewer_app_ptr->mainLoop(); + gViewerAppPtr->cleanup(); } + + delete gViewerAppPtr; + gViewerAppPtr = NULL; +} - if (!LLApp::isError()) +bool runMainLoop() +{ + bool ret = LLApp::isQuitting(); + if (!ret) { - // - // We don't want to do cleanup here if the error handler got called - - // the assumption is that the error handler is responsible for doing - // app cleanup if there was a problem. - // - viewer_app_ptr->cleanup(); + ret = gViewerAppPtr->mainLoop(); } - delete viewer_app_ptr; - viewer_app_ptr = NULL; - return 0; + + return ret; +} + +int main( int argc, char **argv ) +{ + // Store off the command line args for use later. + gArgC = argc; + gArgV = argv; + return createNSApp(argc, (const char**)argv); } LLAppViewerMacOSX::LLAppViewerMacOSX() @@ -258,33 +265,6 @@ bool LLAppViewerMacOSX::restoreErrorTrap() return reset_count == 0; } -static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef, - EventRef inEvent, - void* inUserData) -{ - ProcessSerialNumber psn; - - GetEventParameter(inEvent, - kEventParamProcessID, - typeProcessSerialNumber, - NULL, - sizeof(psn), - NULL, - &psn); - - if( GetEventKind(inEvent) == kEventAppTerminated ) - { - Boolean matching_psn = FALSE; - OSErr os_result = SameProcess(&psn, (ProcessSerialNumber*)inUserData, &matching_psn); - if(os_result >= 0 && matching_psn) - { - sCrashReporterIsRunning = false; - QuitApplicationEventLoop(); - } - } - return noErr; -} - void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) { // This used to use fork&exec, but is switched to LSOpenApplication to @@ -306,72 +286,6 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) appParams.version = 0; appParams.flags = kLSLaunchNoParams | kLSLaunchStartClassic; appParams.application = &appRef; - - if(reportFreeze) - { - // Make sure freeze reporting launches the crash logger synchronously, lest - // Log files get changed by SL while the logger is running. - - // *NOTE:Mani A better way - make a copy of the data that the crash reporter will send - // and let SL go about its business. This way makes the mac work like windows and linux - // and is the smallest patch for the issue. - sCrashReporterIsRunning = false; - ProcessSerialNumber o_psn; - - static EventHandlerRef sCarbonEventsRef = NULL; - static const EventTypeSpec kEvents[] = - { - { kEventClassApplication, kEventAppTerminated } - }; - - // Install the handler to detect crash logger termination - InstallEventHandler(GetApplicationEventTarget(), - (EventHandlerUPP) CarbonEventHandler, - GetEventTypeCount(kEvents), - kEvents, - &o_psn, - &sCarbonEventsRef - ); - - // Remove, temporarily the quit handler - which has *crash* behavior before - // the mainloop gets running! - AERemoveEventHandler(kCoreEventClass, - kAEQuitApplication, - NewAEEventHandlerUPP(AEQuitHandler), - false); - - // Launch the crash reporter. - os_result = LSOpenApplication(&appParams, &o_psn); - - if(os_result >= 0) - { - sCrashReporterIsRunning = true; - } - - while(sCrashReporterIsRunning) - { - RunApplicationEventLoop(); - } - - // Re-install the apps quit handler. - AEInstallEventHandler(kCoreEventClass, - kAEQuitApplication, - NewAEEventHandlerUPP(AEQuitHandler), - 0, - false); - - // Remove the crash reporter quit handler. - RemoveEventHandler(sCarbonEventsRef); - } - else - { - appParams.flags |= kLSLaunchAsync; - clear_signals(); - - ProcessSerialNumber o_psn; - os_result = LSOpenApplication(&appParams, &o_psn); - } - } } @@ -505,73 +419,3 @@ OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) return(result); } - -OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) -{ - OSStatus result = eventNotHandledErr; - OSStatus err; - UInt32 evtClass = GetEventClass(event); - UInt32 evtKind = GetEventKind(event); - WindowRef window = (WindowRef)userdata; - - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand cmd; - err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); - - if(err == noErr) - { - switch(cmd.commandID) - { - case kHICommandOK: - QuitAppModalLoopForWindow(window); - result = noErr; - break; - - case kHICommandCancel: - QuitAppModalLoopForWindow(window); - result = userCanceledErr; - break; - } - } - } - - return(result); -} - -void init_apple_menu(const char* product) -{ - // Load up a proper menu bar. - { - OSStatus err; - IBNibRef nib = NULL; - // NOTE: DO NOT translate or brand this string. It's an internal name in the .nib file, and MUST match exactly. - err = CreateNibReference(CFSTR("SecondLife"), &nib); - - if(err == noErr) - { - // NOTE: DO NOT translate or brand this string. It's an internal name in the .nib file, and MUST match exactly. - SetMenuBarFromNib(nib, CFSTR("MenuBar")); - } - - if(nib != NULL) - { - DisposeNibReference(nib); - } - } - - // Install a handler for 'gurl' AppleEvents. This is how secondlife:// URLs get passed to the viewer. - - if(AEInstallEventHandler('GURL', 'GURL', NewAEEventHandlerUPP(AEGURLHandler),0, false) != noErr) - { - // Couldn't install AppleEvent handler. This error shouldn't be fatal. - llinfos << "Couldn't install 'GURL' AppleEvent handler. Continuing..." << llendl; - } - - // Install a handler for 'quit' AppleEvents. This makes quitting the application from the dock work. - if(AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(AEQuitHandler),0, false) != noErr) - { - // Couldn't install AppleEvent handler. This error shouldn't be fatal. - llinfos << "Couldn't install Quit AppleEvent handler. Continuing..." << llendl; - } -} diff --git a/indra/newview/macutil_Prefix.h b/indra/newview/macutil_Prefix.h index b54a764a62..b8df961cac 100644 --- a/indra/newview/macutil_Prefix.h +++ b/indra/newview/macutil_Prefix.h @@ -32,7 +32,6 @@ * */ -#include #include "fix_macros.h" #undef verify -- cgit v1.2.3 From 7a1593c083a7ed6e3d6589d5dd656354d748b8ce Mon Sep 17 00:00:00 2001 From: Geenz Date: Sat, 29 Dec 2012 07:00:34 -0500 Subject: Added requisite SecondLife.nib file required for compiling the viewer. --- indra/newview/SecondLife.nib | Bin 0 -> 15670 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 indra/newview/SecondLife.nib (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib new file mode 100644 index 0000000000..b2495036a6 Binary files /dev/null and b/indra/newview/SecondLife.nib differ -- cgit v1.2.3 From ddb48d51d996b18063b111faa3b7e709160074d9 Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 1 Jan 2013 11:32:53 -0500 Subject: More things in this commit: - Removed the callback system in favor of simply defining functions in a header to later be implemented in whichever file is most convenient for what we want to do (i.e., calling LLWindow callbacks within LLWindowMacOSX, setting cursors in llwindowmacosx-objc.mm, etc.) - Viewer shutdown now works appropriately - Added a bit of debugging code to test if a key has been handled by the UI or not (useful for tracking down the mystery of the enter key not being handled) - Setup a cocoa quit handler within the application delegate that intercepts any termination requests --- indra/newview/llappviewermacosx-delegate.mm | 18 ++++++++++++---- indra/newview/llappviewermacosx-objc.h | 2 +- indra/newview/llappviewermacosx.cpp | 32 ++++++++++++++--------------- indra/newview/llviewerkeyboard.cpp | 2 +- 4 files changed, 31 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewermacosx-delegate.mm b/indra/newview/llappviewermacosx-delegate.mm index 80cc1010e9..2e25997d32 100644 --- a/indra/newview/llappviewermacosx-delegate.mm +++ b/indra/newview/llappviewermacosx-delegate.mm @@ -23,17 +23,26 @@ frameTimer = nil; setLLNSWindowRef([self window]); - setLLOpenGLViewRef([self glview]); + //setLLOpenGLViewRef([self glview]); if (initViewer()) { - frameTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/60 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; + frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; } else { handleQuit(); } } -- (void) applicationWillTerminate:(NSNotification *)notification +- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender { + if (!runMainLoop()) + { + handleQuit(); + return NSTerminateCancel; + } else { + [frameTimer release]; + cleanupViewer(); + return NSTerminateNow; + } } - (void) mainLoop @@ -42,7 +51,8 @@ if (appExiting) { [frameTimer release]; - handleQuit(); + cleanupViewer(); + [[NSApplication sharedApplication] terminate:self]; } } diff --git a/indra/newview/llappviewermacosx-objc.h b/indra/newview/llappviewermacosx-objc.h index 9ece6a1a6a..ed9017ca5d 100644 --- a/indra/newview/llappviewermacosx-objc.h +++ b/indra/newview/llappviewermacosx-objc.h @@ -16,4 +16,4 @@ bool initViewer(); void handleQuit(); bool runMainLoop(); void initMainLoop(); -void destroyMainLoop(); \ No newline at end of file +void cleanupViewer(); \ No newline at end of file diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index a1c8b7699d..6e7b91347b 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -55,15 +55,6 @@ namespace char** gArgV; LLAppViewerMacOSX* gViewerAppPtr; - - OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) - { - OSErr result = noErr; - - LLAppViewer::instance()->userQuit(); - - return(result); - } } bool initViewer() @@ -95,26 +86,33 @@ bool initViewer() void handleQuit() { - if(!LLApp::isError()) - { - gViewerAppPtr->cleanup(); - } - - delete gViewerAppPtr; - gViewerAppPtr = NULL; + LLAppViewer::instance()->userQuit(); } bool runMainLoop() { bool ret = LLApp::isQuitting(); - if (!ret) + if (!ret && gViewerAppPtr != NULL) { ret = gViewerAppPtr->mainLoop(); + } else { + ret = true; } return ret; } +void cleanupViewer() +{ + if(!LLApp::isError()) + { + gViewerAppPtr->cleanup(); + } + + delete gViewerAppPtr; + gViewerAppPtr = NULL; +} + int main( int argc, char **argv ) { // Store off the command line args for use later. diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 6d91dad70e..92d8f2937e 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -654,7 +654,6 @@ BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode) BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL repeated) { LL_INFOS("Keyboard Handling") << "Handling key " << translated_key << LL_ENDL; - LL_INFOS("Keyboard Handling") << "Keyboard has focus? " << gFocusMgr.getKeyboardFocus() << LL_ENDL; // check for re-map EKeyboardMode mode = gViewerKeyboard.getMode(); U32 keyidx = (translated_mask<<16) | translated_key; @@ -677,6 +676,7 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL if(mKeysSkippedByUI.find(translated_key) != mKeysSkippedByUI.end()) { mKeyHandledByUI[translated_key] = FALSE; + LL_INFOS("Keyboard Handling") << "Key wasn't handled by UI!" << LL_ENDL; } else { -- cgit v1.2.3 From 2b0f50dd821848d18ab35095623c3bdbcdeb910c Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 2 Jan 2013 15:57:21 -0500 Subject: Crash on exit fix + general code cleanup in LLWindowMacOSX. --- indra/newview/llappviewermacosx-delegate.mm | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewermacosx-delegate.mm b/indra/newview/llappviewermacosx-delegate.mm index 2e25997d32..5c54736993 100644 --- a/indra/newview/llappviewermacosx-delegate.mm +++ b/indra/newview/llappviewermacosx-delegate.mm @@ -51,7 +51,6 @@ if (appExiting) { [frameTimer release]; - cleanupViewer(); [[NSApplication sharedApplication] terminate:self]; } } -- cgit v1.2.3 From 966a4c893c816fc699580092bd6e93a0e514798c Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 2 Jan 2013 16:16:07 -0500 Subject: OS X crash on startup fix: always ensure that mMainLoopInitialized is initialized properly within LLAppViewer::init(). Otherwise, the viewer will sporadically crash on start up. --- indra/newview/llappviewer.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6a87f7306d..131f4c4031 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -676,6 +676,11 @@ bool LLAppViewer::init() // we run the "program crashed last time" error handler below. // LLFastTimer::reset(); + + +#ifdef LL_DARWIN + mMainLoopInitialized = false; +#endif // initialize SSE options LLVector4a::initClass(); @@ -1196,7 +1201,9 @@ LLMemType mt1(LLMemType::MTYPE_MAIN); bool LLAppViewer::mainLoop() { +#ifdef LL_DARWIN if (!mMainLoopInitialized) +#endif { mMainloopTimeout = new LLWatchdogTimeout(); @@ -1218,13 +1225,16 @@ bool LLAppViewer::mainLoop() joystick = LLViewerJoystick::getInstance(); joystick->setNeedsReset(true); - - // As we do not (yet) send data on the mainloop LLEventPump that varies - // with each frame, no need to instantiate a new LLSD event object each - // time. Obviously, if that changes, just instantiate the LLSD at the - // point of posting. +#ifdef LL_DARWIN + // Ensure that this section of code never gets called again on OS X. mMainLoopInitialized = true; +#endif } + // As we do not (yet) send data on the mainloop LLEventPump that varies + // with each frame, no need to instantiate a new LLSD event object each + // time. Obviously, if that changes, just instantiate the LLSD at the + // point of posting. + LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); LLSD newFrame; -- cgit v1.2.3 From 9ce3ab1a5248423eeea4d843bfb8407ed62b305e Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 2 Jan 2013 18:53:44 -0500 Subject: Fixed the enter and return keys not being sent appropriately as unicode characters. --- indra/newview/SecondLife.nib | Bin 15670 -> 15670 bytes indra/newview/SecondLife.xib | 2 +- indra/newview/llappviewermacosx-delegate.h | 2 -- indra/newview/llappviewermacosx-delegate.mm | 3 +-- 4 files changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index b2495036a6..cd69b1b812 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 2fc83bd009..212bc5830d 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -1787,7 +1787,7 @@ - 852 + 864 diff --git a/indra/newview/llappviewermacosx-delegate.h b/indra/newview/llappviewermacosx-delegate.h index ac234c14be..848ccbde62 100644 --- a/indra/newview/llappviewermacosx-delegate.h +++ b/indra/newview/llappviewermacosx-delegate.h @@ -12,12 +12,10 @@ @interface LLAppDelegate : NSObject { LLNSWindow *window; - LLOpenGLView *glview; NSTimer *frameTimer; } @property (assign) IBOutlet LLNSWindow *window; -@property (assign) IBOutlet LLOpenGLView *glview; - (void) mainLoop; diff --git a/indra/newview/llappviewermacosx-delegate.mm b/indra/newview/llappviewermacosx-delegate.mm index 5c54736993..7baeeb1de8 100644 --- a/indra/newview/llappviewermacosx-delegate.mm +++ b/indra/newview/llappviewermacosx-delegate.mm @@ -11,7 +11,6 @@ @implementation LLAppDelegate @synthesize window; -@synthesize glview; - (void)dealloc { @@ -23,7 +22,7 @@ frameTimer = nil; setLLNSWindowRef([self window]); - //setLLOpenGLViewRef([self glview]); + if (initViewer()) { frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; -- cgit v1.2.3 From 09b07e3619a71f142c1a3af41244d756e1230142 Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 8 Jan 2013 16:22:54 -0500 Subject: Big change set: - LLAppDelegate header relocated to LLWindow. Definition is still present in secondlife-bin (for compatibility reasons when loading a nib). - Return key handling fixed. - Command key now acts the same as the control key by issuing control character codes when the command key is pressed. - We now retrieve the window pointer directly from the app delegate in LLWindow. --- indra/newview/CMakeLists.txt | 8 ++-- indra/newview/llappdelegate-objc.mm | 55 ++++++++++++++++++++++++++++ indra/newview/llappviewermacosx-delegate.h | 22 ----------- indra/newview/llappviewermacosx-delegate.mm | 57 ----------------------------- indra/newview/llappviewermacosx-objc.h | 19 ---------- indra/newview/llappviewermacosx-objc.mm | 20 ---------- indra/newview/llappviewermacosx.cpp | 2 +- 7 files changed, 60 insertions(+), 123 deletions(-) create mode 100644 indra/newview/llappdelegate-objc.mm delete mode 100644 indra/newview/llappviewermacosx-delegate.h delete mode 100644 indra/newview/llappviewermacosx-delegate.mm delete mode 100644 indra/newview/llappviewermacosx-objc.h delete mode 100644 indra/newview/llappviewermacosx-objc.mm (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 73f5ecc38c..c60940f93c 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1231,10 +1231,9 @@ source_group("CMake Rules" FILES ViewerInstall.cmake) if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) - LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.h) - LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.mm) - LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-delegate.h) - LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-delegate.mm) + + # This should be compiled with the viewer. + LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) @@ -1532,6 +1531,7 @@ if (FMOD) if (DARWIN) set(fmodwrapper_SOURCE_FILES fmodwrapper.cpp) add_library(fmodwrapper SHARED ${fmodwrapper_SOURCE_FILES}) + find_library(CARBON_LIBRARY Carbon) set(fmodwrapper_needed_LIBRARIES ${FMOD_LIBRARY} ${CARBON_LIBRARY}) set_target_properties( fmodwrapper diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm new file mode 100644 index 0000000000..f5143d7578 --- /dev/null +++ b/indra/newview/llappdelegate-objc.mm @@ -0,0 +1,55 @@ +// +// LLAppDelegate.m +// SecondLife +// +// Created by Geenz on 12/16/12. +// +// + +#import "llappdelegate-objc.h" + +@implementation LLAppDelegate + +@synthesize window; + +- (void)dealloc +{ + [super dealloc]; +} + +- (void) applicationDidFinishLaunching:(NSNotification *)notification +{ + frameTimer = nil; + + if (initViewer()) + { + frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; + } else { + handleQuit(); + } +} + +- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +{ + if (!runMainLoop()) + { + handleQuit(); + return NSTerminateCancel; + } else { + [frameTimer release]; + cleanupViewer(); + return NSTerminateNow; + } +} + +- (void) mainLoop +{ + bool appExiting = runMainLoop(); + if (appExiting) + { + [frameTimer release]; + [[NSApplication sharedApplication] terminate:self]; + } +} + +@end diff --git a/indra/newview/llappviewermacosx-delegate.h b/indra/newview/llappviewermacosx-delegate.h deleted file mode 100644 index 848ccbde62..0000000000 --- a/indra/newview/llappviewermacosx-delegate.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// LLAppDelegate.h -// SecondLife -// -// Created by Geenz on 12/16/12. -// -// - -#import -#import "llopenglview-objc.h" -#include "llappviewermacosx-objc.h" - -@interface LLAppDelegate : NSObject { - LLNSWindow *window; - NSTimer *frameTimer; -} - -@property (assign) IBOutlet LLNSWindow *window; - -- (void) mainLoop; - -@end diff --git a/indra/newview/llappviewermacosx-delegate.mm b/indra/newview/llappviewermacosx-delegate.mm deleted file mode 100644 index 7baeeb1de8..0000000000 --- a/indra/newview/llappviewermacosx-delegate.mm +++ /dev/null @@ -1,57 +0,0 @@ -// -// LLAppDelegate.m -// SecondLife -// -// Created by Geenz on 12/16/12. -// -// - -#import "llappviewermacosx-delegate.h" - -@implementation LLAppDelegate - -@synthesize window; - -- (void)dealloc -{ - [super dealloc]; -} - -- (void) applicationDidFinishLaunching:(NSNotification *)notification -{ - frameTimer = nil; - - setLLNSWindowRef([self window]); - - if (initViewer()) - { - frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; - } else { - handleQuit(); - } -} - -- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender -{ - if (!runMainLoop()) - { - handleQuit(); - return NSTerminateCancel; - } else { - [frameTimer release]; - cleanupViewer(); - return NSTerminateNow; - } -} - -- (void) mainLoop -{ - bool appExiting = runMainLoop(); - if (appExiting) - { - [frameTimer release]; - [[NSApplication sharedApplication] terminate:self]; - } -} - -@end diff --git a/indra/newview/llappviewermacosx-objc.h b/indra/newview/llappviewermacosx-objc.h deleted file mode 100644 index ed9017ca5d..0000000000 --- a/indra/newview/llappviewermacosx-objc.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// NSObject_llappviewermacosx_objc.h -// SecondLife -// -// Created by Geenz on 12/16/12. -// -// - -#include -typedef std::tr1::function VoidCallback; -typedef void* ViewerAppRef; - -int createNSApp(int argc, const char **argv); - -bool initViewer(); -void handleQuit(); -bool runMainLoop(); -void initMainLoop(); -void cleanupViewer(); \ No newline at end of file diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm deleted file mode 100644 index ca2090b790..0000000000 --- a/indra/newview/llappviewermacosx-objc.mm +++ /dev/null @@ -1,20 +0,0 @@ -// -// llappviewermacosx.m -// SecondLife -// -// Created by Geenz on 12/12/12. -// -// - -#import -#import -#include "llappviewermacosx-objc.h" -#import "llappviewermacosx-delegate.h" - -int createNSApp(int argc, const char *argv[]) -{ - return NSApplicationMain(argc, argv); -} - - - diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 6e7b91347b..b199405a66 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -31,7 +31,7 @@ #endif #include "llappviewermacosx.h" -#include "llappviewermacosx-objc.h" +#include "llwindowmacosx-objc.h" #include "llcommandlineparser.h" #include "llmemtype.h" -- cgit v1.2.3 From da90fe352847d5f27358179cb4cdf88abc40a4af Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 15 Jan 2013 05:46:31 -0500 Subject: This *should* put an end to our modifier key woes. --- indra/newview/SecondLife.nib | Bin 15670 -> 8541 bytes indra/newview/SecondLife.xib | 957 ++----------------------------------------- 2 files changed, 39 insertions(+), 918 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index cd69b1b812..ca89033300 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 212bc5830d..b4e77279fd 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -193,29 +193,6 @@ - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - YES @@ -235,52 +212,6 @@ - - - Save… - s - 1048576 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - @@ -350,23 +281,6 @@ - - - Paste and Match Style - V - 1572864 - 2147483647 - - - - - - Delete - - 2147483647 - - - Select All @@ -376,303 +290,6 @@ - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find and Replace… - f - 1572864 - 2147483647 - - - 12 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1048576 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling - - - - Show Spelling and Grammar - : - 1048576 - 2147483647 - - - - - - Check Document Now - ; - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - Correct Spelling Automatically - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - - - Show Substitutions - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Smart Copy/Paste - - 2147483647 - - - - - - Smart Quotes - - 2147483647 - - - - - - Smart Dashes - - 2147483647 - - - - - - Smart Links - - 2147483647 - - - - - - Data Detectors - - 2147483647 - - - - - - Text Replacement - - 2147483647 - - - - - - - - - Transformations - - 2147483647 - - - submenuAction: - - Transformations - - - - Make Upper Case - - 2147483647 - - - - - - Make Lower Case - - 2147483647 - - - - - - Capitalize - - 2147483647 - - - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - @@ -776,13 +393,10 @@ {1024, 768} - + 256 {1024, 768} - - - _NS:20 {{0, 0}, {1920, 1178}} @@ -834,30 +448,6 @@ 39 - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - performClose: @@ -882,22 +472,6 @@ 360 - - - saveDocument: - - - - 362 - - - - revertDocumentToSaved: - - - - 364 - hide: @@ -938,38 +512,6 @@ 769 - - - toggleSmartInsertDelete: - - - - 770 - - - - toggleAutomaticDashSubstitution: - - - - 773 - - - - toggleContinuousSpellChecking: - - - - 774 - - - - toggleAutomaticDataDetection: - - - - 775 - undo: @@ -978,30 +520,6 @@ 776 - - - startSpeaking: - - - - 778 - - - - showGuessPanel: - - - - 779 - - - - checkSpelling: - - - - 780 - copy: @@ -1010,14 +528,6 @@ 782 - - - delete: - - - - 783 - selectAll: @@ -1026,38 +536,6 @@ 785 - - - stopSpeaking: - - - - 786 - - - - orderFrontSubstitutionsPanel: - - - - 787 - - - - toggleAutomaticTextReplacement: - - - - 788 - - - - toggleAutomaticSpellingCorrection: - - - - 790 - toggleFullScreen: @@ -1150,85 +628,18 @@ 81 - - - - - - - - 75 - - - - - 78 - - - - - 72 - - - - - 82 - - - - - 124 - - - - - - - - 77 - - - 73 - - 79 - - - - - 112 - - - - - 74 - - - - - 125 - - - - - - - - 126 - - - 106 @@ -1373,33 +784,10 @@ - - - - - - - - - - 713 - - - - - 714 - - - - - 715 - - - 716 @@ -1415,251 +803,11 @@ - - 719 - - - - - 720 - - - 721 - - 722 - - - - - 723 - - - - - - - - 724 - - - - - - - - 725 - - - - - - - - 726 - - - - - - - - 727 - - - - - - - - 738 - - - - - - - - - 739 - - - - - 740 - - - - - 741 - - - - - - - - - - 742 - - - - - 743 - - - - - 744 - - - - - 745 - - - - - - - - - - - - - - - 746 - - - - - 747 - - - - - 748 - - - - - 749 - - - - - 750 - - - - - 751 - - - - - 752 - - - - - 753 - - - - - 754 - - - - - - - - - - - - - 755 - - - - - 756 - - - - - 757 - - - - - 758 - - - - - 759 - - - - - 760 - - - - - 761 - - - - - - - - - - - - - 762 - - - - - 763 - - - - - 764 - - - - - 765 - - - - - 766 - - - - - 821 - - - 824 @@ -1684,6 +832,36 @@ + + 713 + + + + + 714 + + + + + 715 + + + + + 82 + + + + + 79 + + + + + 72 + + + @@ -1693,10 +871,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1725,54 +899,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1794,20 +926,17 @@ LLAppDelegate NSObject - - LLOpenGLView - LLNSWindow - - - - glview - LLOpenGLView - - + + window + LLNSWindow + + + window + window LLNSWindow - + IBProjectSource ./Classes/LLAppDelegate.h @@ -1821,14 +950,6 @@ ./Classes/LLNSWindow.h - - LLOpenGLView - NSOpenGLView - - IBProjectSource - ./Classes/LLOpenGLView.h - - 0 -- cgit v1.2.3 From 9557a26c623f01f662b8d3dd5b933285b7bfaeb1 Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 15 Jan 2013 16:34:54 -0500 Subject: OS X 10.7+'s Autosave functionality now handles window restoration. --- indra/newview/SecondLife.nib | Bin 8541 -> 8573 bytes indra/newview/SecondLife.xib | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index ca89033300..0d59d59bb2 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index b4e77279fd..b02d04e0d2 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -393,15 +393,19 @@ {1024, 768} - + 256 {1024, 768} + + + _NS:20 {{0, 0}, {1920, 1178}} {1024, 790} {10000000000000, 10000000000000} + Second Life 128 YES -- cgit v1.2.3 From 29e747c4f17818816c502a3aa653b828e689be4a Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 22 Jan 2013 15:37:01 -0500 Subject: And thus, the demonic mouse position conversions from view space to screen space were tamed. --- indra/newview/llappviewermacosx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index b199405a66..6e0becb518 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -41,7 +41,7 @@ #include "llmd5.h" #include "llfloaterworldmap.h" #include "llurldispatcher.h" -#include +#include #include "lldir.h" #include #include // for systemwide mute -- cgit v1.2.3 From c52e6f9c597c67637045134d808a9039f85efc5c Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 23 Jan 2013 09:29:32 -0500 Subject: Refactor the key input handling to make it easier to filter out keys we don't need unicode characters for (such as the arrow keys). --- indra/newview/llappdelegate-objc.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index f5143d7578..9bb10f3204 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -29,6 +29,16 @@ } } +- (void) applicationDidBecomeActive:(NSNotification *)notification +{ + +} + +- (void) applicationDidResignActive:(NSNotification *)notification +{ + +} + - (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender { if (!runMainLoop()) -- cgit v1.2.3 From ab4af5d564c2e54a087967f352b09f4ebc55cab3 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 23 Jan 2013 11:01:47 -0500 Subject: Readd event handling for application focus. --- indra/newview/llappdelegate-objc.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 9bb10f3204..9e0e0e35c5 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -31,12 +31,12 @@ - (void) applicationDidBecomeActive:(NSNotification *)notification { - + callWindowFocus(); } - (void) applicationDidResignActive:(NSNotification *)notification { - + callWindowUnfocus(); } - (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender -- cgit v1.2.3 From 3f9a1da04273a2a3eb87b524541232a04545289b Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Wed, 23 Jan 2013 10:41:52 -0800 Subject: Recovered changes for dirpicker and filepicker --- indra/newview/CMakeLists.txt | 2 + indra/newview/lldirpicker.cpp | 142 ++---------- indra/newview/lldirpicker.h | 13 +- indra/newview/llfilepicker.cpp | 510 ++++++++++++++--------------------------- indra/newview/llfilepicker.h | 16 +- 5 files changed, 195 insertions(+), 488 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dff2c04fbc..4c5bfbc820 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1231,6 +1231,8 @@ source_group("CMake Rules" FILES ViewerInstall.cmake) if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) + LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm) + LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 1e03582a29..c068011421 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -37,7 +37,7 @@ #include "llwindow.h" // beforeDialog() #include "llviewercontrol.h" -#if LL_LINUX || LL_SOLARIS +#if LL_LINUX || LL_SOLARIS || LL_DARWIN # include "llfilepicker.h" #endif @@ -147,152 +147,36 @@ std::string LLDirPicker::getDirName() #elif LL_DARWIN LLDirPicker::LLDirPicker() : - mFileName(NULL), - mLocked(false) +mFileName(NULL), +mLocked(false) { + mFilePicker = new LLFilePicker(); reset(); - - memset(&mNavOptions, 0, sizeof(mNavOptions)); - OSStatus error = NavGetDefaultDialogCreationOptions(&mNavOptions); - if (error == noErr) - { - mNavOptions.modality = kWindowModalityAppModal; - } } LLDirPicker::~LLDirPicker() { - // nothing + delete mFilePicker; } -//static -pascal void LLDirPicker::doNavCallbackEvent(NavEventCallbackMessage callBackSelector, - NavCBRecPtr callBackParms, void* callBackUD) +void LLDirPicker::reset() { - switch(callBackSelector) - { - case kNavCBStart: - { - if (!sInstance.mFileName) break; - - OSStatus error = noErr; - AEDesc theLocation = {typeNull, NULL}; - FSSpec outFSSpec; - - //Convert string to a FSSpec - FSRef myFSRef; - - const char* filename=sInstance.mFileName->c_str(); - - error = FSPathMakeRef ((UInt8*)filename, &myFSRef, NULL); - - if (error != noErr) break; - - error = FSGetCatalogInfo (&myFSRef, kFSCatInfoNone, NULL, NULL, &outFSSpec, NULL); - - if (error != noErr) break; - - error = AECreateDesc(typeFSS, &outFSSpec, sizeof(FSSpec), &theLocation); - - if (error != noErr) break; - - error = NavCustomControl(callBackParms->context, - kNavCtlSetLocation, (void*)&theLocation); - - } - } + if (mFilePicker) + mFilePicker->reset(); } -OSStatus LLDirPicker::doNavChooseDialog() -{ - OSStatus error = noErr; - NavDialogRef navRef = NULL; - NavReplyRecord navReply; - - memset(&navReply, 0, sizeof(navReply)); - - // NOTE: we are passing the address of a local variable here. - // This is fine, because the object this call creates will exist for less than the lifetime of this function. - // (It is destroyed by NavDialogDispose() below.) - - error = NavCreateChooseFolderDialog(&mNavOptions, &doNavCallbackEvent, NULL, NULL, &navRef); - - gViewerWindow->getWindow()->beforeDialog(); - - if (error == noErr) - error = NavDialogRun(navRef); - - gViewerWindow->getWindow()->afterDialog(); - - if (error == noErr) - error = NavDialogGetReply(navRef, &navReply); - - if (navRef) - NavDialogDispose(navRef); - - if (error == noErr && navReply.validRecord) - { - FSRef fsRef; - AEKeyword theAEKeyword; - DescType typeCode; - Size actualSize = 0; - char path[LL_MAX_PATH]; /*Flawfinder: ignore*/ - - memset(&fsRef, 0, sizeof(fsRef)); - error = AEGetNthPtr(&navReply.selection, 1, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); - - if (error == noErr) - error = FSRefMakePath(&fsRef, (UInt8*) path, sizeof(path)); - - if (error == noErr) - mDir = path; - } - - return error; -} +//static BOOL LLDirPicker::getDir(std::string* filename) { - if( mLocked ) return FALSE; - BOOL success = FALSE; - OSStatus error = noErr; - - // if local file browsing is turned off, return without opening dialog - if ( check_local_file_access_enabled() == false ) - { - return FALSE; - } - - mFileName = filename; - -// mNavOptions.saveFileName - - // Modal, so pause agent - send_agent_pause(); - { - error = doNavChooseDialog(); - } - send_agent_resume(); - if (error == noErr) - { - if (mDir.length() > 0) - success = true; - } - - // Account for the fact that the app has been stalled. - LLFrameTimer::updateFrameTime(); - return success; + LLFilePicker::ELoadFilter filter=LLFilePicker::FFLOAD_DIRECTORY; + + return mFilePicker->getOpenFile(filter, true); } std::string LLDirPicker::getDirName() { - return mDir; -} - -void LLDirPicker::reset() -{ - mLocked = false; - mDir.clear(); + return mFilePicker->getFirstFile(); } #elif LL_LINUX || LL_SOLARIS diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 682f9d6476..9cc62431ef 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -34,11 +34,10 @@ #include "stdtypes.h" #if LL_DARWIN -#include // AssertMacros.h does bad things. -#include "fix_macros.h" #undef verify +#undef check #undef require #include @@ -77,15 +76,7 @@ private: void buildDirname( void ); bool check_local_file_access_enabled(); -#if LL_DARWIN - NavDialogCreationOptions mNavOptions; - static pascal void doNavCallbackEvent(NavEventCallbackMessage callBackSelector, - NavCBRecPtr callBackParms, void* callBackUD); - OSStatus doNavChooseDialog(); - -#endif - -#if LL_LINUX || LL_SOLARIS +#if LL_LINUX || LL_SOLARIS || LL_DARWIN // On Linux we just implement LLDirPicker on top of LLFilePicker LLFilePicker *mFilePicker; #endif diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 4bf5b26b3b..4e68d874c3 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -62,6 +62,11 @@ LLFilePicker LLFilePicker::sInstance; #define DICTIONARY_FILTER L"Dictionary files (*.dic; *.xcu)\0*.dic;*.xcu\0" #endif +#ifdef LL_DARWIN +#include "llfilepicker_mac.h" +//#include +#endif + // // Implementation // @@ -94,14 +99,6 @@ LLFilePicker::LLFilePicker() mFilesW[0] = '\0'; #endif -#if LL_DARWIN - memset(&mNavOptions, 0, sizeof(mNavOptions)); - OSStatus error = NavGetDefaultDialogCreationOptions(&mNavOptions); - if (error == noErr) - { - mNavOptions.modality = kWindowModalityAppModal; - } -#endif } LLFilePicker::~LLFilePicker() @@ -546,369 +543,197 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) #elif LL_DARWIN -Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode) +std::vector* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode) { - Boolean result = true; - ELoadFilter filter = *((ELoadFilter*) callBackUD); - OSStatus error = noErr; - - if (filterMode == kNavFilteringBrowserList && filter != FFLOAD_ALL && (theItem->descriptorType == typeFSRef || theItem->descriptorType == typeFSS)) - { - // navInfo is only valid for typeFSRef and typeFSS - NavFileOrFolderInfo *navInfo = (NavFileOrFolderInfo*) info; - if (!navInfo->isFolder) - { - AEDesc desc; - error = AECoerceDesc(theItem, typeFSRef, &desc); - if (error == noErr) - { - FSRef fileRef; - error = AEGetDescData(&desc, &fileRef, sizeof(fileRef)); - if (error == noErr) - { - LSItemInfoRecord fileInfo; - error = LSCopyItemInfoForRef(&fileRef, kLSRequestExtension | kLSRequestTypeCreator, &fileInfo); - if (error == noErr) - { - if (filter == FFLOAD_IMAGE) - { - if (fileInfo.filetype != 'JPEG' && fileInfo.filetype != 'JPG ' && - fileInfo.filetype != 'BMP ' && fileInfo.filetype != 'TGA ' && - fileInfo.filetype != 'BMPf' && fileInfo.filetype != 'TPIC' && - fileInfo.filetype != 'PNG ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("jpeg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("jpg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("bmp"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("tga"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("png"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_WAV) - { - if (fileInfo.filetype != 'WAVE' && fileInfo.filetype != 'WAV ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("wave"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("wav"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_ANIM) - { - if (fileInfo.filetype != 'BVH ' && - fileInfo.filetype != 'ANIM' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) && - fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("anim"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_COLLADA) - { - if (fileInfo.filetype != 'DAE ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dae"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } + std::vector *allowedv = new std::vector< std::string >; + switch(filter) + { + case FFLOAD_ALL: + allowedv->push_back("wav"); + allowedv->push_back("bvh"); + allowedv->push_back("anim"); + allowedv->push_back("dae"); + allowedv->push_back("raw"); + allowedv->push_back("lsl"); + allowedv->push_back("dic"); + allowedv->push_back("xcu"); + case FFLOAD_IMAGE: + allowedv->push_back("jpg"); + allowedv->push_back("jpeg"); + allowedv->push_back("bmp"); + allowedv->push_back("tga"); + allowedv->push_back("bmpf"); + allowedv->push_back("tpic"); + allowedv->push_back("png"); + break; + case FFLOAD_WAV: + allowedv->push_back("wav"); + break; + case FFLOAD_ANIM: + allowedv->push_back("bvh"); + allowedv->push_back("anim"); + break; + case FFLOAD_COLLADA: + allowedv->push_back("dae"); + break; #ifdef _CORY_TESTING - else if (filter == FFLOAD_GEOMETRY) - { - if (fileInfo.filetype != 'SLG ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("slg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } + case FFLOAD_GEOMETRY: + allowedv->push_back("slg"); + break; #endif - else if (filter == FFLOAD_SLOBJECT) - { - llwarns << "*** navOpenFilterProc: FFLOAD_SLOBJECT NOT IMPLEMENTED ***" << llendl; - } - else if (filter == FFLOAD_RAW) - { - if (fileInfo.filetype != '\?\?\?\?' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("raw"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_SCRIPT) - { - if (fileInfo.filetype != 'LSL ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("lsl"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) ) - { - result = false; - } - } - else if (filter == FFLOAD_DICTIONARY) - { - if (fileInfo.filetype != 'DIC ' && - fileInfo.filetype != 'XCU ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dic"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) && - fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("xcu"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))) - { - result = false; - } - } - - if (fileInfo.extension) - { - CFRelease(fileInfo.extension); - } - } - } - AEDisposeDesc(&desc); - } - } - } - return result; + case FFLOAD_RAW: + allowedv->push_back("raw"); + break; + case FFLOAD_SCRIPT: + allowedv->push_back("lsl"); + break; + case FFLOAD_DICTIONARY: + allowedv->push_back("dic"); + allowedv->push_back("xcu"); + break; + case FFLOAD_DIRECTORY: + break; + default: + llwarns << "Unsupported format." << llendl; + } + + return allowedv; } -OSStatus LLFilePicker::doNavChooseDialog(ELoadFilter filter) +bool LLFilePicker::doNavChooseDialog(ELoadFilter filter) { - OSStatus error = noErr; - NavDialogRef navRef = NULL; - NavReplyRecord navReply; - // if local file browsing is turned off, return without opening dialog if ( check_local_file_access_enabled() == false ) { - return FALSE; + return false; } - - memset(&navReply, 0, sizeof(navReply)); - - // NOTE: we are passing the address of a local variable here. - // This is fine, because the object this call creates will exist for less than the lifetime of this function. - // (It is destroyed by NavDialogDispose() below.) - error = NavCreateChooseFileDialog(&mNavOptions, NULL, NULL, NULL, navOpenFilterProc, (void*)(&filter), &navRef); - + gViewerWindow->getWindow()->beforeDialog(); - - if (error == noErr) - error = NavDialogRun(navRef); + + std::vector *allowed_types=navOpenFilterProc(filter); + + std::vector *filev = doLoadDialog(allowed_types, + mPickOptions); gViewerWindow->getWindow()->afterDialog(); - if (error == noErr) - error = NavDialogGetReply(navRef, &navReply); - if (navRef) - NavDialogDispose(navRef); - - if (error == noErr && navReply.validRecord) - { - SInt32 count = 0; - SInt32 index; - - // AE indexes are 1 based... - error = AECountItems(&navReply.selection, &count); - for (index = 1; index <= count; index++) - { - FSRef fsRef; - AEKeyword theAEKeyword; - DescType typeCode; - Size actualSize = 0; - char path[MAX_PATH]; /*Flawfinder: ignore*/ - - memset(&fsRef, 0, sizeof(fsRef)); - error = AEGetNthPtr(&navReply.selection, index, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); - - if (error == noErr) - error = FSRefMakePath(&fsRef, (UInt8*) path, sizeof(path)); - - if (error == noErr) - mFiles.push_back(std::string(path)); - } - } + if (filev && filev->size() > 0) + { + mFiles.insert(mFiles.end(), filev->begin(), filev->end()); + return true; + } - return error; + return false; } -OSStatus LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename) +bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename) { - OSStatus error = noErr; - NavDialogRef navRef = NULL; - NavReplyRecord navReply; - - memset(&navReply, 0, sizeof(navReply)); // Setup the type, creator, and extension - OSType type, creator; - CFStringRef extension = NULL; + std::string extension, type, creator; + switch (filter) { case FFSAVE_WAV: - type = 'WAVE'; - creator = 'TVOD'; - extension = CFSTR(".wav"); + type = "WAVE"; + creator = "TVOD"; + extension = "wav"; break; case FFSAVE_TGA: - type = 'TPIC'; - creator = 'prvw'; - extension = CFSTR(".tga"); + type = "TPIC"; + creator = "prvw"; + extension = "tga"; break; case FFSAVE_BMP: - type = 'BMPf'; - creator = 'prvw'; - extension = CFSTR(".bmp"); + type = "BMPf"; + creator = "prvw"; + extension = "bmp"; break; case FFSAVE_JPEG: - type = 'JPEG'; - creator = 'prvw'; - extension = CFSTR(".jpeg"); + type = "JPEG"; + creator = "prvw"; + extension = "jpeg"; break; case FFSAVE_PNG: - type = 'PNG '; - creator = 'prvw'; - extension = CFSTR(".png"); + type = "PNG "; + creator = "prvw"; + extension = "png"; break; case FFSAVE_AVI: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".mov"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "mov"; break; case FFSAVE_ANIM: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".xaf"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "xaf"; break; #ifdef _CORY_TESTING case FFSAVE_GEOMETRY: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".slg"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "slg"; break; #endif case FFSAVE_RAW: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".raw"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "raw"; break; case FFSAVE_J2C: - type = '\?\?\?\?'; - creator = 'prvw'; - extension = CFSTR(".j2c"); + type = "\?\?\?\?"; + creator = "prvw"; + extension = "j2c"; break; case FFSAVE_SCRIPT: - type = 'LSL '; - creator = '\?\?\?\?'; - extension = CFSTR(".lsl"); + type = "LSL "; + creator = "\?\?\?\?"; + extension = "lsl"; break; case FFSAVE_ALL: default: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(""); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = ""; break; } - // Create the dialog - error = NavCreatePutFileDialog(&mNavOptions, type, creator, NULL, NULL, &navRef); - if (error == noErr) - { - CFStringRef nameString = NULL; - bool hasExtension = true; - - // Create a CFString of the initial file name - if (!filename.empty()) - nameString = CFStringCreateWithCString(NULL, filename.c_str(), kCFStringEncodingUTF8); - else - nameString = CFSTR("Untitled"); - - // Add the extension if one was not provided - if (nameString && !CFStringHasSuffix(nameString, extension)) - { - CFStringRef tempString = nameString; - hasExtension = false; - nameString = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@%@"), tempString, extension); - CFRelease(tempString); - } - - // Set the name in the dialog - if (nameString) - { - error = NavDialogSetSaveFileName(navRef, nameString); - CFRelease(nameString); - } - else - { - error = paramErr; - } - } - + std::string namestring = filename; + if (namestring.empty()) namestring="Untitled"; + +// if (! boost::algorithm::ends_with(namestring, extension) ) +// { +// namestring = namestring + "." + extension; +// +// } + gViewerWindow->getWindow()->beforeDialog(); // Run the dialog - if (error == noErr) - error = NavDialogRun(navRef); + std::string* filev = doSaveDialog(&namestring, + &type, + &creator, + &extension, + mPickOptions); gViewerWindow->getWindow()->afterDialog(); - if (error == noErr) - error = NavDialogGetReply(navRef, &navReply); - - if (navRef) - NavDialogDispose(navRef); - - if (error == noErr && navReply.validRecord) + if ( filev && !filev->empty() ) { - SInt32 count = 0; - - // AE indexes are 1 based... - error = AECountItems(&navReply.selection, &count); - if (count > 0) - { - // Get the FSRef to the containing folder - FSRef fsRef; - AEKeyword theAEKeyword; - DescType typeCode; - Size actualSize = 0; - - memset(&fsRef, 0, sizeof(fsRef)); - error = AEGetNthPtr(&navReply.selection, 1, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); - - if (error == noErr) - { - char path[PATH_MAX]; /*Flawfinder: ignore*/ - char newFileName[SINGLE_FILENAME_BUFFER_SIZE]; /*Flawfinder: ignore*/ - - error = FSRefMakePath(&fsRef, (UInt8*)path, PATH_MAX); - if (error == noErr) - { - if (CFStringGetCString(navReply.saveFileName, newFileName, sizeof(newFileName), kCFStringEncodingUTF8)) - { - mFiles.push_back(std::string(path) + "/" + std::string(newFileName)); - } - else - { - error = paramErr; - } - } - else - { - error = paramErr; - } - } - } - } + mFiles.push_back(*filev); + return true; + } - return error; + return false; } BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) @@ -924,16 +749,21 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) return FALSE; } - OSStatus error = noErr; - reset(); - mNavOptions.optionFlags &= ~kNavAllowMultipleFiles; + mPickOptions &= ~F_MULTIPLE; + mPickOptions |= F_FILE; + + if (filter == FFLOAD_DIRECTORY) //This should only be called from lldirpicker. + { + + mPickOptions |= ( F_NAV_SUPPORT | F_DIRECTORY ); + mPickOptions &= ~F_FILE; + } if(filter == FFLOAD_ALL) // allow application bundles etc. to be traversed; important for DEV-16869, but generally useful { - // mNavOptions.optionFlags |= kNavAllowOpenPackages; - mNavOptions.optionFlags |= kNavSupportPackages; + mPickOptions &= F_NAV_SUPPORT; } if (blocking) @@ -942,14 +772,13 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) send_agent_pause(); } + + success = doNavChooseDialog(filter); + + if (success) { - error = doNavChooseDialog(filter); - } - - if (error == noErr) - { - if (getFileCount()) - success = true; + if (!getFileCount()) + success = false; } if (blocking) @@ -975,21 +804,22 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter) return FALSE; } - OSStatus error = noErr; - reset(); - - mNavOptions.optionFlags |= kNavAllowMultipleFiles; + + mPickOptions |= F_FILE; + + mPickOptions |= F_MULTIPLE; // Modal, so pause agent send_agent_pause(); + + success = doNavChooseDialog(filter); + + send_agent_resume(); + + if (success) { - error = doNavChooseDialog(filter); - } - send_agent_resume(); - if (error == noErr) - { - if (getFileCount()) - success = true; + if (!getFileCount()) + success = false; if (getFileCount() > 1) mLocked = true; } @@ -1001,37 +831,37 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter) BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) { + if( mLocked ) - return FALSE; - BOOL success = FALSE; - OSStatus error = noErr; + return false; + BOOL success = false; // if local file browsing is turned off, return without opening dialog if ( check_local_file_access_enabled() == false ) { - return FALSE; + return false; } reset(); - mNavOptions.optionFlags &= ~kNavAllowMultipleFiles; + mPickOptions &= ~F_MULTIPLE; // Modal, so pause agent send_agent_pause(); + + success = doNavSaveDialog(filter, filename); + + if (success) { - error = doNavSaveDialog(filter, filename); - } - send_agent_resume(); - if (error == noErr) - { - if (getFileCount()) - success = true; + if (!getFileCount()) + success = false; } // Account for the fact that the app has been stalled. LLFrameTimer::updateFrameTime(); return success; } +//END LL_DARWIN #elif LL_LINUX || LL_SOLARIS @@ -1533,4 +1363,4 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter ) return FALSE; } -#endif +#endif // LL_LINUX || LL_SOLARIS diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 4f602f63f1..0d279f73f3 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -39,8 +39,8 @@ #include // AssertMacros.h does bad things. -#include "fix_macros.h" #undef verify +#undef check #undef require #include @@ -85,7 +85,8 @@ public: FFLOAD_MODEL = 9, FFLOAD_COLLADA = 10, FFLOAD_SCRIPT = 11, - FFLOAD_DICTIONARY = 12 + FFLOAD_DICTIONARY = 12, + FFLOAD_DIRECTORY = 13 //To call from lldirpicker. }; enum ESaveFilter @@ -158,15 +159,14 @@ private: #endif #if LL_DARWIN - NavDialogCreationOptions mNavOptions; + S32 mPickOptions; std::vector mFileVector; UInt32 mFileIndex; - OSStatus doNavChooseDialog(ELoadFilter filter); - OSStatus doNavSaveDialog(ESaveFilter filter, const std::string& filename); - void getFilePath(SInt32 index); - void getFileName(SInt32 index); - static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); + bool doNavChooseDialog(ELoadFilter filter); + bool doNavSaveDialog(ESaveFilter filter, const std::string& filename); + //static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); + std::vector* navOpenFilterProc(ELoadFilter filter); #endif #if LL_GTK -- cgit v1.2.3 From 867289bf8045d6b648aa99cedea804208ba9f552 Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Wed, 23 Jan 2013 12:21:31 -0800 Subject: When porting lost changes remember to re-add the new files --- indra/newview/llfilepicker_mac.h | 58 +++++++++++++++++ indra/newview/llfilepicker_mac.mm | 127 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 185 insertions(+) create mode 100644 indra/newview/llfilepicker_mac.h create mode 100644 indra/newview/llfilepicker_mac.mm (limited to 'indra/newview') diff --git a/indra/newview/llfilepicker_mac.h b/indra/newview/llfilepicker_mac.h new file mode 100644 index 0000000000..e0b7e2e8ce --- /dev/null +++ b/indra/newview/llfilepicker_mac.h @@ -0,0 +1,58 @@ +/** + * @file llfilepicker_mac.h + * @brief OS-specific file picker + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// OS specific file selection dialog. This is implemented as a +// singleton class, so call the instance() method to get the working +// instance. When you call getMultipleOpenFile(), it locks the picker +// until you iterate to the end of the list of selected files with +// getNextFile() or call reset(). + +#ifndef LL_LLFILEPICKER_MAC_H +#define LL_LLFILEPICKER_MAC_H + +#if LL_DARWIN + +#include +#include + +//void modelessPicker(); +std::vector* doLoadDialog(const std::vector* allowed_types, + unsigned int flags); +std::string* doSaveDialog(const std::string* file, + const std::string* type, + const std::string* creator, + const std::string* extension, + unsigned int flags); +enum { + F_FILE = 0x00000001, + F_DIRECTORY = 0x00000002, + F_MULTIPLE = 0x00000004, + F_NAV_SUPPORT=0x00000008 +}; + +#endif + +#endif diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm new file mode 100644 index 0000000000..13d0caeb9f --- /dev/null +++ b/indra/newview/llfilepicker_mac.mm @@ -0,0 +1,127 @@ +/** + * @file llfilepicker_mac.cpp + * @brief OS-specific file picker + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef LL_DARWIN +#import +#include +#include "llfilepicker_mac.h" + +std::vector* doLoadDialog(const std::vector* allowed_types, + unsigned int flags) +{ + int i, result; + + //Aura TODO: We could init a small window and release it at the end of this routine + //for a modeless interface. + + NSOpenPanel *panel = [NSOpenPanel openPanel]; + //NSString *fileName = nil; + NSMutableArray *fileTypes = nil; + + + if ( allowed_types && !allowed_types->empty()) + { + fileTypes = [[NSMutableArray alloc] init]; + + for (i=0;isize();++i) + { + [fileTypes addObject: + [NSString stringWithCString:(*allowed_types)[i].c_str() + encoding:[NSString defaultCStringEncoding]]]; + } + } + + //[panel setMessage:@"Import one or more files or directories."]; + [panel setAllowsMultipleSelection: ( (flags & F_MULTIPLE)?true:false ) ]; + [panel setCanChooseDirectories: ( (flags & F_DIRECTORY)?true:false ) ]; + [panel setCanCreateDirectories: true]; + [panel setResolvesAliases: true]; + [panel setCanChooseFiles: ( (flags & F_FILE)?true:false )]; + [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; + + std::vector* outfiles = NULL; + + if (fileTypes) + { + + [panel setAllowedFileTypes:fileTypes]; + + result = [panel runModalForTypes:fileTypes]; + } + else + { + result = [panel runModalForDirectory:NSHomeDirectory() file:nil]; + } + + if (result == NSOKButton) + { + NSArray *filesToOpen = [panel filenames]; + int i, count = [filesToOpen count]; + + if (count > 0) + { + outfiles = new std::vector; + } + + for (i=0; ipush_back(*afilestr); + } + } + return outfiles; +} + + +std::string* doSaveDialog(const std::string* file, + const std::string* type, + const std::string* creator, + const std::string* extension, + unsigned int flags) +{ + NSSavePanel *panel = [NSSavePanel savePanel]; + + NSString *typens = [NSString stringWithCString:type->c_str() encoding:[NSString defaultCStringEncoding]]; + NSArray *fileType = [[NSArray alloc] initWithObjects:typens,nil]; + + //[panel setMessage:@"Save Image File"]; + [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; + [panel setCanSelectHiddenExtension:true]; + [panel setAllowedFileTypes:fileType]; + NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]]; + + std::string *outfile = NULL; + + if([panel runModalForDirectory:nil file:fileName] == + NSFileHandlingPanelOKButton) + { + outfile= new std::string( [ [panel filename] UTF8String ] ); + // write the file + } + return outfile; +} + +#endif -- cgit v1.2.3 From bf1e9124f1530339bfa35652a3b3e329b32a3240 Mon Sep 17 00:00:00 2001 From: Geenz Date: Sat, 2 Feb 2013 12:49:39 -0500 Subject: Restore the old Carbon crash handler, and more deprecated API removal. --- indra/newview/llappviewermacosx.cpp | 116 +++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 28210d18dd..4141f16647 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -30,6 +30,8 @@ #error "Use only with Mac OS X" #endif +#define LL_CARBON_CRASH_HANDLER 1 + #include "llappviewermacosx.h" #include "llwindowmacosx-objc.h" #include "llcommandlineparser.h" @@ -40,6 +42,9 @@ #include "llfloaterworldmap.h" #include "llurldispatcher.h" #include +#ifdef LL_CARBON_CRASH_HANDLER +#include +#endif #include "lldir.h" #include #include // for systemwide mute @@ -51,8 +56,18 @@ namespace // They are not used immediately by the app. int gArgC; char** gArgV; - + bool sCrashReporterIsRunning = false; LLAppViewerMacOSX* gViewerAppPtr; +#ifdef LL_CARBON_CRASH_HANDLER + OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) + { + OSErr result = noErr; + + LLAppViewer::instance()->userQuit(); + + return(result); + } +#endif } bool initViewer() @@ -263,9 +278,39 @@ bool LLAppViewerMacOSX::restoreErrorTrap() return reset_count == 0; } +#ifdef LL_CARBON_CRASH_HANDLER +static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef, + EventRef inEvent, + void* inUserData) +{ + ProcessSerialNumber psn; + + GetEventParameter(inEvent, + kEventParamProcessID, + typeProcessSerialNumber, + NULL, + sizeof(psn), + NULL, + &psn); + + if( GetEventKind(inEvent) == kEventAppTerminated ) + { + Boolean matching_psn = FALSE; + OSErr os_result = SameProcess(&psn, (ProcessSerialNumber*)inUserData, &matching_psn); + if(os_result >= 0 && matching_psn) + { + sCrashReporterIsRunning = false; + QuitApplicationEventLoop(); + } + } + return noErr; +} +#endif + void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) { - // This used to use fork&exec, but is switched to LSOpenApplication to +#ifdef LL_CARBON_CRASH_HANDLER + // This used to use fork&exec, but is switched to LSOpenApplication to // Make sure the crash reporter launches in front of the SL window. std::string command_str; @@ -283,8 +328,75 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) memset(&appParams, 0, sizeof(appParams)); appParams.version = 0; appParams.flags = kLSLaunchNoParams | kLSLaunchStartClassic; + appParams.application = &appRef; + + if(reportFreeze) + { + // Make sure freeze reporting launches the crash logger synchronously, lest + // Log files get changed by SL while the logger is running. + + // *NOTE:Mani A better way - make a copy of the data that the crash reporter will send + // and let SL go about its business. This way makes the mac work like windows and linux + // and is the smallest patch for the issue. + sCrashReporterIsRunning = false; + ProcessSerialNumber o_psn; + + static EventHandlerRef sCarbonEventsRef = NULL; + static const EventTypeSpec kEvents[] = + { + { kEventClassApplication, kEventAppTerminated } + }; + + // Install the handler to detect crash logger termination + InstallEventHandler(GetApplicationEventTarget(), + (EventHandlerUPP) CarbonEventHandler, + GetEventTypeCount(kEvents), + kEvents, + &o_psn, + &sCarbonEventsRef + ); + + // Remove, temporarily the quit handler - which has *crash* behavior before + // the mainloop gets running! + AERemoveEventHandler(kCoreEventClass, + kAEQuitApplication, + NewAEEventHandlerUPP(AEQuitHandler), + false); + + // Launch the crash reporter. + os_result = LSOpenApplication(&appParams, &o_psn); + + if(os_result >= 0) + { + sCrashReporterIsRunning = true; + } + + while(sCrashReporterIsRunning) + { + RunApplicationEventLoop(); + } + + // Re-install the apps quit handler. + AEInstallEventHandler(kCoreEventClass, + kAEQuitApplication, + NewAEEventHandlerUPP(AEQuitHandler), + 0, + false); + + // Remove the crash reporter quit handler. + RemoveEventHandler(sCarbonEventsRef); + } + else + { + appParams.flags |= kLSLaunchAsync; + clear_signals(); + + ProcessSerialNumber o_psn; + os_result = LSOpenApplication(&appParams, &o_psn); + } } +#endif } std::string LLAppViewerMacOSX::generateSerialNumber() -- cgit v1.2.3 From f3ef69ec19c3fb54d53aba1aa2ac49bc8140b591 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 4 Feb 2013 18:27:47 -0500 Subject: Updated the crash handler to produce a CFURL which gets converted into a FSRef due to the Files.h deprecation. --- indra/newview/llappviewermacosx.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 4141f16647..47c82975d8 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -317,12 +317,19 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) //command_str = "open Second Life.app/Contents/Resources/mac-crash-logger.app"; command_str = "mac-crash-logger.app/Contents/MacOS/mac-crash-logger"; + CFURLRef urlRef = CFURLCreateFromFileSystemRepresentation(NULL, (UInt8*)command_str.c_str(), strlen(command_str.c_str()), FALSE); + + // FSRef apparently isn't deprecated. + // There's other funcitonality that depends on it existing as well that isn't deprecated. + // There doesn't seem to be much to directly verify what the status of FSRef is, outside of some documentation pointing at FSRef being valid, and other documentation pointing to everything in Files.h being deprecated. + // We'll assume it isn't for now, since all non-deprecated functions that use it seem to assume similar. + FSRef appRef; - Boolean isDir = 0; - OSStatus os_result = FSPathMakeRef((UInt8*)command_str.c_str(), - &appRef, - &isDir); - if(os_result >= 0) + Boolean pathstatus = CFURLGetFSRef(urlRef, &appRef); + + OSStatus os_result = noErr; + + if(pathstatus == true) { LSApplicationParameters appParams; memset(&appParams, 0, sizeof(appParams)); -- cgit v1.2.3 From e17d69d1d16c607aa304936ebf2ab151684f9c76 Mon Sep 17 00:00:00 2001 From: Geenz Date: Fri, 15 Feb 2013 14:37:04 -0500 Subject: XIB file cleanup. --- indra/newview/SecondLife.nib | Bin 8573 -> 8233 bytes indra/newview/SecondLife.xib | 45 ++----------------------------------------- 2 files changed, 2 insertions(+), 43 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index 0d59d59bb2..b4ad4a876d 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index b02d04e0d2..6bee322017 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -153,7 +153,7 @@ - Quit NewApplication + Quit Second Life q 1048576 2147483647 @@ -359,22 +359,6 @@ 2147483647 - submenuAction: - - Help - - - - NewApplication Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - _NSMainMenu @@ -468,14 +452,6 @@ 240 - - - showHelp: - - - - 360 - hide: @@ -615,9 +591,7 @@ 103 - - - + @@ -644,19 +618,6 @@ - - 106 - - - - - - - - 111 - - - 57 @@ -873,8 +834,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin -- cgit v1.2.3 From f6ad4359756268067c74f3d17049f646a2139aef Mon Sep 17 00:00:00 2001 From: Geenz Date: Fri, 22 Feb 2013 17:52:22 -0500 Subject: Fix for deferred rendering no longer working when the viewer is compiled against the OS X 10.7 SDK and up. --- indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl | 1 + indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 1 + indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 1 + indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 1 + indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 1 + indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 1 + 6 files changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl index 2cef8f2a5d..a2b4b3b8c8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index bff87cb6aa..9050b2c5b7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -32,6 +32,7 @@ out vec4 frag_color; //class 1 -- no shadows #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 89448e2167..ae18558506 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index cca63872de..fddfe60c03 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -33,6 +33,7 @@ out vec4 frag_color; //class 1 -- no shadows #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 5621e47ab7..57e17ad009 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 6d6ad6d565..57abe75c45 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -- cgit v1.2.3 From 7ea8d2f6c00334eae2418cc1749e9d0219cdb80d Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 25 Feb 2013 13:46:06 -0500 Subject: Removed the minimum 1024x768 window constraint to better suit smaller displays. --- indra/newview/SecondLife.nib | Bin 8233 -> 8146 bytes indra/newview/SecondLife.xib | 6 ++---- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index b4ad4a876d..0cffdb97dd 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 6bee322017..6ca49b81ef 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -3,12 +3,12 @@ 1060 12C60 - 2844 + 3084 1187.34 625.00 com.apple.InterfaceBuilder.CocoaPlugin - 2844 + 3084 NSCustomObject @@ -375,7 +375,6 @@ LLNSWindow - {1024, 768} 256 @@ -387,7 +386,6 @@ _NS:20 {{0, 0}, {1920, 1178}} - {1024, 790} {10000000000000, 10000000000000} Second Life 128 -- cgit v1.2.3 From d046e606575b2c3714a88e321c88e05441cba4a8 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Wed, 27 Feb 2013 14:39:26 -0800 Subject: Fix max VRAM detection on some cards and issues with sequencing of application of mem multiplier --- indra/newview/llfloaterhardwaresettings.cpp | 4 +++- indra/newview/llviewertexturelist.cpp | 14 +++++++------- indra/newview/llviewertexturelist.h | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 116bd241c4..664f7d4fd6 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -89,8 +89,10 @@ void LLFloaterHardwareSettings::refresh() void LLFloaterHardwareSettings::refreshEnabledState() { + F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); + S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(); + S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem); getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index b9f5c432d0..82d990cf97 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1191,7 +1191,7 @@ S32 LLViewerTextureList::getMinVideoRamSetting() //static // Returns max setting for TextureMemory (in MB) -S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) +S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_multiplier) { S32 max_texmem; if (gGLManager.mVRAM != 0) @@ -1235,7 +1235,10 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) max_texmem = llmin(max_texmem, (S32)(system_ram/2)); else max_texmem = llmin(max_texmem, (S32)(system_ram)); - + + // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise + max_texmem = llmin(max_texmem, (S32) (mem_multiplier * (F32) max_texmem)); + max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM_IN_MEGA_BYTES); return max_texmem; @@ -1248,7 +1251,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) // Initialize the image pipeline VRAM settings S32 cur_mem = gSavedSettings.getS32("TextureMemory"); F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); - S32 default_mem = getMaxVideoRamSetting(true); // recommended default + S32 default_mem = getMaxVideoRamSetting(true, mem_multiplier); // recommended default if (mem == 0) { mem = cur_mem > 0 ? cur_mem : default_mem; @@ -1258,10 +1261,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) mem = default_mem; } - // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise - mem = llmin(mem, (S32) (mem_multiplier * (F32) default_mem)); - - mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting()); + mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting(false, mem_multiplier)); if (mem != cur_mem) { gSavedSettings.setS32("TextureMemory", mem); diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 3dda973d3f..88dea4448b 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -114,7 +114,7 @@ public: void setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level); static S32 getMinVideoRamSetting(); - static S32 getMaxVideoRamSetting(bool get_recommended = false); + static S32 getMaxVideoRamSetting(bool get_recommended, float mem_multiplier); private: void updateImagesDecodePriorities(); -- cgit v1.2.3 From f3316f8aa2484a93a35b93a3dd4961b8bad7f751 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 4 Mar 2013 17:32:49 -0500 Subject: Fix for Command + W closing the viewer window. The old viewer didn't actually use the File menu, so we'll remove it for the time being. --- indra/newview/SecondLife.nib | Bin 8146 -> 7403 bytes indra/newview/SecondLife.xib | 107 +------------------------------------------ 2 files changed, 1 insertion(+), 106 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index 0cffdb97dd..09173cd26f 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 6ca49b81ef..cb91eeaea2 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -164,57 +164,6 @@ _NSAppleMenu - - - File - - 2147483647 - - - submenuAction: - - File - - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Edit @@ -385,7 +334,7 @@ _NS:20 - {{0, 0}, {1920, 1178}} + {{0, 0}, {1920, 1200}} {10000000000000, 10000000000000} Second Life 128 @@ -434,14 +383,6 @@ 39 - - - performClose: - - - - 193 - performZoom: @@ -564,7 +505,6 @@ - @@ -592,30 +532,6 @@ - - 83 - - - - - - - - 81 - - - - - - - - - - - 73 - - - 57 @@ -810,21 +726,6 @@ - - 82 - - - - - 79 - - - - - 72 - - - @@ -860,19 +761,13 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin -- cgit v1.2.3 From 5caa7a465e73fc9cf70f5f2c5d147a509bd5e185 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 11 Mar 2013 10:16:22 -0400 Subject: Bug fixing and prep-work for IME support (along with refactored text input in general). --- indra/newview/SecondLife.nib | Bin 7403 -> 7403 bytes indra/newview/SecondLife.xib | 14 +++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index 09173cd26f..ff218a21c8 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index cb91eeaea2..86e8d81ebc 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,10 +2,10 @@ 1060 - 12C60 + 12D76 3084 - 1187.34 - 625.00 + 1187.37 + 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 @@ -318,7 +318,7 @@ 15 2 - {{196, 240}, {1024, 768}} + {{196, 240}, {1024, 600}} 74974208 Second Life LLNSWindow @@ -328,13 +328,13 @@ 256 - {1024, 768} + {1024, 600} _NS:20 - {{0, 0}, {1920, 1200}} + {{0, 0}, {2560, 1440}} {10000000000000, 10000000000000} Second Life 128 @@ -775,7 +775,7 @@ - 864 + 888 -- cgit v1.2.3 From ad26f3c39002b6043e5fc4e00f9793e0f0e4941c Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 19 Mar 2013 05:50:50 -0400 Subject: IME support (and revamped text input support) semi-working. --- indra/newview/SecondLife.nib | Bin 7403 -> 7403 bytes indra/newview/SecondLife.xib | 31 +++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index ff218a21c8..f55ddaabcd 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 86e8d81ebc..7d20b7fd7c 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,7 +2,7 @@ 1060 - 12D76 + 12D78 3084 1187.37 626.00 @@ -775,24 +775,27 @@ - 888 + 940 LLAppDelegate NSObject - - window - LLNSWindow - - - window - + + LLOpenGLView + LLNSWindow + + + + glview + LLOpenGLView + + window LLNSWindow - + IBProjectSource ./Classes/LLAppDelegate.h @@ -806,6 +809,14 @@ ./Classes/LLNSWindow.h + + LLOpenGLView + NSOpenGLView + + IBProjectSource + ./Classes/LLOpenGLView.h + + 0 -- cgit v1.2.3 From 258b77b64777a5ce5fef0ef066aa52b34b43ba65 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 25 Mar 2013 05:26:55 -0400 Subject: Additional IME support. LLPreeditor is largely good to go at this point, but there's still some work to do in getSegments. --- indra/newview/Info-SecondLife.plist | 2 +- indra/newview/llviewerkeyboard.cpp | 1 - indra/newview/llviewerwindow.cpp | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 5db52f040f..8fb4e88bc3 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Second Life + SecondLife CFBundlePackageType APPL CFBundleSignature diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 92d8f2937e..f3b7c0fad4 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -653,7 +653,6 @@ BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode) BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL repeated) { - LL_INFOS("Keyboard Handling") << "Handling key " << translated_key << LL_ENDL; // check for re-map EKeyboardMode mode = gViewerKeyboard.getMode(); U32 keyidx = (translated_mask<<16) | translated_key; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ccaa9245cf..48a69129eb 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2429,7 +2429,6 @@ void LLViewerWindow::draw() // Takes a single keydown event, usually when UI is visible BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { - LL_INFOS("Keyboard Handling") << "Handling key " << key << LL_ENDL; // hide tooltips on keypress LLToolTipMgr::instance().blockToolTips(); -- cgit v1.2.3 From 80a79e5d7b4f37f862b312e848b1d1e7f85b0fa9 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 27 Mar 2013 08:49:45 -0400 Subject: IME support is pretty much finished at this point. --- indra/newview/llappdelegate-objc.mm | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 9e0e0e35c5..5fb5087cd8 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -7,6 +7,7 @@ // #import "llappdelegate-objc.h" +#include "llwindowmacosx-objc.h" @implementation LLAppDelegate -- cgit v1.2.3 From 2656b1f405dcf3b67d644bf47b02a64886ef2ca4 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 1 Apr 2013 08:15:12 -0400 Subject: First pass at adding a viable replacement for TSM's old UseInputWindow method (which is now deprecated with seemingly no Cocoa replacement). --- indra/newview/SecondLife.nib | Bin 7403 -> 12997 bytes indra/newview/SecondLife.xib | 381 +++++++++++++++++++++++++++++++++++- indra/newview/llappdelegate-objc.mm | 15 ++ 3 files changed, 388 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index f55ddaabcd..0b0ff5308b 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 7d20b7fd7c..fdfea49c42 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -11,9 +11,13 @@ 3084 + IBNSLayoutConstraint NSCustomObject NSMenu NSMenuItem + NSScrollView + NSScroller + NSTextView NSView NSWindowTemplate @@ -340,6 +344,202 @@ 128 YES + + 31 + 2 + {{272, 176}, {938, 42}} + -1535638528 + Window + NSPanel + + + + + 256 + + + + 256 + + + + 2304 + + + + 2322 + + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + + {938, 42} + + + + _NS:13 + + + + + + + + + + + + 166 + + + + 938 + 1 + + + 67121127 + 0 + + + 3 + MQA + + + + 6 + System + selectedTextBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + 1 + + 6 + {939, 10000000} + + + + {{1, 1}, {938, 42}} + + + + _NS:11 + + + + {4, 5} + + 79691776 + + + + + + file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff + + + + + 3 + MCAwAA + + + + 4 + + + + 256 + {{923, 1}, {16, 42}} + + + + _NS:83 + NO + + _doScroller: + 0.96666666666666667 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + + _NS:33 + NO + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{-1, -1}, {940, 44}} + + + + _NS:9 + 133138 + + + + 0.25 + 4 + 1 + + + {938, 42} + + + + _NS:21 + + {{0, 0}, {2560, 1440}} + {10000000000000, 10000000000000} + YES + @@ -471,6 +671,22 @@ 850 + + + inputWindow + + + + 953 + + + + inputView + + + + 954 + @@ -726,6 +942,131 @@ + + 941 + + + + + + + + 942 + + + + + + 4 + 0 + + 4 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + + + 943 + + + + + + + + + + 944 + + + + + 945 + + + + + 946 + + + + + 949 + + + + + 950 + + + + + 951 + + + + + 952 + + + @@ -770,12 +1111,31 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + LLNonInlineTextView + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 940 + 954 @@ -783,13 +1143,18 @@ LLAppDelegate NSObject - LLOpenGLView + LLNonInlineTextView + NSWindow LLNSWindow - - glview - LLOpenGLView + + inputView + LLNonInlineTextView + + + inputWindow + NSWindow window @@ -810,11 +1175,11 @@ - LLOpenGLView - NSOpenGLView + LLNonInlineTextView + NSTextView IBProjectSource - ./Classes/LLOpenGLView.h + ./Classes/LLNonInlineTextView.h diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 5fb5087cd8..8da44fcf33 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -12,6 +12,8 @@ @implementation LLAppDelegate @synthesize window; +@synthesize inputWindow; +@synthesize inputView; - (void)dealloc { @@ -63,4 +65,17 @@ } } +- (void) showInputWindow:(bool)show +{ + if (show) + { + NSLog(@"Showing input window."); + [inputWindow makeKeyAndOrderFront:inputWindow]; + } else { + NSLog(@"Hiding input window."); + [inputWindow orderOut:inputWindow]; + [window makeKeyAndOrderFront:window]; + } +} + @end -- cgit v1.2.3 From b27899ee0e035ebd4072a5e6162678f2afe81053 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 13 May 2013 19:39:45 -0400 Subject: Added IME input window white list. --- indra/newview/SecondLife.nib | Bin 12997 -> 13009 bytes indra/newview/SecondLife.xib | 25 ++++++++++++-------- indra/newview/llappdelegate-objc.mm | 45 ++++++++++++++++++++++++++++++------ 3 files changed, 53 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index 0b0ff5308b..cb289ebf09 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index fdfea49c42..c6b72485a1 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,9 +2,9 @@ 1060 - 12D78 + 12E30 3084 - 1187.37 + 1187.39 626.00 com.apple.InterfaceBuilder.CocoaPlugin @@ -329,16 +329,13 @@ - + 256 {1024, 600} - - - _NS:20 - {{0, 0}, {2560, 1440}} + {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} Second Life 128 @@ -349,7 +346,7 @@ 2 {{272, 176}, {938, 42}} -1535638528 - Window + Input Window NSPanel @@ -536,7 +533,7 @@ _NS:21 - {{0, 0}, {2560, 1440}} + {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} YES @@ -1112,7 +1109,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + @@ -1182,6 +1179,14 @@ ./Classes/LLNonInlineTextView.h + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + 0 diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 8da44fcf33..de77447006 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -8,12 +8,14 @@ #import "llappdelegate-objc.h" #include "llwindowmacosx-objc.h" +#include // Used for Text Input Services ("Safe" API - it's well supported) @implementation LLAppDelegate @synthesize window; @synthesize inputWindow; @synthesize inputView; +@synthesize currentInputLanguage; - (void)dealloc { @@ -24,12 +26,16 @@ { frameTimer = nil; + [self languageUpdated]; + if (initViewer()) { frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; } else { handleQuit(); } + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; } - (void) applicationDidBecomeActive:(NSNotification *)notification @@ -67,15 +73,40 @@ - (void) showInputWindow:(bool)show { - if (show) + // How to add support for new languages with the input window: + // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) + NSArray *authorizedLanguages = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil]; + + if ([authorizedLanguages containsObject:currentInputLanguage]) { - NSLog(@"Showing input window."); - [inputWindow makeKeyAndOrderFront:inputWindow]; - } else { - NSLog(@"Hiding input window."); - [inputWindow orderOut:inputWindow]; - [window makeKeyAndOrderFront:window]; + if (show) + { + NSLog(@"Showing input window."); + [inputWindow makeKeyAndOrderFront:inputWindow]; + } else { + NSLog(@"Hiding input window."); + [inputWindow orderOut:inputWindow]; + [window makeKeyAndOrderFront:window]; + } } } +// This will get called multiple times by NSNotificationCenter. +// It will be called every time that the window focus changes, and every time that the input language gets changed. +// The primary use case for this selector is to update our current input language when the user, for whatever reason, changes the input language. +// This is the more elegant way of handling input language changes instead of checking every time we want to use the input window. + +- (void) languageUpdated +{ + TISInputSourceRef currentInput = TISCopyCurrentKeyboardInputSource(); + CFArrayRef languages = (CFArrayRef)TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages); + +#if 1 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" + NSLog(@"languages: %@", TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages)); +#endif + + // Typically the language we want is going to be the very first result in the array. + currentInputLanguage = (NSString*)CFArrayGetValueAtIndex(languages, 0); +} + @end -- cgit v1.2.3 From 45cd21f7e1f87da60bfe16944267371f8a518799 Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 14 May 2013 00:53:42 -0400 Subject: Fix incorrect generation of Info.plist. Use a custom Info.plist template here. --- indra/newview/CMakeLists.txt | 25 +++++++++++++++---------- indra/newview/Info-SecondLife.plist | 30 ++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index bf0913a06b..221d421f30 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1965,20 +1965,25 @@ if (LINUX) endif (LINUX) if (DARWIN) + # These all get set with PROPERTIES set(product "Second Life") - + set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") + set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") + set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") + set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") + set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") + set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES - OUTPUT_NAME "${product}" - MACOSX_BUNDLE_INFO_STRING "Second Life Viewer" - MACOSX_BUNDLE_ICON_FILE "secondlife.icns" - MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer" - MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" - MACOSX_BUNDLE_BUNDLE_NAME "Second Life" - MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}" - MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}" - MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007" + OUTPUT_NAME "${product}" + MACOSX_BUNDLE_INFO_PLIST + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) configure_file( diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index c7f1090e86..f584b61768 100755 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -5,19 +5,33 @@ CFBundleDevelopmentRegion English CFBundleExecutable - Second Life + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} CFBundleIconFile - secondlife.icns + ${MACOSX_BUNDLE_ICON_FILE} CFBundleIdentifier - com.secondlife.indra.viewer + ${MACOSX_BUNDLE_GUI_IDENTIFIER} CFBundleInfoDictionaryVersion 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} CFBundleName - SecondLife + ${MACOSX_BUNDLE_BUNDLE_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} CFBundleSignature ???? + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + + LSRequiresCarbon + + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} CFBundleDocumentTypes @@ -59,13 +73,9 @@ - CFBundleVersion - ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} NSPrincipalClass - NSApplication + ${MACOSX_BUNDLE_NSPRINCIPAL_CLASS} NSMainNibFile - SecondLife - CSResourcesFileMapped - + ${MACOSX_BUNDLE_NSMAIN_NIB_FILE} -- cgit v1.2.3 From 5683fe2fa332244a7e1e172021663a7d22c58e0c Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 14 May 2013 01:05:09 -0400 Subject: Fix the viewer bundle version not being set appropriately. --- indra/newview/Info-SecondLife.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index f584b61768..9b8136a827 100755 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -25,7 +25,7 @@ CFBundleSignature ???? CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} + ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} CSResourcesFileMapped LSRequiresCarbon -- cgit v1.2.3 From 7decac40e6453b2d8822d2677b9b59300bc260cf Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 23 May 2013 09:39:49 -0400 Subject: Override NSPanel's close method to hide the window instead of actually removing the window. --- indra/newview/SecondLife.nib | Bin 13009 -> 13021 bytes indra/newview/SecondLife.xib | 14 +++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index cb289ebf09..a5f2717167 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index c6b72485a1..e5736f76a4 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,7 +2,7 @@ 1060 - 12E30 + 12E52 3084 1187.39 626.00 @@ -335,7 +335,7 @@ {1024, 600} _NS:20 - {{0, 0}, {2560, 1418}} + {{0, 0}, {2560, 1440}} {10000000000000, 10000000000000} Second Life 128 @@ -347,7 +347,7 @@ {{272, 176}, {938, 42}} -1535638528 Input Window - NSPanel + LLUserInputWindow @@ -533,7 +533,7 @@ _NS:21 - {{0, 0}, {2560, 1418}} + {{0, 0}, {2560, 1440}} {10000000000000, 10000000000000} YES @@ -1180,11 +1180,11 @@ - NSLayoutConstraint - NSObject + LLUserInputWindow + NSPanel IBProjectSource - ./Classes/NSLayoutConstraint.h + ./Classes/LLUserInputWindow.h -- cgit v1.2.3 From 93531f3ba85748ba5c9f1d797c4925f55fe8b92c Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 17 Jun 2013 08:59:01 -0400 Subject: Insert text into the input window when we attempt to insert text without a pre-editor. Also handle backspace as a special case when determining if the input window needs to be displayed. --- indra/newview/llappdelegate-objc.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index de77447006..b4f9c56b00 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -71,7 +71,7 @@ } } -- (void) showInputWindow:(bool)show +- (void) showInputWindow:(bool)show withText:(id)text { // How to add support for new languages with the input window: // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) @@ -83,6 +83,7 @@ { NSLog(@"Showing input window."); [inputWindow makeKeyAndOrderFront:inputWindow]; + [inputView setMarkedText:text selectedRange:NSMakeRange(0, 1)]; } else { NSLog(@"Hiding input window."); [inputWindow orderOut:inputWindow]; -- cgit v1.2.3 From 440a1ee3bae4ea9553fa57d806f942a472923190 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 17 Jun 2013 09:26:11 -0400 Subject: Move logic involving the input window to keyDown. Pass input events to the input window from there. --- indra/newview/llappdelegate-objc.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index b4f9c56b00..403c307085 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -8,7 +8,7 @@ #import "llappdelegate-objc.h" #include "llwindowmacosx-objc.h" -#include // Used for Text Input Services ("Safe" API - it's well supported) +#include // Used for Text Input Services ("Safe" API - it's supported) @implementation LLAppDelegate -- cgit v1.2.3 From 2253d22eb85a6b4c5e48b9905d807d0ac48b1930 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 17 Jun 2013 10:28:32 -0400 Subject: Have showInputWindow hand off input events to the bottom line input window. --- indra/newview/llappdelegate-objc.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 403c307085..cec9c586e6 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -71,7 +71,7 @@ } } -- (void) showInputWindow:(bool)show withText:(id)text +- (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent { // How to add support for new languages with the input window: // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) @@ -83,7 +83,10 @@ { NSLog(@"Showing input window."); [inputWindow makeKeyAndOrderFront:inputWindow]; - [inputView setMarkedText:text selectedRange:NSMakeRange(0, 1)]; + if (textEvent != nil) + { + [[inputView inputContext] handleEvent:textEvent]; + } } else { NSLog(@"Hiding input window."); [inputWindow orderOut:inputWindow]; -- cgit v1.2.3 From 84f287b34e7d7edbd2e897b73008c782aabe60de Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 17 Jun 2013 12:31:25 -0400 Subject: Moved detecting if we're using a roman-script language to it's own function in the application delegate. Also consider the delete and backspace characters to be special cases. --- indra/newview/llappdelegate-objc.mm | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index cec9c586e6..6b7e613491 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -73,11 +73,7 @@ - (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent { - // How to add support for new languages with the input window: - // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) - NSArray *authorizedLanguages = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil]; - - if ([authorizedLanguages containsObject:currentInputLanguage]) + if (![self romanScript]) { if (show) { @@ -85,6 +81,7 @@ [inputWindow makeKeyAndOrderFront:inputWindow]; if (textEvent != nil) { + [[inputView inputContext] discardMarkedText]; [[inputView inputContext] handleEvent:textEvent]; } } else { @@ -105,7 +102,7 @@ TISInputSourceRef currentInput = TISCopyCurrentKeyboardInputSource(); CFArrayRef languages = (CFArrayRef)TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages); -#if 1 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" +#if 0 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" NSLog(@"languages: %@", TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages)); #endif @@ -113,4 +110,17 @@ currentInputLanguage = (NSString*)CFArrayGetValueAtIndex(languages, 0); } +- (bool) romanScript +{ + // How to add support for new languages with the input window: + // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) + NSArray *nonRomanScript = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil]; + if ([nonRomanScript containsObject:currentInputLanguage]) + { + return false; + } + + return true; +} + @end -- cgit v1.2.3 From 623077e6a4eef516d445975eaa71d5f67e6767c5 Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 27 Jun 2013 15:06:03 -0400 Subject: Added license headers. --- indra/newview/llappdelegate-objc.mm | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 6b7e613491..30476b3d22 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -1,10 +1,28 @@ -// -// LLAppDelegate.m -// SecondLife -// -// Created by Geenz on 12/16/12. -// -// +/** + * @file llappdelegate-objc.mm + * @brief Class implementation for the Mac version's application delegate. + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ #import "llappdelegate-objc.h" #include "llwindowmacosx-objc.h" -- cgit v1.2.3 From bb8ff8707c93604007c00a5227be35b2799bdb92 Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 11 Jul 2013 18:27:50 -0400 Subject: Fix a crash on 10.6.x due to auto layout not being supported in 10.6 nibs. --- indra/newview/SecondLife.nib | Bin 13021 -> 12348 bytes indra/newview/SecondLife.xib | 138 +++++++++++-------------------------------- 2 files changed, 34 insertions(+), 104 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index a5f2717167..8b99b5a770 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index e5736f76a4..370df6bf5f 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,16 +2,15 @@ 1060 - 12E52 - 3084 + 12E55 + 4457.6 1187.39 626.00 com.apple.InterfaceBuilder.CocoaPlugin - 3084 + 4457.6 - IBNSLayoutConstraint NSCustomObject NSMenu NSMenuItem @@ -329,13 +328,15 @@ - + 256 {1024, 600} + + _NS:20 - {{0, 0}, {2560, 1440}} + {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} Second Life 128 @@ -360,7 +361,7 @@ - 2304 + 2322 @@ -533,7 +534,7 @@ _NS:21 - {{0, 0}, {2560, 1440}} + {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} YES @@ -952,70 +953,6 @@ - - - 4 - 0 - - 4 - 1 - - -1 - - 1000 - - 8 - 29 - 3 - - - - 6 - 0 - - 6 - 1 - - -1 - - 1000 - - 8 - 29 - 3 - - - - 3 - 0 - - 3 - 1 - - -1 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - -1 - - 1000 - - 8 - 29 - 3 - @@ -1044,26 +981,6 @@ - - 949 - - - - - 950 - - - - - 951 - - - - - 952 - - - @@ -1110,23 +1027,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin LLNonInlineTextView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin @@ -1187,6 +1093,27 @@ ./Classes/LLUserInputWindow.h + + NSTextView + + id + id + + + + orderFrontSharingServicePicker: + id + + + toggleQuickLookPreviewPanel: + id + + + + IBProjectSource + ./Classes/NSTextView.h + + 0 @@ -1195,12 +1122,15 @@ com.apple.InterfaceBuilder.CocoaPlugin.macosx + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + YES 3 {11, 11} {10, 3} - YES -- cgit v1.2.3 From d68f254c66cc2c971cda14c59f8d16e8c44586d6 Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 11 Jul 2013 19:43:02 -0400 Subject: OPEN-171: the save file dialog incorrectly uses type codes as extensions --- indra/newview/llfilepicker_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index d8862bce57..c41639fbd5 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -106,8 +106,8 @@ std::string* doSaveDialog(const std::string* file, { NSSavePanel *panel = [NSSavePanel savePanel]; - NSString *typens = [NSString stringWithCString:type->c_str() encoding:[NSString defaultCStringEncoding]]; - NSArray *fileType = [[NSArray alloc] initWithObjects:typens,nil]; + NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]]; + NSArray *fileType = [[NSArray alloc] initWithObjects:extensionns,nil]; //[panel setMessage:@"Save Image File"]; [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; -- cgit v1.2.3 From 3c336c0f36966900c234a804d13421d296edccfc Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 23 Jul 2013 10:56:59 -0400 Subject: Fix for BUG-3363. We have an array of URLs, and we need the paths of those URLs. Explicitly get the path. --- indra/newview/llfilepicker_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index c41639fbd5..2a84226e0a 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -89,7 +89,7 @@ std::vector* doLoadDialog(const std::vector* allowed_t } for (i=0; ipush_back(*afilestr); } -- cgit v1.2.3 From efba897e45b5065619bbe0e1451a40b6391e503c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 5 Aug 2013 15:38:43 -0400 Subject: correct coding standards problems --- indra/newview/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index df70cd21f1..b81b4a14bd 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1990,9 +1990,9 @@ if (DARWIN) set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES - OUTPUT_NAME "${product}" - MACOSX_BUNDLE_INFO_PLIST - "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" + OUTPUT_NAME "${product}" + MACOSX_BUNDLE_INFO_PLIST + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) configure_file( -- cgit v1.2.3 From f46e07c14c11ffd26c0cf0794992d7c08d16fcd4 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Mon, 26 Aug 2013 10:16:11 -0700 Subject: MAINT-1453 ifdef around windows-only work-around to restore 8x and 16x AA modes on Mac --- indra/newview/llfloaterhardwaresettings.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 664f7d4fd6..792a2a5d25 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -151,12 +151,17 @@ BOOL LLFloaterHardwareSettings::postBuild() { childSetAction("OK", onBtnOK, this); +// Don't do this on Mac as their braindead GL versioning +// sets this when 8x and 16x are indeed available +// +#if !LL_DARWIN if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) { //remove FSAA settings above "4x" LLComboBox* combo = getChild("fsaa"); combo->remove("8x"); combo->remove("16x"); } +#endif refresh(); center(); -- cgit v1.2.3 From 55ae6a7962cdc9a9d7d087fbc529d30db9c37013 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 9 Sep 2013 14:47:01 -0400 Subject: increment viewer version to 3.6.6 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index d15b8b06fa..4f2c1d15f6 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.5 +3.6.6 -- cgit v1.2.3