| 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 fifechan |
| 23 |
%{ |
| 24 |
#include <fifechan.hpp> |
| 25 |
%} |
| 26 |
|
| 27 |
namespace fcn { |
| 28 |
class Font; |
| 29 |
class Image; |
| 30 |
class ActionListener; |
| 31 |
class MouseListener; |
| 32 |
class KeyListener; |
| 33 |
|
| 34 |
inline const char* getVersion(); |
| 35 |
inline int getMajor(); |
| 36 |
inline int getMinor(); |
| 37 |
inline int getPatch(); |
| 38 |
inline const char* getHash(); |
| 39 |
|
| 40 |
%nodefaultctor; |
| 41 |
class Graphics { |
| 42 |
public: |
| 43 |
enum Alignment { |
| 44 |
Left = 0, |
| 45 |
Center, |
| 46 |
Right |
| 47 |
}; |
| 48 |
}; |
| 49 |
%clearnodefaultctor; |
| 50 |
|
| 51 |
class Color { |
| 52 |
public: |
| 53 |
Color(); |
| 54 |
Color(int32_t color); |
| 55 |
Color(int32_t r, int32_t g, int32_t b, int32_t a = 255); |
| 56 |
Color operator+(const Color& color) const; |
| 57 |
Color operator-(const Color& color) const; |
| 58 |
Color operator*(float value) const; |
| 59 |
bool operator==(const Color& color) const; |
| 60 |
bool operator!=(const Color& color) const; |
| 61 |
int32_t r; |
| 62 |
int32_t g; |
| 63 |
int32_t b; |
| 64 |
int32_t a; |
| 65 |
}; |
| 66 |
|
| 67 |
class Size { |
| 68 |
public: |
| 69 |
Size(int32_t width = 0, int32_t height = 0); |
| 70 |
~Size(); |
| 71 |
int32_t getWidth() const; |
| 72 |
int32_t getHeight() const; |
| 73 |
void setWidth(int32_t width); |
| 74 |
void setHeight(int32_t height); |
| 75 |
}; |
| 76 |
|
| 77 |
class Point { |
| 78 |
public: |
| 79 |
int32_t x; |
| 80 |
int32_t y; |
| 81 |
explicit Point(int32_t _x = 0, int32_t _y = 0); |
| 82 |
Point(const Point& rhs); |
| 83 |
Point operator+(const Point& p) const; |
| 84 |
Point operator-(const Point& p) const; |
| 85 |
Point& operator+=(const Point& p); |
| 86 |
Point& operator-=(const Point& p); |
| 87 |
Point operator*(const int32_t& i) const; |
| 88 |
Point operator/(const int32_t& i) const; |
| 89 |
bool operator==(const Point& p) const; |
| 90 |
bool operator!=(const Point& p) const; |
| 91 |
int32_t length() const; |
| 92 |
void normalize(); |
| 93 |
void rotate(int32_t angle); |
| 94 |
void rotate(const Point& origin, int32_t angle); |
| 95 |
void set(int32_t _x, int32_t _y); |
| 96 |
}; |
| 97 |
|
| 98 |
typedef std::vector<Point> PointVector; |
| 99 |
|
| 100 |
class Widget { |
| 101 |
public: |
| 102 |
enum SelectionMode { |
| 103 |
Selection_None = 0, |
| 104 |
Selection_Border = 1, |
| 105 |
Selection_Background = 2 |
| 106 |
}; |
| 107 |
/* Widget(); */ |
| 108 |
/* virtual ~Widget(); */ |
| 109 |
virtual Widget* getParent() const; |
| 110 |
virtual void setWidth(int32_t width); |
| 111 |
virtual int32_t getWidth() const; |
| 112 |
virtual void setHeight(int32_t height); |
| 113 |
virtual int32_t getHeight() const; |
| 114 |
virtual void setSize(int32_t width, int32_t height); |
| 115 |
virtual void setX(int32_t x); |
| 116 |
virtual int32_t getX() const; |
| 117 |
virtual void setY(int32_t y); |
| 118 |
virtual int32_t getY() const; |
| 119 |
virtual void setPosition(int32_t x, int32_t y); |
| 120 |
void setOutlineSize(uint32_t size); |
| 121 |
uint32_t getOutlineSize() const; |
| 122 |
void setBorderSize(uint32_t size); |
| 123 |
uint32_t getBorderSize() const; |
| 124 |
void setMargin(int32_t margin); |
| 125 |
void setMarginTop(int32_t margin); |
| 126 |
int32_t getMarginTop() const; |
| 127 |
void setMarginRight(int32_t margin); |
| 128 |
int32_t getMarginRight() const; |
| 129 |
void setMarginBottom(int32_t margin); |
| 130 |
int32_t getMarginBottom() const; |
| 131 |
void setMarginLeft(int32_t margin); |
| 132 |
int32_t getMarginLeft() const; |
| 133 |
void setPadding(uint32_t padding); |
| 134 |
void setPaddingTop(uint32_t padding); |
| 135 |
uint32_t getPaddingTop() const; |
| 136 |
void setPaddingRight(uint32_t padding); |
| 137 |
uint32_t getPaddingRight() const; |
| 138 |
void setPaddingBottom(uint32_t padding); |
| 139 |
uint32_t getPaddingBottom() const; |
| 140 |
void setPaddingLeft(uint32_t padding); |
| 141 |
uint32_t getPaddingLeft() const; |
| 142 |
virtual void setFocusable(bool focusable); |
| 143 |
virtual bool isFocusable() const; |
| 144 |
virtual bool isFocused() const; |
| 145 |
virtual void setEnabled(bool enabled); |
| 146 |
virtual bool isEnabled() const; |
| 147 |
virtual void setVisible(bool visible); |
| 148 |
virtual bool isVisible() const; |
| 149 |
virtual bool isSetVisible() const; |
| 150 |
virtual void setBaseColor(const Color& color); |
| 151 |
virtual const Color& getBaseColor() const; |
| 152 |
virtual void setForegroundColor(const Color& color); |
| 153 |
virtual const Color& getForegroundColor() const; |
| 154 |
virtual void setBackgroundColor(const Color& color); |
| 155 |
virtual const Color& getBackgroundColor() const; |
| 156 |
virtual void setSelectionColor(const Color& color); |
| 157 |
virtual const Color& getSelectionColor() const; |
| 158 |
virtual void setOutlineColor(const Color& color); |
| 159 |
virtual const Color& getOutlineColor() const; |
| 160 |
virtual void setBorderColor(const Color& color); |
| 161 |
virtual const Color& getBorderColor() const; |
| 162 |
void setSelectionMode(SelectionMode mode); |
| 163 |
SelectionMode getSelectionMode() const; |
| 164 |
void setMinSize(const Size& size); |
| 165 |
const Size& getMinSize() const; |
| 166 |
void setMaxSize(const Size& size); |
| 167 |
const Size& getMaxSize() const; |
| 168 |
void setFixedSize(const Size& size); |
| 169 |
const Size& getFixedSize() const; |
| 170 |
bool isFixedSize() const; |
| 171 |
void setVerticalExpand(bool expand); |
| 172 |
bool isVerticalExpand() const; |
| 173 |
void setHorizontalExpand(bool expand); |
| 174 |
bool isHorizontalExpand() const; |
| 175 |
virtual bool isLayouted(); |
| 176 |
virtual void adaptLayout(bool top=true); |
| 177 |
virtual void resizeToContent(bool recursiv=true); |
| 178 |
virtual void adjustSize(); |
| 179 |
virtual void expandContent(bool recursiv=true); |
| 180 |
virtual void requestFocus(); |
| 181 |
virtual void requestMoveToTop(); |
| 182 |
virtual void requestMoveToBottom(); |
| 183 |
virtual void setActionEventId(const std::string& actionEventId); |
| 184 |
virtual const std::string& getActionEventId() const; |
| 185 |
virtual void getAbsolutePosition(int32_t& OUTPUT, int32_t& OUTPUT) const; |
| 186 |
Font *getFont() const; |
| 187 |
static void setGlobalFont(Font* font); |
| 188 |
virtual void setFont(Font* font); |
| 189 |
virtual bool isTabInEnabled() const; |
| 190 |
virtual void setTabInEnabled(bool enabled); |
| 191 |
virtual bool isTabOutEnabled() const; |
| 192 |
virtual void setTabOutEnabled(bool enabled); |
| 193 |
virtual bool isModalFocusable() const; |
| 194 |
virtual bool isModalMouseInputFocusable() const; |
| 195 |
virtual void requestModalFocus(); |
| 196 |
virtual void requestModalMouseInputFocus(); |
| 197 |
virtual void releaseModalFocus(); |
| 198 |
virtual void releaseModalMouseInputFocus(); |
| 199 |
virtual bool isModalFocused() const; |
| 200 |
virtual bool isModalMouseInputFocused() const; |
| 201 |
virtual Widget *getWidgetAt(int32_t x, int32_t y); |
| 202 |
virtual void moveToTop(Widget* widget) { }; |
| 203 |
virtual void moveToBottom(Widget* widget) { }; |
| 204 |
virtual void focusNext() { }; |
| 205 |
virtual void focusPrevious() { }; |
| 206 |
virtual void addActionListener(ActionListener* actionListener); |
| 207 |
virtual void removeActionListener(ActionListener* actionListener); |
| 208 |
virtual void addMouseListener(MouseListener* actionListener); |
| 209 |
virtual void removeMouseListener(MouseListener* actionListener); |
| 210 |
virtual void addKeyListener(KeyListener* actionListener); |
| 211 |
virtual void removeKeyListener(KeyListener* actionListener); |
| 212 |
virtual void addWidgetListener(WidgetListener* widgetListener); |
| 213 |
virtual void removeWidgetListener(WidgetListener* widgetListener); |
| 214 |
/* protected: */ |
| 215 |
virtual void draw(Graphics* graphics) = 0; |
| 216 |
}; |
| 217 |
|
| 218 |
%feature("notabstract") Spacer; |
| 219 |
class Spacer: public Widget { |
| 220 |
public: |
| 221 |
Spacer(); |
| 222 |
virtual ~Spacer(); |
| 223 |
virtual void resizeToContent(bool recursiv=true); |
| 224 |
}; |
| 225 |
|
| 226 |
%feature("notabstract") Container; |
| 227 |
class Container: public Widget { |
| 228 |
public: |
| 229 |
Container(); |
| 230 |
virtual ~Container(); |
| 231 |
virtual void setOpaque(bool opaque); |
| 232 |
virtual bool isOpaque() const; |
| 233 |
virtual void add(Widget* widget); |
| 234 |
virtual void add(Widget* widget, int32_t x, int32_t y); |
| 235 |
virtual void remove(Widget* widget); |
| 236 |
virtual void clear(); |
| 237 |
enum LayoutPolicy { |
| 238 |
Absolute, |
| 239 |
AutoSize, |
| 240 |
Vertical, |
| 241 |
Horizontal, |
| 242 |
Circular |
| 243 |
}; |
| 244 |
void setLayout(LayoutPolicy policy); |
| 245 |
LayoutPolicy getLayout() const; |
| 246 |
virtual void setUniformSize(bool uniform); |
| 247 |
virtual bool isUniformSize() const; |
| 248 |
virtual void setVerticalSpacing(uint32_t spacing); |
| 249 |
virtual uint32_t getVerticalSpacing() const; |
| 250 |
virtual void setHorizontalSpacing(uint32_t spacing); |
| 251 |
virtual uint32_t getHorizontalSpacing() const; |
| 252 |
void setBackgroundWidget(Widget* widget); |
| 253 |
Widget* getBackgroundWidget(); |
| 254 |
}; |
| 255 |
|
| 256 |
%feature("notabstract") Button; |
| 257 |
class Button: public Widget { |
| 258 |
public: |
| 259 |
Button(); |
| 260 |
Button(const std::string& caption); |
| 261 |
virtual void setCaption(const std::string& caption); |
| 262 |
virtual const std::string& getCaption() const; |
| 263 |
void setActive(bool state); |
| 264 |
bool isActive() const; |
| 265 |
virtual void setAlignment(Graphics::Alignment alignment); |
| 266 |
virtual Graphics::Alignment getAlignment() const; |
| 267 |
void setDownXOffset(int32_t offset); |
| 268 |
int32_t getDownXOffset() const; |
| 269 |
void setDownYOffset(int32_t offset); |
| 270 |
int32_t getDownYOffset() const; |
| 271 |
void setDownOffset(int32_t x, int32_t y); |
| 272 |
virtual void adjustSize(); |
| 273 |
/*virtual bool isPressed() const;*/ |
| 274 |
}; |
| 275 |
|
| 276 |
%feature("notabstract") ImageButton; |
| 277 |
class ImageButton: public Button { |
| 278 |
public: |
| 279 |
ImageButton(); |
| 280 |
ImageButton(const Image* image); |
| 281 |
virtual ~ImageButton(); |
| 282 |
void setUpImage(const Image* image); |
| 283 |
const Image* getUpImage() const; |
| 284 |
void setDownImage(const Image* image); |
| 285 |
const Image* getDownImage() const; |
| 286 |
void setHoverImage(const Image* image); |
| 287 |
const Image* getHoverImage() const; |
| 288 |
void setInactiveUpImage(const Image* image); |
| 289 |
const Image* getInactiveUpImage() const; |
| 290 |
void setInactiveDownImage(const Image* image); |
| 291 |
const Image* getInactiveDownImage() const; |
| 292 |
void setInactiveHoverImage(const Image* image); |
| 293 |
const Image* getInactiveHoverImage() const; |
| 294 |
virtual void resizeToContent(bool recursiv=true); |
| 295 |
virtual void adjustSize(); |
| 296 |
}; |
| 297 |
|
| 298 |
%feature("notabstract") ToggleButton; |
| 299 |
class ToggleButton: public ImageButton { |
| 300 |
public: |
| 301 |
ToggleButton(); |
| 302 |
ToggleButton(const std::string &caption, const std::string &group, bool selected = false); |
| 303 |
~ToggleButton(); |
| 304 |
virtual bool isSelected() const; |
| 305 |
virtual void setSelected(bool selected); |
| 306 |
virtual void toggleSelected(); |
| 307 |
void setGroup(const std::string& group); |
| 308 |
const std::string &getGroup() const; |
| 309 |
}; |
| 310 |
|
| 311 |
%feature("notabstract") CheckBox; |
| 312 |
class CheckBox: public ImageButton { |
| 313 |
public: |
| 314 |
enum MarkerStyle { |
| 315 |
Marker_Checkmark = 0, |
| 316 |
Marker_Cross, |
| 317 |
Marker_Dot, |
| 318 |
Marker_Rhombus, |
| 319 |
Marker_Image |
| 320 |
}; |
| 321 |
CheckBox(); |
| 322 |
virtual ~CheckBox(); |
| 323 |
virtual bool isSelected() const; |
| 324 |
virtual void setSelected(bool marked); |
| 325 |
virtual void toggleSelected(); |
| 326 |
void setBackgroundImage(const std::string& filename); |
| 327 |
void setBackgroundImage(const Image* image); |
| 328 |
const Image* getBackgroundImage() const; |
| 329 |
MarkerStyle getMarkerStyle() const; |
| 330 |
void setMarkerStyle(MarkerStyle mode); |
| 331 |
virtual void adjustSize(); |
| 332 |
}; |
| 333 |
|
| 334 |
%feature("notabstract") Icon; |
| 335 |
class Icon: public Widget { |
| 336 |
public: |
| 337 |
Icon(Image* image); |
| 338 |
virtual ~Icon(); |
| 339 |
void setImage(Image* image); |
| 340 |
const Image* getImage() const; |
| 341 |
bool isScaling() const; |
| 342 |
void setScaling(bool scale); |
| 343 |
bool isTiling() const; |
| 344 |
void setTiling(bool tile); |
| 345 |
void setOpaque(bool opaque); |
| 346 |
bool isOpaque() const; |
| 347 |
virtual void adjustSize(); |
| 348 |
}; |
| 349 |
|
| 350 |
%feature("notabstract") ScrollArea; |
| 351 |
class ScrollArea: public Widget { |
| 352 |
public: |
| 353 |
ScrollArea(); |
| 354 |
ScrollArea(Widget *content); |
| 355 |
ScrollArea(Widget *content,ScrollArea::ScrollPolicy hPolicy,ScrollArea::ScrollPolicy vPolicy); |
| 356 |
virtual ~ScrollArea(); |
| 357 |
virtual void setContent(Widget* widget); |
| 358 |
virtual Widget* getContent(); |
| 359 |
virtual void setHorizontalScrollPolicy(ScrollArea::ScrollPolicy hPolicy); |
| 360 |
virtual ScrollArea::ScrollPolicy getHorizontalScrollPolicy(); |
| 361 |
virtual void setVerticalScrollPolicy(ScrollArea::ScrollPolicy vPolicy); |
| 362 |
virtual ScrollArea::ScrollPolicy getVerticalScrollPolicy(); |
| 363 |
virtual void setScrollPolicy(ScrollArea::ScrollPolicy hPolicy, ScrollArea::ScrollPolicy vPolicy); |
| 364 |
virtual void setVerticalScrollAmount(int32_t vScroll); |
| 365 |
virtual int32_t getVerticalScrollAmount(); |
| 366 |
virtual void setHorizontalScrollAmount(int32_t hScroll); |
| 367 |
virtual int32_t getHorizontalScrollAmount(); |
| 368 |
virtual void setScrollAmount(int32_t hScroll, int32_t vScroll); |
| 369 |
virtual int32_t getHorizontalMaxScroll(); |
| 370 |
virtual int32_t getVerticalMaxScroll(); |
| 371 |
virtual void setScrollbarWidth(int32_t width); |
| 372 |
virtual int32_t getScrollbarWidth(); |
| 373 |
virtual void setLeftButtonScrollAmount(int32_t amount); |
| 374 |
virtual void setRightButtonScrollAmount(int32_t amount); |
| 375 |
virtual void setUpButtonScrollAmount(int32_t amount); |
| 376 |
virtual void setDownButtonScrollAmount(int32_t amount); |
| 377 |
virtual int32_t getLeftButtonScrollAmount(); |
| 378 |
virtual int32_t getRightButtonScrollAmount(); |
| 379 |
virtual int32_t getUpButtonScrollAmount(); |
| 380 |
virtual int32_t getDownButtonScrollAmount(); |
| 381 |
enum ScrollPolicy |
| 382 |
{ |
| 383 |
ShowAlways, |
| 384 |
ShowNever, |
| 385 |
ShowAuto |
| 386 |
}; |
| 387 |
}; |
| 388 |
|
| 389 |
|
| 390 |
%feature("director") ListModel; |
| 391 |
class ListModel |
| 392 |
{ |
| 393 |
public: |
| 394 |
virtual ~ListModel() { } |
| 395 |
virtual int32_t getNumberOfElements() = 0; |
| 396 |
virtual std::string getElementAt(int32_t i) = 0; |
| 397 |
}; |
| 398 |
|
| 399 |
%feature("notabstract") ListBox; |
| 400 |
class ListBox: public Widget { |
| 401 |
public: |
| 402 |
ListBox(); |
| 403 |
ListBox(ListModel *listModel); |
| 404 |
virtual ~ListBox() { } |
| 405 |
virtual int32_t getSelected(); |
| 406 |
virtual void setSelected(int32_t selected); |
| 407 |
virtual void setListModel(ListModel *listModel); |
| 408 |
virtual ListModel *getListModel(); |
| 409 |
virtual void adjustSize(); |
| 410 |
virtual bool isWrappingEnabled(); |
| 411 |
virtual void setWrappingEnabled(bool wrapping); |
| 412 |
}; |
| 413 |
|
| 414 |
%feature("notabstract") DropDown; |
| 415 |
class DropDown: public Widget { |
| 416 |
public: |
| 417 |
DropDown(ListModel *listModel = NULL, |
| 418 |
ScrollArea *scrollArea = NULL, |
| 419 |
ListBox *listBox = NULL); |
| 420 |
virtual ~DropDown(); |
| 421 |
virtual int32_t getSelected(); |
| 422 |
virtual void setSelected(int32_t selected); |
| 423 |
virtual void setListModel(ListModel *listModel); |
| 424 |
virtual ListModel *getListModel(); |
| 425 |
virtual void adjustHeight(); |
| 426 |
virtual void setBaseColor(const Color& color); |
| 427 |
virtual const Color& getBaseColor() const; |
| 428 |
virtual void setForegroundColor(const Color& color); |
| 429 |
virtual const Color& getForegroundColor() const; |
| 430 |
virtual void setBackgroundColor(const Color& color); |
| 431 |
virtual const Color& getBackgroundColor() const; |
| 432 |
virtual void setSelectionColor(const Color& color); |
| 433 |
virtual const Color& getSelectionColor() const; |
| 434 |
}; |
| 435 |
|
| 436 |
%feature("notabstract") RadioButton; |
| 437 |
class RadioButton: public Widget { |
| 438 |
public: |
| 439 |
RadioButton(); |
| 440 |
RadioButton(const std::string &caption, |
| 441 |
const std::string &group, |
| 442 |
bool marked=false); |
| 443 |
virtual ~RadioButton(); |
| 444 |
virtual bool isSelected() const; |
| 445 |
virtual void setSelected(bool marked); |
| 446 |
virtual const std::string &getCaption() const; |
| 447 |
virtual void setCaption(const std::string caption); |
| 448 |
virtual void setGroup(const std::string &group); |
| 449 |
virtual const std::string &getGroup() const; |
| 450 |
virtual void adjustSize(); |
| 451 |
}; |
| 452 |
|
| 453 |
%feature("notabstract") Slider; |
| 454 |
class Slider: public Widget { |
| 455 |
public: |
| 456 |
Slider(double scaleEnd = 1.0); |
| 457 |
Slider(double scaleStart, double scaleEnd); |
| 458 |
virtual ~Slider() { } |
| 459 |
virtual void setScale(double scaleStart, double scaleEnd); |
| 460 |
virtual double getScaleStart() const; |
| 461 |
virtual void setScaleStart(double scaleStart); |
| 462 |
virtual double getScaleEnd() const; |
| 463 |
virtual void setScaleEnd(double scaleEnd); |
| 464 |
virtual double getValue() const; |
| 465 |
virtual void setValue(double value); |
| 466 |
virtual void setMarkerLength(int32_t length); |
| 467 |
virtual int32_t getMarkerLength() const; |
| 468 |
virtual void setOrientation(Slider::Orientation orientation); |
| 469 |
virtual Slider::Orientation getOrientation() const; |
| 470 |
virtual void setStepLength(double length); |
| 471 |
virtual double getStepLength() const; |
| 472 |
enum Orientation |
| 473 |
{ |
| 474 |
Horizontal = 0, |
| 475 |
Vertical |
| 476 |
}; |
| 477 |
}; |
| 478 |
|
| 479 |
%feature("notabstract") Window; |
| 480 |
class Window: public Container { |
| 481 |
public: |
| 482 |
Window(); |
| 483 |
Window(const std::string& caption); |
| 484 |
virtual ~Window(); |
| 485 |
virtual void setCaption(const std::string& caption); |
| 486 |
virtual const std::string& getCaption() const; |
| 487 |
virtual void setAlignment(Graphics::Alignment alignment); |
| 488 |
virtual Graphics::Alignment getAlignment() const; |
| 489 |
virtual void setTitleBarHeight(uint32_t height); |
| 490 |
virtual uint32_t getTitleBarHeight(); |
| 491 |
virtual void setMovable(bool movable); |
| 492 |
virtual bool isMovable() const; |
| 493 |
virtual void setOpaque(bool opaque); |
| 494 |
virtual bool isOpaque(); |
| 495 |
virtual void resizeToContent(); |
| 496 |
}; |
| 497 |
|
| 498 |
%feature("notabstract") AdjustingContainer; |
| 499 |
class AdjustingContainer: public Container { |
| 500 |
public: |
| 501 |
AdjustingContainer(); |
| 502 |
virtual ~AdjustingContainer(); |
| 503 |
|
| 504 |
virtual void setNumberOfColumns(uint32_t numberOfColumns); |
| 505 |
virtual uint32_t getNumberOfColumns() const; |
| 506 |
virtual void setColumnAlignment(uint32_t column, uint32_t alignment); |
| 507 |
virtual uint32_t getColumnAlignment(uint32_t column) const; |
| 508 |
virtual void adjustContent(); |
| 509 |
|
| 510 |
enum { |
| 511 |
LEFT = 0, |
| 512 |
CENTER, |
| 513 |
RIGHT |
| 514 |
}; |
| 515 |
}; |
| 516 |
|
| 517 |
%feature("notabstract") FlowContainer; |
| 518 |
class FlowContainer: public Container { |
| 519 |
public: |
| 520 |
FlowContainer(); |
| 521 |
virtual ~FlowContainer(); |
| 522 |
void setAlignment(FlowContainer::Alignment alignment); |
| 523 |
FlowContainer::Alignment getAlignment() const; |
| 524 |
void adjustContent(); |
| 525 |
|
| 526 |
enum Alignment { |
| 527 |
Left = 0, |
| 528 |
Right, |
| 529 |
Top, |
| 530 |
Bottom, |
| 531 |
Center |
| 532 |
}; |
| 533 |
}; |
| 534 |
|
| 535 |
%feature("notabstract") TextBox; |
| 536 |
class TextBox: public Widget { |
| 537 |
public: |
| 538 |
TextBox(); |
| 539 |
TextBox(const std::string& text); |
| 540 |
virtual void setText(const std::string& text); |
| 541 |
virtual std::string getText() const; |
| 542 |
virtual std::string getTextRow(int32_t row) const; |
| 543 |
virtual void setTextRow(int32_t row, const std::string& text); |
| 544 |
virtual int32_t getNumberOfRows() const; |
| 545 |
virtual int32_t getCaretPosition() const; |
| 546 |
virtual void setCaretPosition(int32_t position); |
| 547 |
virtual int32_t getCaretRow() const; |
| 548 |
virtual void setCaretRow(int32_t row); |
| 549 |
virtual int32_t getCaretColumn() const; |
| 550 |
virtual void setCaretColumn(int32_t column); |
| 551 |
virtual void setCaretRowColumn(int32_t row, int32_t column); |
| 552 |
virtual void scrollToCaret(); |
| 553 |
virtual bool isEditable() const; |
| 554 |
virtual void setEditable(bool editable); |
| 555 |
virtual void addRow(const std::string row); |
| 556 |
virtual bool isOpaque(); |
| 557 |
virtual void setOpaque(bool opaque); |
| 558 |
}; |
| 559 |
|
| 560 |
|
| 561 |
%feature("notabstract") TextField; |
| 562 |
class TextField: public Widget { |
| 563 |
public: |
| 564 |
TextField(); |
| 565 |
TextField(const std::string& text); |
| 566 |
virtual ~TextField(); |
| 567 |
virtual void setText(const std::string& text); |
| 568 |
virtual std::string getText() const; |
| 569 |
virtual void adjustSize(); |
| 570 |
virtual void adjustHeight(); |
| 571 |
virtual void setCaretPosition(uint32_t position); |
| 572 |
virtual uint32_t getCaretPosition() const; |
| 573 |
}; |
| 574 |
|
| 575 |
%feature("notabstract") PasswordField; |
| 576 |
class PasswordField : public TextField { |
| 577 |
public: |
| 578 |
PasswordField(const std::string& text = ""); |
| 579 |
virtual ~PasswordField(); |
| 580 |
}; |
| 581 |
|
| 582 |
%feature("notabstract") IconProgressBar; |
| 583 |
class IconProgressBar : public Widget { |
| 584 |
public: |
| 585 |
IconProgressBar(); |
| 586 |
IconProgressBar(Image *image, int32_t maxIcons); |
| 587 |
virtual ~IconProgressBar(); |
| 588 |
void setImage(Image* image); |
| 589 |
const Image* getImage() const; |
| 590 |
void setMaxIcons(int32_t maxIcons); |
| 591 |
int32_t getMaxIcons() const; |
| 592 |
void setOrientation(IconProgressBar::Orientation orientation); |
| 593 |
IconProgressBar::Orientation getOrientation() const; |
| 594 |
void advance(); |
| 595 |
void reset(); |
| 596 |
void setIconCount(int icons); |
| 597 |
int getIconCount() const; |
| 598 |
void setOpaque(bool opaque); |
| 599 |
bool isOpaque() const; |
| 600 |
|
| 601 |
enum Orientation |
| 602 |
{ |
| 603 |
HORIZONTAL = 0, |
| 604 |
VERTICAL |
| 605 |
}; |
| 606 |
}; |
| 607 |
|
| 608 |
%feature("notabstract") ImageProgressBar; |
| 609 |
class ImageProgressBar : public Widget { |
| 610 |
public: |
| 611 |
ImageProgressBar(); |
| 612 |
ImageProgressBar(Image *image, int32_t maxValue); |
| 613 |
virtual ~ImageProgressBar(); |
| 614 |
void setBarImage(Image* image); |
| 615 |
const Image* getBarImage() const; |
| 616 |
void setForegroundImage(Image* image); |
| 617 |
const Image* getForegroundImage() const; |
| 618 |
void setMaxValue(int32_t maxValue); |
| 619 |
int32_t getMaxValue() const; |
| 620 |
void setValue(int32_t value); |
| 621 |
int32_t getValue() const; |
| 622 |
void setOrientation(ImageProgressBar::Orientation orientation); |
| 623 |
ImageProgressBar::Orientation getOrientation() const; |
| 624 |
void setOpaque(bool opaque); |
| 625 |
bool isOpaque() const; |
| 626 |
|
| 627 |
enum Orientation { |
| 628 |
HORIZONTAL = 0, |
| 629 |
VERTICAL |
| 630 |
}; |
| 631 |
}; |
| 632 |
|
| 633 |
%feature("notabstract") Tab; |
| 634 |
class Tab: public Container { |
| 635 |
public: |
| 636 |
Tab(); |
| 637 |
virtual ~Tab(); |
| 638 |
void setTabbedArea(fcn::TabbedArea* tabbedArea); |
| 639 |
fcn::TabbedArea* getTabbedArea(); |
| 640 |
}; |
| 641 |
|
| 642 |
%feature("notabstract") TabbedArea; |
| 643 |
class TabbedArea: public Widget { |
| 644 |
public: |
| 645 |
TabbedArea(); |
| 646 |
virtual ~TabbedArea(); |
| 647 |
void setOpaque(bool opaque); |
| 648 |
bool isOpaque() const; |
| 649 |
virtual void addTab(fcn::Tab* tab, Widget* widget); |
| 650 |
virtual void removeTabWithIndex(uint32_t index); |
| 651 |
virtual void removeTab(fcn::Tab* tab); |
| 652 |
uint32_t getNumberOfTabs() const; |
| 653 |
virtual bool isTabSelected(uint32_t index) const; |
| 654 |
virtual bool isTabSelected(fcn::Tab* tab) const; |
| 655 |
virtual void setSelectedTab(uint32_t index); |
| 656 |
virtual void setSelectedTab(fcn::Tab* tab); |
| 657 |
virtual uint32_t getSelectedTabIndex() const; |
| 658 |
fcn::Tab* getSelectedTab() const; |
| 659 |
void setBaseColor(const Color& color); |
| 660 |
void setBackgroundWidget(Widget* widget); |
| 661 |
Widget* getBackgroundWidget(); |
| 662 |
void setLayout(Container::LayoutPolicy policy); |
| 663 |
Container::LayoutPolicy getLayout() const; |
| 664 |
virtual void setUniformSize(bool uniform); |
| 665 |
virtual bool isUniformSize() const; |
| 666 |
virtual void setVerticalSpacing(uint32_t spacing); |
| 667 |
virtual uint32_t getVerticalSpacing() const; |
| 668 |
virtual void setHorizontalSpacing(uint32_t spacing); |
| 669 |
virtual uint32_t getHorizontalSpacing() const; |
| 670 |
}; |
| 671 |
|
| 672 |
%feature("notabstract") BarGraph; |
| 673 |
class BarGraph: public Widget { |
| 674 |
public: |
| 675 |
BarGraph(); |
| 676 |
BarGraph(int32_t x, int32_t y, int32_t w, int32_t h); |
| 677 |
virtual ~BarGraph(); |
| 678 |
void setBarX(int32_t x); |
| 679 |
int32_t getBarX() const; |
| 680 |
void setBarY(int32_t y); |
| 681 |
int32_t getBarY() const; |
| 682 |
void setBarPosition(int32_t x, int32_t y); |
| 683 |
void setBarPosition(const Point& pos); |
| 684 |
void setBarWidth(int32_t w); |
| 685 |
int32_t getBarWidth() const; |
| 686 |
void setBarHeight(int32_t h); |
| 687 |
int32_t getBarHeight() const; |
| 688 |
void setBarSize(int32_t w, int32_t h); |
| 689 |
void setOpaque(bool opaque); |
| 690 |
bool isOpaque() const; |
| 691 |
}; |
| 692 |
|
| 693 |
%feature("notabstract") CurveGraph; |
| 694 |
class CurveGraph: public Widget { |
| 695 |
public: |
| 696 |
CurveGraph(); |
| 697 |
CurveGraph(const PointVector& data); |
| 698 |
virtual ~CurveGraph(); |
| 699 |
void setPointVector(const PointVector& data); |
| 700 |
const PointVector& getPointVector() const; |
| 701 |
void resetPointVector(); |
| 702 |
void setThickness(uint32_t thickness); |
| 703 |
uint32_t getThickness() const; |
| 704 |
void setAutomaticControllPoints(bool acp); |
| 705 |
bool isAutomaticControllPoints() const; |
| 706 |
void setOpaque(bool opaque); |
| 707 |
bool isOpaque() const; |
| 708 |
}; |
| 709 |
|
| 710 |
%feature("notabstract") LineGraph; |
| 711 |
class LineGraph: public Widget { |
| 712 |
public: |
| 713 |
LineGraph(); |
| 714 |
LineGraph(const PointVector& data); |
| 715 |
virtual ~LineGraph(); |
| 716 |
void setPointVector(const PointVector& data); |
| 717 |
const PointVector& getPointVector() const; |
| 718 |
void resetPointVector(); |
| 719 |
void setThickness(uint32_t thickness); |
| 720 |
uint32_t getThickness() const; |
| 721 |
void setOpaque(bool opaque); |
| 722 |
bool isOpaque() const; |
| 723 |
}; |
| 724 |
|
| 725 |
%feature("notabstract") PieGraph; |
| 726 |
class PieGraph: public Widget { |
| 727 |
public: |
| 728 |
PieGraph(); |
| 729 |
PieGraph(const Point& center); |
| 730 |
virtual ~PieGraph(); |
| 731 |
void setCenterX(int32_t x); |
| 732 |
void setCenterY(int32_t y); |
| 733 |
void setCenter(int32_t x, int32_t y); |
| 734 |
int32_t getCenterX() const; |
| 735 |
int32_t getCenterY() const; |
| 736 |
void setCenter(const Point& center); |
| 737 |
const Point& getCenter() const; |
| 738 |
void setRadius(int32_t radius); |
| 739 |
int32_t getRadius() const; |
| 740 |
void addSegment(int32_t startAngle, int32_t stopAngle, const Color& color); |
| 741 |
void clearSegments(); |
| 742 |
void setOpaque(bool opaque); |
| 743 |
bool isOpaque() const; |
| 744 |
}; |
| 745 |
|
| 746 |
%feature("notabstract") PointGraph; |
| 747 |
class PointGraph: public Widget { |
| 748 |
public: |
| 749 |
PointGraph(); |
| 750 |
PointGraph(const PointVector& data); |
| 751 |
virtual ~PointGraph(); |
| 752 |
void setPointVector(const PointVector& data); |
| 753 |
const PointVector& getPointVector() const; |
| 754 |
void resetPointVector(); |
| 755 |
void setThickness(uint32_t thickness); |
| 756 |
uint32_t getThickness() const; |
| 757 |
void setOpaque(bool opaque); |
| 758 |
bool isOpaque() const; |
| 759 |
}; |
| 760 |
} |
| 761 |
namespace std { |
| 762 |
%template(FcnPointVector) vector<fcn::Point>; |
| 763 |
} |