| 3078 | } |
| 3079 | |
| 3080 | void AcquireInputFocus(Collection* collection, HInstance instance) |
| 3081 | { |
| 3082 | bool found = false; |
| 3083 | for (uint32_t i = 0; i < collection->m_InputFocusStack.Size(); ++i) |
| 3084 | { |
| 3085 | if (collection->m_InputFocusStack[i] == instance) |
| 3086 | { |
| 3087 | found = true; |
| 3088 | } |
| 3089 | if (found && i < collection->m_InputFocusStack.Size() - 1) |
| 3090 | { |
| 3091 | collection->m_InputFocusStack[i] = collection->m_InputFocusStack[i + 1]; |
| 3092 | } |
| 3093 | } |
| 3094 | if (found) |
| 3095 | { |
| 3096 | collection->m_InputFocusStack.Pop(); |
| 3097 | } |
| 3098 | if (!collection->m_InputFocusStack.Full()) |
| 3099 | { |
| 3100 | collection->m_InputFocusStack.Push(instance); |
| 3101 | } |
| 3102 | else |
| 3103 | { |
| 3104 | dmLogWarning("Input focus could not be acquired since the buffer is full (%d).", collection->m_InputFocusStack.Size()); |
| 3105 | } |
| 3106 | } |
| 3107 | |
| 3108 | void ReleaseInputFocus(Collection* collection, HInstance instance) |
| 3109 | { |