| 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/widgets/animationicon.h" |
| 26 |
#include "gui/fifechan/widgets/clicklabel.h" |
| 27 |
#include "gui/fifechan/widgets/percentagebar.h" |
| 28 |
#include "gui/fifechan/widgets/resizablewindow.h" |
| 29 |
#include "gui/fifechan/widgets/dockarea.h" |
| 30 |
#include "gui/fifechan/widgets/panel.h" |
| 31 |
%} |
| 32 |
|
| 33 |
namespace fcn { |
| 34 |
class ActionListener; |
| 35 |
class Color; |
| 36 |
class Font; |
| 37 |
class Image; |
| 38 |
class KeyListener; |
| 39 |
class MouseListener; |
| 40 |
class WidgetListener; |
| 41 |
class Widget; |
| 42 |
|
| 43 |
|
| 44 |
%feature("notabstract") AnimationIcon; |
| 45 |
class AnimationIcon: public Icon { |
| 46 |
public: |
| 47 |
AnimationIcon(); |
| 48 |
AnimationIcon(FIFE::AnimationPtr animation); |
| 49 |
virtual ~AnimationIcon(); |
| 50 |
void setAnimation(FIFE::AnimationPtr animation); |
| 51 |
FIFE::AnimationPtr getAnimation() const; |
| 52 |
void setRepeating(bool repeat); |
| 53 |
bool isRepeating() const; |
| 54 |
void play(); |
| 55 |
bool isPlaying() const; |
| 56 |
void pause(); |
| 57 |
void stop(); |
| 58 |
}; |
| 59 |
|
| 60 |
%feature("notabstract") ClickLabel; |
| 61 |
%rename(Label) ClickLabel; |
| 62 |
class ClickLabel: public Widget { |
| 63 |
public: |
| 64 |
ClickLabel(); |
| 65 |
ClickLabel(const std::string& caption); |
| 66 |
virtual ~ClickLabel(); |
| 67 |
virtual void setCaption(const std::string& caption); |
| 68 |
virtual const std::string& getCaption() const; |
| 69 |
void setAlignment(Graphics::Alignment alignment); |
| 70 |
Graphics::Alignment getAlignment() const; |
| 71 |
void setOpaque(bool opaque); |
| 72 |
bool isOpaque() const; |
| 73 |
bool isTextWrapping() const; |
| 74 |
void setTextWrapping(bool); |
| 75 |
virtual void adjustSize(); |
| 76 |
}; |
| 77 |
|
| 78 |
%feature("notabstract") PercentageBar; |
| 79 |
class PercentageBar: public Widget { |
| 80 |
public: |
| 81 |
PercentageBar(); |
| 82 |
virtual ~PercentageBar(); |
| 83 |
virtual void setForegroundImage(Image* image); |
| 84 |
virtual void setOrientation(PercentageBar::Orientation orientation); |
| 85 |
virtual PercentageBar::Orientation getOrientation() const; |
| 86 |
virtual int32_t getValue() const; |
| 87 |
virtual void setValue(int32_t value); |
| 88 |
|
| 89 |
enum Orientation |
| 90 |
{ |
| 91 |
HORIZONTAL = 0, |
| 92 |
VERTICAL |
| 93 |
}; |
| 94 |
}; |
| 95 |
|
| 96 |
%feature("notabstract") ResizableWindow; |
| 97 |
class ResizableWindow : public Window { |
| 98 |
public: |
| 99 |
enum CursorDirections { |
| 100 |
CURSOR_DIRECTION_L = 0, |
| 101 |
CURSOR_DIRECTION_R = 1, |
| 102 |
CURSOR_DIRECTION_T = 2, |
| 103 |
CURSOR_DIRECTION_B = 5, |
| 104 |
CURSOR_DIRECTION_LT = 3, |
| 105 |
CURSOR_DIRECTION_RT = 4, |
| 106 |
CURSOR_DIRECTION_LB = 6, |
| 107 |
CURSOR_DIRECTION_RB = 7 |
| 108 |
}; |
| 109 |
|
| 110 |
ResizableWindow(); |
| 111 |
ResizableWindow(bool resizable); |
| 112 |
ResizableWindow(const std::string& caption, bool resizable=true); |
| 113 |
virtual ~ResizableWindow(); |
| 114 |
void setResizableBorderDistance(int32_t border); |
| 115 |
int32_t getResizableBorderDistance() const; |
| 116 |
void setResizable(bool resizable); |
| 117 |
bool isResizable() const; |
| 118 |
void setTopResizable(bool resizable); |
| 119 |
bool isTopResizable() const; |
| 120 |
void setRightResizable(bool resizable); |
| 121 |
bool isRightResizable() const; |
| 122 |
void setBottomResizable(bool resizable); |
| 123 |
bool isBottomResizable() const; |
| 124 |
void setLeftResizable(bool resizable); |
| 125 |
bool isLeftResizable() const; |
| 126 |
void setShove(bool shove); |
| 127 |
bool getShove() const; |
| 128 |
void set(CursorDirections direction, uint32_t cursor_id=0); |
| 129 |
void set(CursorDirections direction, FIFE::ImagePtr image); |
| 130 |
void set(CursorDirections direction, FIFE::AnimationPtr anim); |
| 131 |
FIFE::MouseCursorType getType(CursorDirections direction) const; |
| 132 |
uint32_t getId(CursorDirections direction) const; |
| 133 |
FIFE::ImagePtr getImage(CursorDirections direction); |
| 134 |
FIFE::AnimationPtr getAnimation(CursorDirections direction); |
| 135 |
}; |
| 136 |
|
| 137 |
%feature("notabstract") DockArea; |
| 138 |
class DockArea : public ResizableWindow { |
| 139 |
public: |
| 140 |
DockArea(); |
| 141 |
DockArea(bool active); |
| 142 |
virtual ~DockArea(); |
| 143 |
|
| 144 |
void setActiveDockArea(bool active); |
| 145 |
bool isActiveDockArea() const; |
| 146 |
void setTopSide(bool side); |
| 147 |
bool isTopSide() const; |
| 148 |
void setRightSide(bool side); |
| 149 |
bool isRightSide() const; |
| 150 |
void setBottomSide(bool side); |
| 151 |
bool isBottomSide() const; |
| 152 |
void setLeftSide(bool side); |
| 153 |
bool isLeftSide() const; |
| 154 |
void dockWidget(Widget* widget); |
| 155 |
void undockWidget(Widget* widget); |
| 156 |
void setHighlighted(bool highlighted); |
| 157 |
bool isHighlighted() const; |
| 158 |
void setHighlightColor(const Color& color); |
| 159 |
const Color& getHighlightColor() const; |
| 160 |
}; |
| 161 |
|
| 162 |
%feature("notabstract") Panel; |
| 163 |
class Panel : public ResizableWindow { |
| 164 |
public: |
| 165 |
Panel(); |
| 166 |
Panel(bool dockable); |
| 167 |
virtual ~Panel(); |
| 168 |
|
| 169 |
void setDockable(bool dockable); |
| 170 |
bool isDockable() const; |
| 171 |
void setDocked(bool docked); |
| 172 |
bool isDocked() const; |
| 173 |
}; |
| 174 |
} |