| 1 |
/*************************************************************************** |
| 2 |
* Copyright (C) 2005-2019 by the FIFE team * |
| 3 |
* http://www.fifengine.net * |
| 4 |
* This file is part of FIFE. * |
| 5 |
* * |
| 6 |
* FIFE is free software; you can redistribute it and/or * |
| 7 |
* modify it under the terms of the GNU Lesser General Public * |
| 8 |
* License as published by the Free Software Foundation; either * |
| 9 |
* version 2.1 of the License, or (at your option) any later version. * |
| 10 |
* * |
| 11 |
* This library is distributed in the hope that it will be useful, * |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 14 |
* Lesser General Public License for more details. * |
| 15 |
* * |
| 16 |
* You should have received a copy of the GNU Lesser General Public * |
| 17 |
* License along with this library; if not, write to the * |
| 18 |
* Free Software Foundation, Inc., * |
| 19 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * |
| 20 |
***************************************************************************/ |
| 21 |
|
| 22 |
%module fife |
| 23 |
%{ |
| 24 |
#include <fifechan.hpp> |
| 25 |
#include "gui/fifechan/fifechanmanager.h" |
| 26 |
#include "gui/guimanager.h" |
| 27 |
%} |
| 28 |
|
| 29 |
%include "gui/guimanager.i" |
| 30 |
|
| 31 |
namespace fcn { |
| 32 |
class Widget; |
| 33 |
} |
| 34 |
namespace FIFE { |
| 35 |
class Console; |
| 36 |
class Cursor; |
| 37 |
|
| 38 |
class FifechanManager : public IGUIManager { |
| 39 |
public: |
| 40 |
FifechanManager(); |
| 41 |
virtual ~FifechanManager(); |
| 42 |
|
| 43 |
void init(const std::string& backend, int32_t screenWidth, int32_t screenHeight); |
| 44 |
|
| 45 |
Console* getConsole() const; |
| 46 |
void setConsoleEnabled(bool console); |
| 47 |
bool isConsoleEnabled() const; |
| 48 |
|
| 49 |
void setCursor(Cursor* cursor); |
| 50 |
Cursor* getCursor() const; |
| 51 |
|
| 52 |
void add(fcn::Widget* widget); |
| 53 |
void remove(fcn::Widget* widget); |
| 54 |
|
| 55 |
GuiFont* createFont(const std::string& path, uint32_t size, const std::string& glyphs); |
| 56 |
void releaseFont(GuiFont* font); |
| 57 |
GuiFont* setDefaultFont(const std::string& path, uint32_t size, const std::string& glyphs); |
| 58 |
GuiFont* getDefaultFont(); |
| 59 |
|
| 60 |
KeyEvent translateKeyEvent(const fcn::KeyEvent& evt); |
| 61 |
MouseEvent translateMouseEvent(const fcn::MouseEvent& evt); |
| 62 |
|
| 63 |
void setTabbingEnabled(bool tabbing); |
| 64 |
bool isTabbingEnabled() const; |
| 65 |
private: |
| 66 |
virtual void turn(); |
| 67 |
virtual void resizeTopContainer(uint32_t x, uint32_t y, uint32_t width, uint32_t height); |
| 68 |
virtual bool onSdlEvent(SDL_Event& evt); |
| 69 |
}; |
| 70 |
} |