#include "sclactionstate.h"
#include "sclres_manager.h"
#include "sclkeyfocushandler.h"
+#include "sclanimator.h"
#include <dlog.h>
using namespace scl;
{
if (!m_pending_update) {
CSCLWindowsImpl* impl = get_scl_windows_impl();
+ CSCLAnimator *animator = CSCLAnimator::get_instance();
+ CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+ CSCLContext *context = CSCLContext::get_instance();
+ CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
+
if (impl) {
impl->update_window(window, x, y, width, height);
+
+ /* If we are not updating the whole screen */
+ if (animator && cache && context && focus_handler && (x != 0 || y != 0 || width != 0 || height != 0)) {
+ sclboolean draw_highlight_ui = TRUE;
+ SclAnimationState *state = NULL;
+
+ if (animator) {
+ sclint id = animator->find_animator_by_type(ANIMATION_TYPE_HIGHLIGHT_UI);
+ state = animator->get_animation_state(id);
+ }
+ if (state) {
+ // If currently the highlight UI is being animated, don't update here
+ if (state->active) {
+ draw_highlight_ui = FALSE;
+ }
+ }
+
+ SclWindowContext *window_context = get_window_context(window);
+ if (focus_handler->get_current_focus_window() == window) {
+ sclint startx = 0;
+ sclint starty = 0;
+
+ SclWindowContext *base_window_context = get_window_context(get_base_window());
+ if (window_context && base_window_context) {
+ if (window_context->is_virtual) {
+ startx += (window_context->geometry.x - base_window_context->geometry.x);
+ starty += (window_context->geometry.y - base_window_context->geometry.y);
+ }
+ }
+ if (draw_highlight_ui && context->get_highlight_ui_enabled()) {
+ const SclLayoutKeyCoordinate *coordinate = NULL;
+ scl8 current_key_index = focus_handler->get_current_focus_key();
+ coordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
+ if (coordinate) {
+ // Update the highlighted area as well
+ impl->update_window(window, startx + coordinate->x, starty + coordinate->y, coordinate->width, coordinate->height);
+ }
+ }
+ }
+ }
}
}
}