mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-01 10:17:28 +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:
parent
ba6003606e
commit
c6db9ff21b
@ -23,9 +23,13 @@
|
|||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
#include "powersaver.h"
|
#include "powersaver.h"
|
||||||
|
|
||||||
|
#include <SDL.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
static SDL_Joystick *joystick;
|
static SDL_Joystick *joystick;
|
||||||
|
|
||||||
void InputManager::init(const string &conffile) {
|
void InputManager::init(const string &conffile) {
|
||||||
|
@ -21,10 +21,7 @@
|
|||||||
#ifndef INPUTMANAGER_H
|
#ifndef INPUTMANAGER_H
|
||||||
#define INPUTMANAGER_H
|
#define INPUTMANAGER_H
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <string>
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
typedef enum buttontype_e {
|
typedef enum buttontype_e {
|
||||||
UP, DOWN, LEFT, RIGHT,
|
UP, DOWN, LEFT, RIGHT,
|
||||||
@ -42,7 +39,7 @@ enum state_e {PRESSED, RELEASED};
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
source_type_e source;
|
source_type_e source;
|
||||||
Uint32 code;
|
unsigned int code;
|
||||||
} input_t;
|
} input_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -56,7 +53,7 @@ public:
|
|||||||
InputManager();
|
InputManager();
|
||||||
~InputManager();
|
~InputManager();
|
||||||
|
|
||||||
void init(const string &conffile);
|
void init(const std::string &conffile);
|
||||||
void waitForEvent(bevent_t *event);
|
void waitForEvent(bevent_t *event);
|
||||||
buttontype_t waitForPressedButton();
|
buttontype_t waitForPressedButton();
|
||||||
buttontype_t waitForReleasedButton();
|
buttontype_t waitForReleasedButton();
|
||||||
@ -65,7 +62,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
input_t ButtonMap[BUTTONTYPE_T_SIZE];
|
input_t ButtonMap[BUTTONTYPE_T_SIZE];
|
||||||
|
|
||||||
bool readConfFile(const string &conffile);
|
bool readConfFile(const std::string &conffile);
|
||||||
void initJoystick();
|
void initJoystick();
|
||||||
bool getEvent(bevent_t *bevent, bool wait);
|
bool getEvent(bevent_t *bevent, bool wait);
|
||||||
buttontype_t waitForButton(enum state_e state);
|
buttontype_t waitForButton(enum state_e state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user