2015-04-16 16:55:32 +00:00
|
|
|
#ifndef _GWEN_USER_INTERFACE_H
|
|
|
|
#define _GWEN_USER_INTERFACE_H
|
|
|
|
|
|
|
|
struct GwenInternalData;
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
typedef void (*b3ComboBoxCallback)(int combobox, const char* item);
|
2015-04-16 16:55:32 +00:00
|
|
|
typedef void (*b3ToggleButtonCallback)(int button, int state);
|
|
|
|
typedef void (*b3FileOpenCallback)();
|
2015-05-29 22:04:05 +00:00
|
|
|
typedef void (*b3QuitCallback)();
|
2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
namespace Gwen
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
namespace Renderer
|
|
|
|
{
|
|
|
|
class Base;
|
2015-04-16 16:55:32 +00:00
|
|
|
};
|
2018-09-23 21:17:31 +00:00
|
|
|
}; // namespace Gwen
|
2015-04-16 16:55:32 +00:00
|
|
|
class GwenUserInterface
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
GwenInternalData* m_data;
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
public:
|
|
|
|
GwenUserInterface();
|
|
|
|
|
|
|
|
virtual ~GwenUserInterface();
|
|
|
|
|
|
|
|
void init(int width, int height, Gwen::Renderer::Base* gwenRenderer, float retinaScale);
|
|
|
|
void exit();
|
|
|
|
void setFocus();
|
|
|
|
void forceUpdateScrollBars();
|
|
|
|
|
|
|
|
void draw(int width, int height);
|
|
|
|
|
|
|
|
void resize(int width, int height);
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
bool mouseMoveCallback(float x, float y);
|
|
|
|
bool mouseButtonCallback(int button, int state, float x, float y);
|
|
|
|
bool keyboardCallback(int key, int state);
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void setToggleButtonCallback(b3ToggleButtonCallback callback);
|
|
|
|
b3ToggleButtonCallback getToggleButtonCallback();
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void registerToggleButton2(int buttonId, const char* name);
|
|
|
|
|
|
|
|
void setComboBoxCallback(b3ComboBoxCallback callback);
|
|
|
|
b3ComboBoxCallback getComboBoxCallback();
|
|
|
|
void registerComboBox2(int buttonId, int numItems, const char** items, int startItem = 0);
|
|
|
|
|
|
|
|
void setStatusBarMessage(const char* message, bool isLeft = true);
|
|
|
|
|
|
|
|
void textOutput(const char* msg);
|
|
|
|
void setExampleDescription(const char* msg);
|
|
|
|
|
|
|
|
void registerFileOpenCallback(b3FileOpenCallback callback);
|
|
|
|
void registerQuitCallback(b3QuitCallback callback);
|
|
|
|
|
|
|
|
GwenInternalData* getInternalData()
|
|
|
|
{
|
|
|
|
return m_data;
|
|
|
|
}
|
|
|
|
};
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
#endif //_GWEN_USER_INTERFACE_H
|