From f6ed8fc1f51e368bb76905d9f1d2d3735e70a644 Mon Sep 17 00:00:00 2001 From: that Date: Sat, 14 Feb 2015 20:23:16 +0100 Subject: gui: make resources type safe - add string, int, color and resource loading helpers - use typed resource classes, and some cleanup in loading code - remove abstract GetResource() to enforce type safe access - add height and width query methods to resources and use them - minor cleanup - simplify LoadPlacement Change-Id: I9b81785109a80b3806ad6b50cba4d893b87b0db1 --- gui/keyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gui/keyboard.cpp') diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp index db968aee0..5528be936 100644 --- a/gui/keyboard.cpp +++ b/gui/keyboard.cpp @@ -102,7 +102,7 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node) strcpy(resource, "resource1"); attr = child->first_attribute(resource); while (attr && layoutindex < (MAX_KEYBOARD_LAYOUTS + 1)) { - keyboardImg[layoutindex - 1] = PageManager::FindResource(attr->value()); + keyboardImg[layoutindex - 1] = LoadAttrImage(child, resource); layoutindex++; resource[8] = (char)(layoutindex + 48); @@ -113,8 +113,8 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node) // Check the first image to get height and width if (keyboardImg[0] && keyboardImg[0]->GetResource()) { - KeyboardWidth = gr_get_width(keyboardImg[0]->GetResource()); - KeyboardHeight = gr_get_height(keyboardImg[0]->GetResource()); + KeyboardWidth = keyboardImg[0]->GetWidth(); + KeyboardHeight = keyboardImg[0]->GetHeight(); } // Load all of the layout maps -- cgit v1.2.3