diff options
author | Jacek Antonelli | 2008-08-15 23:45:16 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:16 -0500 |
commit | 3f27ba891ac4d032753b219b4b96d1ffbc9fb488 (patch) | |
tree | 504932ee91a0356fba7ea48798887c96867e492f /linden/indra/llwindow | |
parent | Second Life viewer sources 1.18.4.3 (diff) | |
download | meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.zip meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.gz meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.bz2 meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.xz |
Second Life viewer sources 1.18.5.0-RC
Diffstat (limited to 'linden/indra/llwindow')
-rw-r--r-- | linden/indra/llwindow/lllogitechlcd.cpp | 296 | ||||
-rw-r--r-- | linden/indra/llwindow/lllogitechlcd.h | 135 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindow.vcproj | 14 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindow_vc8.vcproj | 16 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowwin32.cpp | 18 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowwin32.h | 1 |
6 files changed, 464 insertions, 16 deletions
diff --git a/linden/indra/llwindow/lllogitechlcd.cpp b/linden/indra/llwindow/lllogitechlcd.cpp new file mode 100644 index 0000000..8141ba3 --- /dev/null +++ b/linden/indra/llwindow/lllogitechlcd.cpp | |||
@@ -0,0 +1,296 @@ | |||
1 | /** | ||
2 | * @file lcd.cpp | ||
3 | * @brief cLcd panel class | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlife.com/developers/opensource/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #include "llpreprocessor.h" | ||
33 | |||
34 | #if LL_LCD_COMPILE | ||
35 | |||
36 | #include "linden_common.h" | ||
37 | #include "../win_crash_logger/StdAfx.h" | ||
38 | |||
39 | #include "EZ_LCD.h" | ||
40 | #include "../newview/res/resource.h" | ||
41 | #include "llcontrol.h" | ||
42 | extern LLControlGroup gSavedSettings; | ||
43 | |||
44 | #ifndef LL_LOGITECH_LCD_H | ||
45 | #include "lllogitechlcd.h" | ||
46 | #endif | ||
47 | |||
48 | #define WAIT_DURATION 7 | ||
49 | #define DEBOUNCE_DURATION 0.3f | ||
50 | |||
51 | llLCDPageGroup::llLCDPageGroup(CEzLcd *LCD, int type, HICON SLIcon): | ||
52 | mType(type), | ||
53 | mSLIcon(SLIcon), | ||
54 | mDisplayPage(false), | ||
55 | mLCD(LCD) | ||
56 | { | ||
57 | mPageArray.clear(); | ||
58 | } | ||
59 | |||
60 | llLCDPageGroup::~llLCDPageGroup() | ||
61 | { | ||
62 | mPageArray.clear(); | ||
63 | } | ||
64 | |||
65 | void llDefaultPageGroup::UpdateDetails() | ||
66 | { | ||
67 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
68 | } | ||
69 | |||
70 | void llDefaultPageGroup::GetDisplayable() | ||
71 | { | ||
72 | |||
73 | } | ||
74 | |||
75 | llDefaultPageGroup::llDefaultPageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
76 | :llLCDPageGroup(LCD, type, SLIcon) | ||
77 | { | ||
78 | // create a new specific page | ||
79 | llLCDSpecificPage newPage; | ||
80 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
81 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
82 | |||
83 | // add in all the display parts for this specific page | ||
84 | |||
85 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
86 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
87 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
88 | |||
89 | // add Title | ||
90 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_MEDIUM, DT_CENTER, 128); | ||
91 | mLCD->SetOrigin(title, 32, 20); | ||
92 | mLCD->SetText(title, _T("Second Life Display")); | ||
93 | newPage.mDisplayItemArray.push_back(title); | ||
94 | |||
95 | // and then insert it | ||
96 | mPageArray.push_back(newPage); | ||
97 | } | ||
98 | |||
99 | llLCD::llLCD(HINSTANCE instance): | ||
100 | mInited(false), | ||
101 | mDisplayTimer(), | ||
102 | mDebounceTimer(), | ||
103 | mPageToShow(-1), | ||
104 | mInstance(instance), | ||
105 | mDestinationLCD(-1), | ||
106 | mFirstTimeThru(true) | ||
107 | { | ||
108 | HRESULT res_ = S_OK; | ||
109 | |||
110 | // Create instance of EzLcd. | ||
111 | mLCD = new CEzLcd(); | ||
112 | |||
113 | // Have it initialize itself | ||
114 | res_ = mLCD->InitYourself(_T("Second Life")); | ||
115 | |||
116 | if (res_ != S_OK) | ||
117 | { | ||
118 | // Something went wrong, when connecting to the LCD Manager software. We need to get out now | ||
119 | delete mLCD; | ||
120 | return; | ||
121 | } | ||
122 | mInited = true; | ||
123 | |||
124 | // preload the Second Life Icon | ||
125 | mSLIcon = static_cast<HICON>(LoadImage(mInstance, | ||
126 | MAKEINTRESOURCE(IDI_LCD_LL_ICON), | ||
127 | IMAGE_ICON, | ||
128 | 32, | ||
129 | 32, | ||
130 | LR_MONOCHROME)); | ||
131 | |||
132 | // have to do this first so screens are added to the list and updateDisplay actually does something. | ||
133 | mLCD->Update(); | ||
134 | } | ||
135 | |||
136 | llLCD::~llLCD() | ||
137 | { | ||
138 | // remove the instance of the LCD controller | ||
139 | if (mInited == true) | ||
140 | { | ||
141 | delete mLCD; | ||
142 | |||
143 | // free up the used pages | ||
144 | int loopSize = mPageGroupArray.size(); | ||
145 | for(int i= 0; i<loopSize; i++) | ||
146 | { | ||
147 | free (mPageGroupArray[i]); | ||
148 | } | ||
149 | } | ||
150 | } | ||
151 | |||
152 | llLCDPageGroup *llLCD::GetNextPageToDisplay() | ||
153 | { | ||
154 | // find group with current page in it. | ||
155 | |||
156 | int groupSize = mPageGroupArray.size(); | ||
157 | for(int x=1; x< groupSize; x++) | ||
158 | { | ||
159 | if (mPageGroupArray[x]->mDisplayPage) | ||
160 | { | ||
161 | // now walk all the pages in the page group we are looking at | ||
162 | int numPages = mPageGroupArray[x]->mPageArray.size(); | ||
163 | for (int zx = 0; zx< numPages; zx++) | ||
164 | { | ||
165 | // found it. | ||
166 | if (mPageToShow == mPageGroupArray[x]->mPageArray[zx].mPageIndex) | ||
167 | { | ||
168 | // move to the next one | ||
169 | if (zx < numPages-1) | ||
170 | { | ||
171 | mPageToShow = mPageGroupArray[x]->mPageArray[zx+1].mPageIndex; | ||
172 | return mPageGroupArray[x]; | ||
173 | } | ||
174 | else | ||
175 | { | ||
176 | for(int y=x+1; y< groupSize; y++) | ||
177 | { | ||
178 | if (mPageGroupArray[y]->mDisplayPage) | ||
179 | { | ||
180 | mPageToShow = mPageGroupArray[y]->mPageArray[0].mPageIndex; | ||
181 | return mPageGroupArray[y]; | ||
182 | } | ||
183 | } | ||
184 | } | ||
185 | } | ||
186 | } | ||
187 | } | ||
188 | } | ||
189 | |||
190 | // ok, didn't find it. Start again at the beginning and find the first group that's enabled | ||
191 | for(int x=1; x< groupSize; x++) | ||
192 | { | ||
193 | if (mPageGroupArray[x]->mDisplayPage) | ||
194 | { | ||
195 | mPageToShow = mPageGroupArray[x]->mPageArray[0].mPageIndex; | ||
196 | return mPageGroupArray[x]; | ||
197 | } | ||
198 | } | ||
199 | // if we got this far, we should display the default screen | ||
200 | mPageToShow = mPageGroupArray[0]->mPageArray[0].mPageIndex; | ||
201 | return mPageGroupArray[0]; | ||
202 | } | ||
203 | |||
204 | void llLCD::SetUpDisplayPages() | ||
205 | { | ||
206 | // work out if destination has changed | ||
207 | int destinationLCD = gSavedSettings.getS32("LCDDestination"); | ||
208 | switch(destinationLCD) | ||
209 | { | ||
210 | case 0: | ||
211 | destinationLCD = LGLCD_DEVICE_FAMILY_KEYBOARD_G15; | ||
212 | break; | ||
213 | case 1: | ||
214 | destinationLCD = LGLCD_DEVICE_FAMILY_SPEAKERS_Z10; | ||
215 | break; | ||
216 | } | ||
217 | // set destination if it's changed | ||
218 | if (mDestinationLCD != destinationLCD) | ||
219 | { | ||
220 | mDestinationLCD = destinationLCD; | ||
221 | mLCD->SetDeviceFamilyToUse(destinationLCD); | ||
222 | } | ||
223 | int loopSize = mPageGroupArray.size(); | ||
224 | for(int i= 0; i<loopSize; i++) | ||
225 | { | ||
226 | mPageGroupArray[i]->GetDisplayable(); | ||
227 | } | ||
228 | } | ||
229 | |||
230 | void llLCD::UpdateDisplay() | ||
231 | { | ||
232 | if (mInited) | ||
233 | { | ||
234 | // reset pages if anything has changed | ||
235 | SetUpDisplayPages(); | ||
236 | if (mLCD->IsConnected()) | ||
237 | { | ||
238 | // Switching back and forth between the pages that we've created | ||
239 | if (mDisplayTimer.getElapsedTimeF32() > WAIT_DURATION || mFirstTimeThru) | ||
240 | { | ||
241 | mCurrentGroupBeingShown = GetNextPageToDisplay(); | ||
242 | mDisplayTimer.reset(); | ||
243 | mFirstTimeThru = false; | ||
244 | } | ||
245 | |||
246 | // Check if button 1 triggered | ||
247 | if ((mLCD->ButtonIsPressed(LG_BUTTON_1) | ||
248 | || mLCD->ButtonIsPressed(LG_BUTTON_2) | ||
249 | || mLCD->ButtonIsPressed(LG_BUTTON_3) | ||
250 | || mLCD->ButtonIsPressed(LG_BUTTON_4) | ||
251 | ) && mDebounceTimer.getElapsedTimeF32() > DEBOUNCE_DURATION) | ||
252 | { | ||
253 | // if so, move us on a page | ||
254 | mCurrentGroupBeingShown = GetNextPageToDisplay(); | ||
255 | mDisplayTimer.reset(); | ||
256 | mDebounceTimer.reset(); | ||
257 | } | ||
258 | |||
259 | // update that which is being show | ||
260 | mCurrentGroupBeingShown->UpdateDetails(); | ||
261 | |||
262 | // set which page is shown | ||
263 | mLCD->ShowPage(mPageToShow); | ||
264 | |||
265 | // Must run the following every loop. | ||
266 | mLCD->Update(); | ||
267 | } | ||
268 | } | ||
269 | } | ||
270 | |||
271 | |||
272 | // accessor functions | ||
273 | bool llLCD::Enabled() | ||
274 | { | ||
275 | return mInited; | ||
276 | } | ||
277 | |||
278 | BOOL llLCD::AreZ10Available() | ||
279 | { | ||
280 | if (mInited == true) | ||
281 | { | ||
282 | return mLCD->AnyDeviceOfThisFamilyPresent(LGLCD_DEVICE_FAMILY_SPEAKERS_Z10); | ||
283 | } | ||
284 | return false; | ||
285 | } | ||
286 | |||
287 | BOOL llLCD::IsG15Available() | ||
288 | { | ||
289 | if (mInited == true) | ||
290 | { | ||
291 | return mLCD->AnyDeviceOfThisFamilyPresent(LGLCD_DEVICE_FAMILY_KEYBOARD_G15); | ||
292 | } | ||
293 | return false; | ||
294 | } | ||
295 | |||
296 | #endif | ||
diff --git a/linden/indra/llwindow/lllogitechlcd.h b/linden/indra/llwindow/lllogitechlcd.h new file mode 100644 index 0000000..6804bef --- /dev/null +++ b/linden/indra/llwindow/lllogitechlcd.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /** | ||
2 | * @file lcd.h | ||
3 | * @brief Description of the LCD owner class. | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlife.com/developers/opensource/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #ifndef LL_LOGITECH_LCD_H | ||
33 | #define LL_LOGITECH_LCD_H | ||
34 | |||
35 | #include <vector> | ||
36 | #include "llFrametimer.h" | ||
37 | |||
38 | class CEzLcd; | ||
39 | |||
40 | // TO Add a new display page groups, duplicate the Region or Debug or Chat class, then modify what's actually displayed (ie how many pages and whats in them) | ||
41 | // in the constructor and update display functions. | ||
42 | // Remember to add in a new enum type for the new display type, and add in functions to actually create/update or remove this page in the SetupDisplayPages function | ||
43 | // And, of course, add the new option to the Menu in llpanelLCDoption.xml, and save details (duplicate the ones for debug or region). | ||
44 | |||
45 | // this defines one pages worth of display items. | ||
46 | class llLCDSpecificPage | ||
47 | { | ||
48 | public: | ||
49 | int mPageIndex; | ||
50 | typedef std::vector<HANDLE> displayItemArray_t; | ||
51 | // array of indexes that come from the lcd display sdk for specific items being displayed on a given page | ||
52 | displayItemArray_t mDisplayItemArray; | ||
53 | }; | ||
54 | |||
55 | // this defines a group of pages - associated with a specific type of display, like Debug, Linden Account info, region etc | ||
56 | // NOTE this can have more than one page associated with it - so it has an array of cLCDSpecificPage for each page. | ||
57 | class llLCDPageGroup | ||
58 | { | ||
59 | public: | ||
60 | llLCDPageGroup(CEzLcd *LCD, int type, HICON SLIcon); | ||
61 | virtual ~llLCDPageGroup(); | ||
62 | virtual void UpdateDetails() = 0; | ||
63 | virtual void GetDisplayable() = 0; | ||
64 | int mType; | ||
65 | HANDLE mHandle; | ||
66 | typedef std::vector<llLCDSpecificPage> pageArray_t; | ||
67 | pageArray_t mPageArray; | ||
68 | BOOL mDisplayPage; | ||
69 | protected: | ||
70 | |||
71 | CEzLcd *mLCD; | ||
72 | HICON mSLIcon; | ||
73 | }; | ||
74 | |||
75 | |||
76 | // class that defines the Default page - used if nothing else is enabled | ||
77 | class llDefaultPageGroup : public llLCDPageGroup | ||
78 | { | ||
79 | public: | ||
80 | llDefaultPageGroup(CEzLcd *LCD, int type, HICON SLIcon); | ||
81 | virtual void UpdateDetails(); | ||
82 | virtual void GetDisplayable(); | ||
83 | }; | ||
84 | |||
85 | // Root class - contains pointers to actual LCD display object, and arrays of page groups to be displayed | ||
86 | class llLCD | ||
87 | { | ||
88 | public: | ||
89 | enum | ||
90 | { | ||
91 | kLCDDefault, | ||
92 | kLCDDebug, | ||
93 | kLCDChat, | ||
94 | kLCDRegion, | ||
95 | kLCDLinden, | ||
96 | kLCDIM, | ||
97 | kLCDDebugConsole, | ||
98 | kMaxLCDPageGroups | ||
99 | }; | ||
100 | llLCD(HINSTANCE instance); | ||
101 | ~llLCD(); | ||
102 | void UpdateDisplay(); | ||
103 | bool Enabled(); | ||
104 | BOOL AreZ10Available(); | ||
105 | BOOL IsG15Available(); | ||
106 | |||
107 | typedef std::vector<llLCDPageGroup *> pageGroupArray_t; | ||
108 | pageGroupArray_t mPageGroupArray; | ||
109 | HICON mSLIcon; | ||
110 | CEzLcd *mLCD; | ||
111 | private: | ||
112 | |||
113 | // member functions to display data | ||
114 | void SetUpDisplayPages(); | ||
115 | llLCDPageGroup *GetNextPageToDisplay(); | ||
116 | |||
117 | llLCDPageGroup *mCurrentGroupBeingShown; | ||
118 | |||
119 | // members | ||
120 | bool mInited; | ||
121 | |||
122 | int mPageToShow; | ||
123 | LLFrameTimer mDisplayTimer; | ||
124 | LLFrameTimer mDebounceTimer; | ||
125 | HINSTANCE mInstance; // necessary for loading some icons for the dot matrix LCD display to use | ||
126 | bool mFirstTimeThru; | ||
127 | |||
128 | |||
129 | // actual display set up variables | ||
130 | int mDestinationLCD; | ||
131 | }; | ||
132 | |||
133 | |||
134 | |||
135 | #endif \ No newline at end of file | ||
diff --git a/linden/indra/llwindow/llwindow.vcproj b/linden/indra/llwindow/llwindow.vcproj index f2f4e32..cb49783 100644 --- a/linden/indra/llwindow/llwindow.vcproj +++ b/linden/indra/llwindow/llwindow.vcproj | |||
@@ -19,7 +19,7 @@ | |||
19 | <Tool | 19 | <Tool |
20 | Name="VCCLCompilerTool" | 20 | Name="VCCLCompilerTool" |
21 | Optimization="0" | 21 | Optimization="0" |
22 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 22 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
23 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG" | 23 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG" |
24 | MinimalRebuild="TRUE" | 24 | MinimalRebuild="TRUE" |
25 | BasicRuntimeChecks="3" | 25 | BasicRuntimeChecks="3" |
@@ -63,7 +63,7 @@ | |||
63 | CharacterSet="1"> | 63 | CharacterSet="1"> |
64 | <Tool | 64 | <Tool |
65 | Name="VCCLCompilerTool" | 65 | Name="VCCLCompilerTool" |
66 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 66 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
67 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" | 67 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" |
68 | RuntimeLibrary="0" | 68 | RuntimeLibrary="0" |
69 | StructMemberAlignment="0" | 69 | StructMemberAlignment="0" |
@@ -106,7 +106,7 @@ | |||
106 | <Tool | 106 | <Tool |
107 | Name="VCCLCompilerTool" | 107 | Name="VCCLCompilerTool" |
108 | Optimization="0" | 108 | Optimization="0" |
109 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\GLMESA;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 109 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\GLMESA;..\..\libraries\i686-win32\include;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
110 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" | 110 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" |
111 | MinimalRebuild="TRUE" | 111 | MinimalRebuild="TRUE" |
112 | BasicRuntimeChecks="3" | 112 | BasicRuntimeChecks="3" |
@@ -151,7 +151,7 @@ | |||
151 | <Tool | 151 | <Tool |
152 | Name="VCCLCompilerTool" | 152 | Name="VCCLCompilerTool" |
153 | Optimization="0" | 153 | Optimization="0" |
154 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 154 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
155 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" | 155 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" |
156 | RuntimeLibrary="0" | 156 | RuntimeLibrary="0" |
157 | StructMemberAlignment="0" | 157 | StructMemberAlignment="0" |
@@ -206,6 +206,9 @@ | |||
206 | RelativePath=".\llkeyboardwin32.cpp"> | 206 | RelativePath=".\llkeyboardwin32.cpp"> |
207 | </File> | 207 | </File> |
208 | <File | 208 | <File |
209 | RelativePath=".\lllogitechlcd.cpp"> | ||
210 | </File> | ||
211 | <File | ||
209 | RelativePath=".\llwindow.cpp"> | 212 | RelativePath=".\llwindow.cpp"> |
210 | </File> | 213 | </File> |
211 | <File | 214 | <File |
@@ -244,6 +247,9 @@ | |||
244 | RelativePath=".\llkeyboardwin32.h"> | 247 | RelativePath=".\llkeyboardwin32.h"> |
245 | </File> | 248 | </File> |
246 | <File | 249 | <File |
250 | RelativePath=".\lllogitechlcd.h"> | ||
251 | </File> | ||
252 | <File | ||
247 | RelativePath=".\llmousehandler.h"> | 253 | RelativePath=".\llmousehandler.h"> |
248 | </File> | 254 | </File> |
249 | <File | 255 | <File |
diff --git a/linden/indra/llwindow/llwindow_vc8.vcproj b/linden/indra/llwindow/llwindow_vc8.vcproj index 803f11c..019d6a9 100644 --- a/linden/indra/llwindow/llwindow_vc8.vcproj +++ b/linden/indra/llwindow/llwindow_vc8.vcproj | |||
@@ -41,7 +41,7 @@ | |||
41 | <Tool | 41 | <Tool |
42 | Name="VCCLCompilerTool" | 42 | Name="VCCLCompilerTool" |
43 | Optimization="0" | 43 | Optimization="0" |
44 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" | 44 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
45 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" | 45 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" |
46 | MinimalRebuild="true" | 46 | MinimalRebuild="true" |
47 | BasicRuntimeChecks="3" | 47 | BasicRuntimeChecks="3" |
@@ -108,7 +108,7 @@ | |||
108 | /> | 108 | /> |
109 | <Tool | 109 | <Tool |
110 | Name="VCCLCompilerTool" | 110 | Name="VCCLCompilerTool" |
111 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" | 111 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
112 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | 112 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" |
113 | TreatWChar_tAsBuiltInType="false" | 113 | TreatWChar_tAsBuiltInType="false" |
114 | ForceConformanceInForLoopScope="true" | 114 | ForceConformanceInForLoopScope="true" |
@@ -171,7 +171,7 @@ | |||
171 | <Tool | 171 | <Tool |
172 | Name="VCCLCompilerTool" | 172 | Name="VCCLCompilerTool" |
173 | Optimization="0" | 173 | Optimization="0" |
174 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\GLMESA;..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" | 174 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\GLMESA;..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
175 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" | 175 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" |
176 | MinimalRebuild="true" | 176 | MinimalRebuild="true" |
177 | BasicRuntimeChecks="3" | 177 | BasicRuntimeChecks="3" |
@@ -239,7 +239,7 @@ | |||
239 | <Tool | 239 | <Tool |
240 | Name="VCCLCompilerTool" | 240 | Name="VCCLCompilerTool" |
241 | Optimization="0" | 241 | Optimization="0" |
242 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" | 242 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;..\..\libraries\include\Logitech_LCD;..\..\libraries\include\Logitech_LCD\LCDUI" |
243 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | 243 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" |
244 | RuntimeLibrary="0" | 244 | RuntimeLibrary="0" |
245 | StructMemberAlignment="0" | 245 | StructMemberAlignment="0" |
@@ -305,6 +305,10 @@ | |||
305 | > | 305 | > |
306 | </File> | 306 | </File> |
307 | <File | 307 | <File |
308 | RelativePath=".\lllogitechlcd.cpp" | ||
309 | > | ||
310 | </File> | ||
311 | <File | ||
308 | RelativePath=".\llwindow.cpp" | 312 | RelativePath=".\llwindow.cpp" |
309 | > | 313 | > |
310 | </File> | 314 | </File> |
@@ -355,6 +359,10 @@ | |||
355 | > | 359 | > |
356 | </File> | 360 | </File> |
357 | <File | 361 | <File |
362 | RelativePath=".\lllogitechlcd.h" | ||
363 | > | ||
364 | </File> | ||
365 | <File | ||
358 | RelativePath=".\llmousehandler.h" | 366 | RelativePath=".\llmousehandler.h" |
359 | > | 367 | > |
360 | </File> | 368 | </File> |
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index bb99d4c..c84611b 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp | |||
@@ -89,6 +89,7 @@ void show_window_creation_error(const char* title) | |||
89 | BOOL LLWindowWin32::sIsClassRegistered = FALSE; | 89 | BOOL LLWindowWin32::sIsClassRegistered = FALSE; |
90 | 90 | ||
91 | BOOL LLWindowWin32::sLanguageTextInputAllowed = TRUE; | 91 | BOOL LLWindowWin32::sLanguageTextInputAllowed = TRUE; |
92 | BOOL LLWindowWin32::sWinIMEOpened = FALSE; | ||
92 | HKL LLWindowWin32::sWinInputLocale = 0; | 93 | HKL LLWindowWin32::sWinInputLocale = 0; |
93 | DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; | 94 | DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; |
94 | DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; | 95 | DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; |
@@ -3324,7 +3325,7 @@ void LLWindowWin32::focusClient() | |||
3324 | 3325 | ||
3325 | void LLWindowWin32::allowLanguageTextInput(BOOL b) | 3326 | void LLWindowWin32::allowLanguageTextInput(BOOL b) |
3326 | { | 3327 | { |
3327 | if ( !LLWinImm::isAvailable() ) | 3328 | if (b == sLanguageTextInputAllowed || !LLWinImm::isAvailable()) |
3328 | { | 3329 | { |
3329 | return; | 3330 | return; |
3330 | } | 3331 | } |
@@ -3335,14 +3336,13 @@ void LLWindowWin32::allowLanguageTextInput(BOOL b) | |||
3335 | // Allowing: Restore the previous IME status, so that the user has a feeling that the previous | 3336 | // Allowing: Restore the previous IME status, so that the user has a feeling that the previous |
3336 | // text input continues naturally. Be careful, however, the IME status is meaningful only during the user keeps | 3337 | // text input continues naturally. Be careful, however, the IME status is meaningful only during the user keeps |
3337 | // using same Input Locale (aka Keyboard Layout). | 3338 | // using same Input Locale (aka Keyboard Layout). |
3338 | HIMC himc = LLWinImm::getContext(mWindowHandle); | 3339 | if (sWinIMEOpened && GetKeyboardLayout(0) == sWinInputLocale) |
3339 | LLWinImm::setOpenStatus(himc, TRUE); | ||
3340 | if (GetKeyboardLayout(0) == sWinInputLocale && sWinIMEConversionMode != IME_CMODE_RESERVED) | ||
3341 | { | 3340 | { |
3341 | HIMC himc = LLWinImm::getContext(mWindowHandle); | ||
3342 | LLWinImm::setOpenStatus(himc, TRUE); | ||
3342 | LLWinImm::setConversionStatus(himc, sWinIMEConversionMode, sWinIMESentenceMode); | 3343 | LLWinImm::setConversionStatus(himc, sWinIMEConversionMode, sWinIMESentenceMode); |
3343 | sWinIMEConversionMode = IME_CMODE_RESERVED; // Set saved state so we won't do this repeatedly | 3344 | LLWinImm::releaseContext(mWindowHandle, himc); |
3344 | } | 3345 | } |
3345 | LLWinImm::releaseContext(mWindowHandle, himc); | ||
3346 | } | 3346 | } |
3347 | else | 3347 | else |
3348 | { | 3348 | { |
@@ -3350,10 +3350,12 @@ void LLWindowWin32::allowLanguageTextInput(BOOL b) | |||
3350 | // However, do it after saving the current IME status. We need to restore the status when | 3350 | // However, do it after saving the current IME status. We need to restore the status when |
3351 | // allowing language text input again. | 3351 | // allowing language text input again. |
3352 | sWinInputLocale = GetKeyboardLayout(0); | 3352 | sWinInputLocale = GetKeyboardLayout(0); |
3353 | if ( LLWinImm::isIME(sWinInputLocale) ) | 3353 | sWinIMEOpened = LLWinImm::isIME(sWinInputLocale); |
3354 | if (sWinIMEOpened) | ||
3354 | { | 3355 | { |
3355 | HIMC himc = LLWinImm::getContext(mWindowHandle); | 3356 | HIMC himc = LLWinImm::getContext(mWindowHandle); |
3356 | if ( LLWinImm::getOpenStatus(himc) ) | 3357 | sWinIMEOpened = LLWinImm::getOpenStatus(himc); |
3358 | if (sWinIMEOpened) | ||
3357 | { | 3359 | { |
3358 | LLWinImm::getConversionStatus(himc, &sWinIMEConversionMode, &sWinIMESentenceMode); | 3360 | LLWinImm::getConversionStatus(himc, &sWinIMEConversionMode, &sWinIMESentenceMode); |
3359 | 3361 | ||
diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h index 938ece9..f1e977e 100644 --- a/linden/indra/llwindow/llwindowwin32.h +++ b/linden/indra/llwindow/llwindowwin32.h | |||
@@ -184,6 +184,7 @@ protected: | |||
184 | // They are all static, since one context is shared by all LLWindowWin32 | 184 | // They are all static, since one context is shared by all LLWindowWin32 |
185 | // instances. | 185 | // instances. |
186 | static BOOL sLanguageTextInputAllowed; | 186 | static BOOL sLanguageTextInputAllowed; |
187 | static BOOL sWinIMEOpened; | ||
187 | static HKL sWinInputLocale; | 188 | static HKL sWinInputLocale; |
188 | static DWORD sWinIMEConversionMode; | 189 | static DWORD sWinIMEConversionMode; |
189 | static DWORD sWinIMESentenceMode; | 190 | static DWORD sWinIMESentenceMode; |