Skip to content

Commit

Permalink
gui: keyboard doesn't need its own action
Browse files Browse the repository at this point in the history
This was questionable design and is unused anyway.
Also reduced a few redundant #includes.

Change-Id: I65bb01120e6072c5695755920242f6f9d73c816e
  • Loading branch information
that1 committed Mar 14, 2015
1 parent f5c2d6c commit 6db855e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
30 changes: 2 additions & 28 deletions gui/keyboard.cpp
Expand Up @@ -16,20 +16,8 @@
along with TWRP. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/reboot.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
#include "../data.hpp"

#include <string>
Expand Down Expand Up @@ -61,18 +49,10 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)

mRendered = false;
currentLayout = 1;
mAction = NULL;
KeyboardHeight = KeyboardWidth = 0;

if (!node) return;

// Load the action
child = FindNode(node, "action");
if (child)
{
mAction = new GUIAction(node);
}

mHighlightColor = LoadAttrColor(FindNode(node, "highlight"), "color", &hasHighlight);
mCapsHighlightColor = LoadAttrColor(FindNode(node, "capshighlight"), "color", &hasCapsHighlight);

Expand Down Expand Up @@ -330,7 +310,6 @@ int GUIKeyboard::SetRenderPos(int x, int y, int w, int h)
mRenderH = KeyboardHeight;
}

if (mAction) mAction->SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH);
SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH);
return 0;
}
Expand Down Expand Up @@ -468,13 +447,8 @@ int GUIKeyboard::NotifyTouch(TOUCH_STATE state, int x, int y)
} else if ((int)key.key == KEYBOARD_ACTION) {
// Action
highlightRenderCount = 0;
if (mAction) {
// Keyboard has its own action defined
return (mAction ? mAction->NotifyTouch(state, x, y) : 1);
} else {
// Send action notification
PageManager::NotifyKeyboard(key.key);
}
// Send action notification
PageManager::NotifyKeyboard(key.key);
}
} else if (state == TOUCH_HOLD) {
was_held = 1;
Expand Down
1 change: 0 additions & 1 deletion gui/objects.hpp
Expand Up @@ -872,7 +872,6 @@ class GUIKeyboard : public GUIObject, public RenderObject, public ActionObject
unsigned int KeyboardWidth, KeyboardHeight;
int rowY, colX, highlightRenderCount;
bool hasHighlight, hasCapsHighlight;
GUIAction* mAction;
COLOR mHighlightColor;
COLOR mCapsHighlightColor;
};
Expand Down

0 comments on commit 6db855e

Please sign in to comment.