[DEV] Remove API of the the annimation (bad designed)

This commit is contained in:
Edouard DUPIN 2017-04-18 22:35:46 +02:00
parent d552f2baa2
commit 0b0cbfc30d
5 changed files with 4 additions and 170 deletions

View File

@ -807,7 +807,8 @@ void ewol::compositing::TextBase::setTextAlignement(float _startTextpos, float _
m_stopTextPos = _stopTextPos+1;
m_alignement = _alignement;
if (m_startTextpos >= m_stopTextPos) {
EWOL_ERROR("Request allignement with Borne position error : " << _startTextpos << " => " << _stopTextPos);
// TODO: understand why this flush ...
EWOL_VERBOSE("Request allignement with Borne position error : " << _startTextpos << " => " << _stopTextPos);
}
}

View File

@ -26,8 +26,7 @@ ewol::widget::PopUp::PopUp() :
false,
"Remove the widget if the use click outside") {
addObjectType("ewol::widget::PopUp");
// Add annimations :
addAnnimationType(ewol::Widget::annimationModeEnableAdd, annimationIncrease);
}
void ewol::widget::PopUp::init() {
@ -176,37 +175,3 @@ bool ewol::widget::PopUp::onEventInput(const ewol::event::Input& _event) {
return false;
}
bool ewol::widget::PopUp::onStartAnnimation(enum ewol::Widget::annimationMode _mode) {
if (_mode == 0) {
/*
if (m_annimationTypeStart.get() != annimationIncrease) {
return false;
}
*/
} else {
/*
if (m_annimationTypeStop.get() != annimationIncrease) {
return false;
}
*/
}
return false;
if (m_shaper.changeStatusIn(1) == true) {
m_PCH = getObjectManager().periodicCall.connect(this, &ewol::widget::PopUp::periodicCall);
return true;
}
return false;
}
void ewol::widget::PopUp::onStopAnnimation() {
m_PCH.disconnect();
}
void ewol::widget::PopUp::periodicCall(const ewol::event::Time& _event) {
if (m_shaper.periodicCall(_event) == false) {
stopAnnimation();
}
markToRedraw();
}

View File

@ -43,21 +43,12 @@ namespace ewol {
ewol::compositing::Shaper m_shaper; //!< Compositing theme.
protected:
void onDraw() override;
esignal::Connection m_PCH; //!< Periodic call handle to remove it when needed
/**
* @brief Periodic call to update grapgic display
* @param[in] _event Time generic event
*/
void periodicCall(const ewol::event::Time& _event);
public:
void systemDraw(const ewol::DrawProperty& _displayProp) override;
void onRegenerateDisplay() override;
void onChangeSize() override;
bool onEventInput(const ewol::event::Input& _event) override;
ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override;
protected:
bool onStartAnnimation(enum ewol::Widget::annimationMode _mode) override;
void onStopAnnimation() override;
protected:
virtual void onChangePropertyShape();
virtual void onChangePropertyLockExpand();

View File

@ -54,16 +54,7 @@ ewol::Widget::Widget() :
signalShortcut(this, "shortcut", ""),
m_needRegenerateDisplay(true),
m_grabCursor(false),
m_cursorDisplay(gale::context::cursor::arrow),
signalAnnimationStart(this, "annimation-start", ""),
signalAnnimationRatio(this, "annimation-ratio", ""),
signalAnnimationStop(this, "annimation-stop", ""),
m_annimationMode(annimationModeDisable),
m_annimationratio(0.0f),
propertyAnnimationTypeStart(this, "annimation-start-type", 0, "Annimation type, when adding/show a widget"),
propertyAnnimationTimeStart(this, "annimation-start-time", 0.1f, 0.0f, 200.0f, "Annimation time in second, when adding/show a widget"),
propertyAnnimationTypeStop(this, "annimation-stop-type", 0, "Annimation type, when removing/hide a widget"),
propertyAnnimationTimeStop(this, "annimation-stop-time", 0.1f, 0.0f, 200.0f, "Annimation time in second, when removing/hide a widget"){
m_cursorDisplay(gale::context::cursor::arrow){
addObjectType("ewol::Widget");
// TODO : Set a static interface for list ==> this methode create a multiple allocation
@ -76,8 +67,6 @@ ewol::Widget::Widget() :
propertyGravity.add(ewol::gravity_buttom, "buttom");
propertyGravity.add(ewol::gravity_buttomLeft, "buttom-left");
propertyGravity.add(ewol::gravity_left, "left");
propertyAnnimationTypeStart.add(0, "none");
propertyAnnimationTypeStop.add(0, "none");
}
@ -615,53 +604,6 @@ void ewol::Widget::hideKeyboard() {
getContext().keyboardHide();
}
void ewol::Widget::addAnnimationType(enum ewol::Widget::annimationMode _mode, const char* _type) {
if (_mode == ewol::Widget::annimationModeDisable) {
EWOL_CRITICAL("Not suported mode ==> only for internal properties");
return;
}
/*
for (size_t iii = 0; iii < m_annimationList[_mode].size(); ++iii) {
if (m_annimationList[_mode][iii] == _type) {
return;
}
}
m_annimationList[_mode].push_back(_type);
*/
}
void ewol::Widget::setAnnimationType(enum ewol::Widget::annimationMode _mode, const std::string& _type) {
if (_mode == 0) {
propertyAnnimationTypeStart.setString(_type);
} else {
propertyAnnimationTypeStop.setString(_type);
}
}
void ewol::Widget::setAnnimationTime(enum ewol::Widget::annimationMode _mode, float _time) {
if (_mode == 0) {
propertyAnnimationTimeStart.set(_time);
} else {
propertyAnnimationTimeStop.set(_time);
}
}
bool ewol::Widget::startAnnimation(enum ewol::Widget::annimationMode _mode) {
if (_mode == ewol::Widget::annimationModeDisable) {
EWOL_CRITICAL("Not suported mode ==> only for internal properties");
return false;
}
m_annimationMode = _mode;
return onStartAnnimation(_mode);
}
bool ewol::Widget::stopAnnimation() {
m_annimationMode = ewol::Widget::annimationModeDisable;
onStopAnnimation();
return true; // ???
}
void ewol::Widget::drawWidgetTree(int32_t _level) {
std::string space;
for (int32_t iii=0; iii<_level; ++iii) {

View File

@ -509,71 +509,6 @@ namespace ewol {
* @brief get the curent Windows
*/
ememory::SharedPtr<ewol::widget::Windows> getWindows();
/*
* Annimation section :
*/
public:
// event generated :
esignal::Signal<> signalAnnimationStart; //!< event when start annimation
esignal::Signal<float> signalAnnimationRatio; //!< event when % of annimation change (integer)
esignal::Signal<> signalAnnimationStop; //!< event when stop annimation
protected:
enum annimationMode {
annimationModeEnableAdd,
annimationModeEnableRemove,
annimationModeDisable
};
enum annimationMode m_annimationMode; //!< true when the annimation is started
float m_annimationratio; //!< Ratio of the annimation [0..1]
protected:
eproperty::List<int32_t> propertyAnnimationTypeStart; //!< type of start annimation
eproperty::Range<float> propertyAnnimationTimeStart; //!< time to produce start annimation
eproperty::List<int32_t> propertyAnnimationTypeStop; //!< type of start annimation
eproperty::Range<float> propertyAnnimationTimeStop; //!< time to produce start annimation
protected:
/**
* @brief Add a annimation type capabilities of this widget.
* @param[in] _mode Configuring mode.
* @param[in] _type Type of the annimation.
*/
void addAnnimationType(enum ewol::Widget::annimationMode _mode, const char* _type);
public:
/**
* @brief set a annimation type.
* @param[in] _mode Configuring mode.
* @param[in] _type type of the annimation
*/
void setAnnimationType(enum ewol::Widget::annimationMode _mode, const std::string& _type);
/**
* @brief set a annimation time to produce.
* @param[in] _mode Configuring mode.
* @param[in] _time Time in second of the annimation display
*/
void setAnnimationTime(enum ewol::Widget::annimationMode _mode, float _time);
/**
* @brief Start the annimation.
* @param[in] _mode Configuring mode.
* @return true if an annimation will be started, false ==> no annimation and no event
*/
bool startAnnimation(enum ewol::Widget::annimationMode _mode);
/**
* @brief Stop/Break the annimation.
* @return true if an annimation will be stoped, false ==> no curent annimation and no event wil be generated
*/
bool stopAnnimation();
protected:
/**
* @brief Event when start the annimation.
* @param[in] _mode Configuring mode.
* @return true need to add periodic call.
*/
virtual bool onStartAnnimation(enum ewol::Widget::annimationMode _mode) {
return false;
};
/**
* @brief Event when Stop the annimation.
*/
virtual void onStopAnnimation() { };
protected:
virtual void onChangePropertyCanFocus();
virtual void onChangePropertyGravity();