1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 20:52:56 +03:00

InputManager: reduce namespace pollution.

Moved dependency on SDL to implementation file.
Don't import std namespace in header.
If we need std::string, import <string>, not something else.
This commit is contained in:
Maarten ter Huurne 2011-10-23 08:15:23 +02:00
parent ba6003606e
commit c6db9ff21b
2 changed files with 8 additions and 7 deletions

View File

@ -23,9 +23,13 @@
#include "utilities.h"
#include "powersaver.h"
#include <SDL.h>
#include <iostream>
#include <fstream>
using namespace std;
static SDL_Joystick *joystick;
void InputManager::init(const string &conffile) {

View File

@ -21,10 +21,7 @@
#ifndef INPUTMANAGER_H
#define INPUTMANAGER_H
#include <SDL.h>
#include <sstream>
using namespace std;
#include <string>
typedef enum buttontype_e {
UP, DOWN, LEFT, RIGHT,
@ -42,7 +39,7 @@ enum state_e {PRESSED, RELEASED};
typedef struct {
source_type_e source;
Uint32 code;
unsigned int code;
} input_t;
typedef struct {
@ -56,7 +53,7 @@ public:
InputManager();
~InputManager();
void init(const string &conffile);
void init(const std::string &conffile);
void waitForEvent(bevent_t *event);
buttontype_t waitForPressedButton();
buttontype_t waitForReleasedButton();
@ -65,7 +62,7 @@ public:
private:
input_t ButtonMap[BUTTONTYPE_T_SIZE];
bool readConfFile(const string &conffile);
bool readConfFile(const std::string &conffile);
void initJoystick();
bool getEvent(bevent_t *bevent, bool wait);
buttontype_t waitForButton(enum state_e state);