| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #define INITGUID // required for GUID_PROP_INPUTSCOPE | 5 #define INITGUID // required for GUID_PROP_INPUTSCOPE |
| 6 #include "ui/base/ime/win/tsf_text_store.h" | 6 #include "ui/base/ime/win/tsf_text_store.h" |
| 7 | 7 |
| 8 #include <InputScope.h> | 8 #include <InputScope.h> |
| 9 #include <OleCtl.h> | 9 #include <OleCtl.h> |
| 10 | 10 |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 return E_INVALIDARG; | 603 return E_INVALIDARG; |
| 604 // We support only input scope attribute. | 604 // We support only input scope attribute. |
| 605 *attribute_buffer_copied = 0; | 605 *attribute_buffer_copied = 0; |
| 606 if (attribute_buffer_size == 0) | 606 if (attribute_buffer_size == 0) |
| 607 return S_OK; | 607 return S_OK; |
| 608 | 608 |
| 609 attribute_buffer[0].dwOverlapId = 0; | 609 attribute_buffer[0].dwOverlapId = 0; |
| 610 attribute_buffer[0].idAttr = GUID_PROP_INPUTSCOPE; | 610 attribute_buffer[0].idAttr = GUID_PROP_INPUTSCOPE; |
| 611 attribute_buffer[0].varValue.vt = VT_UNKNOWN; | 611 attribute_buffer[0].varValue.vt = VT_UNKNOWN; |
| 612 attribute_buffer[0].varValue.punkVal = tsf_inputscope::CreateInputScope( | 612 attribute_buffer[0].varValue.punkVal = tsf_inputscope::CreateInputScope( |
| 613 text_input_client_->GetTextInputType(), TEXT_INPUT_MODE_DEFAULT); | 613 text_input_client_->GetTextInputType(), |
| 614 text_input_client_->GetTextInputMode()); |
| 614 attribute_buffer[0].varValue.punkVal->AddRef(); | 615 attribute_buffer[0].varValue.punkVal->AddRef(); |
| 615 *attribute_buffer_copied = 1; | 616 *attribute_buffer_copied = 1; |
| 616 return S_OK; | 617 return S_OK; |
| 617 } | 618 } |
| 618 | 619 |
| 619 STDMETHODIMP TSFTextStore::SetSelection( | 620 STDMETHODIMP TSFTextStore::SetSelection( |
| 620 ULONG selection_buffer_size, | 621 ULONG selection_buffer_size, |
| 621 const TS_SELECTION_ACP* selection_buffer) { | 622 const TS_SELECTION_ACP* selection_buffer) { |
| 622 if (!HasReadWriteLock()) | 623 if (!HasReadWriteLock()) |
| 623 return TF_E_NOLOCK; | 624 return TF_E_NOLOCK; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 | 909 |
| 909 bool TSFTextStore::HasReadLock() const { | 910 bool TSFTextStore::HasReadLock() const { |
| 910 return (current_lock_type_ & TS_LF_READ) == TS_LF_READ; | 911 return (current_lock_type_ & TS_LF_READ) == TS_LF_READ; |
| 911 } | 912 } |
| 912 | 913 |
| 913 bool TSFTextStore::HasReadWriteLock() const { | 914 bool TSFTextStore::HasReadWriteLock() const { |
| 914 return (current_lock_type_ & TS_LF_READWRITE) == TS_LF_READWRITE; | 915 return (current_lock_type_ & TS_LF_READWRITE) == TS_LF_READWRITE; |
| 915 } | 916 } |
| 916 | 917 |
| 917 } // namespace ui | 918 } // namespace ui |
| OLD | NEW |