Crossfire Server, Trunk
AnimationWrapper.h
Go to the documentation of this file.
1 #ifndef ANIMATION_WRAPPER_H
2 #define ANIMATION_WRAPPER_H
3 
4 #include <QObject>
5 
6 extern "C"
7 {
8 #include "global.h"
9 }
10 #include "../assets/AssetWrapper.h"
11 #include "../CREPixmap.h"
12 
13 class ResourcesManager;
14 
15 class AnimationWrapper : public AssetTWrapper<Animations> {
16  Q_OBJECT
17 
18  Q_PROPERTY(QString name READ name)
19 
20 public:
21  AnimationWrapper(AssetWrapper *parent, Animations* anim, ResourcesManager *resourcesManager);
22 
23  virtual QString displayName() const override { return myWrappedItem->name; }
24  virtual QIcon displayIcon() const { return CREPixmap::getIcon(myWrappedItem->faces[0]); }
25  virtual void displayFillPanel(QWidget *panel) override;
26 
27  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
28 
29  QString name() const { return myWrappedItem->name; }
30 
31 protected:
33 };
34 
35 #endif // ANIMATION_WRAPPER_H
AssetTWrapper< Animations >::myWrappedItem
Animations * myWrappedItem
Definition: AssetWrapper.h:87
global.h
ResourcesManager
Definition: ResourcesManager.h:67
AnimationWrapper
Definition: AnimationWrapper.h:15
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:14
AnimationWrapper::displayName
virtual QString displayName() const override
Definition: AnimationWrapper.h:23
CREPixmap::getIcon
static QIcon getIcon(uint16_t faceNumber)
Definition: CREPixmap.cpp:55
AnimationWrapper::AnimationWrapper
AnimationWrapper(AssetWrapper *parent, Animations *anim, ResourcesManager *resourcesManager)
Definition: AnimationWrapper.cpp:6
AnimationWrapper::displayFillPanel
virtual void displayFillPanel(QWidget *panel) override
Definition: AnimationWrapper.cpp:23
AnimationWrapper::name
QString name() const
Definition: AnimationWrapper.h:29
AssetWrapper
Definition: AssetWrapper.h:11
AnimationWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: AnimationWrapper.cpp:10
AnimationWrapper::myResourcesManager
ResourcesManager * myResourcesManager
Definition: AnimationWrapper.h:32
animate.anim
string anim
Definition: animate.py:20
animations_struct::name
sstring name
Definition: face.h:26
animations_struct
Definition: face.h:25
AnimationWrapper::displayIcon
virtual QIcon displayIcon() const
Definition: AnimationWrapper.h:24
animations_struct::faces
const Face ** faces
Definition: face.h:30
AnimationWrapper::name
QString name
Definition: AnimationWrapper.h:18
AssetTWrapper
Definition: AssetWrapper.h:72