+++ /dev/null
-#include "actionslider.h"
-
-Actionslider::Actionslider(Evas_Object *parent, const std::string& left, const bool leftOn, const std::string& center, const bool centerOn, const std::string& right, const bool rightOn)
- : EvasObject::EvasObject(
- elm_actionslider_add(parent)
- )
- , parent(parent)
-{
- elm_object_part_text_set(*this, "left", left.c_str());
- elm_object_part_text_set(*this, "center", center.c_str());
- elm_object_part_text_set(*this, "right", right.c_str());
-
- unsigned int posEnabled = ELM_ACTIONSLIDER_NONE;
- if (leftOn)
- {
- posEnabled |= ELM_ACTIONSLIDER_LEFT;
- }
- if (centerOn)
- {
- posEnabled |= ELM_ACTIONSLIDER_CENTER;
- }
- if (rightOn)
- {
- posEnabled |= ELM_ACTIONSLIDER_RIGHT;
- }
- elm_actionslider_enabled_pos_set(*this, static_cast<Elm_Actionslider_Pos>(posEnabled));
-}
-
-void Actionslider::setPos(Elm_Actionslider_Pos pos)
-{
- elm_actionslider_indicator_pos_set(*this, pos);
-}
-
-Elm_Actionslider_Pos Actionslider::getPos()
-{
- return elm_actionslider_indicator_pos_get(*this);
-}
-
+++ /dev/null
-#ifndef __WAYLAND_EFL_ACTIONSLIDER_H__
-#define __WAYLAND_EFL_ACTIONSLIDER_H__
-
-#include <string>
-#include <Elementary.h>
-
-#include "evasobject.h"
-
-class Actionslider : public EvasObject
-{
-public:
- Actionslider(Evas_Object *, const std::string& = "Left", const bool = true, const std::string& = "Center", const bool = true, const std::string& = "Right", const bool = true);
-
- void setPos(Elm_Actionslider_Pos pos);
-
- Elm_Actionslider_Pos getPos();
-
-private:
- Evas_Object *parent;
-};
-
-#endif
-
#include <Elementary.h>
#include <boost/bind.hpp>
+#include <vector>
+
#include "window.h"
-#include "actionslider.h"
#include "evasobject.h"
#include "elmtestharness.h"
+using std::vector;
+
class ActionsliderPosTest : public ElmTestHarness
{
public:
ActionsliderPosTest()
: ElmTestHarness::ElmTestHarness()
, window_("ActionsliderPosTest", "Actionslider Position Test")
- , control_(window_)
+ , control_(elm_actionslider_add(window_))
{
+ positions_.push_back(ELM_ACTIONSLIDER_LEFT);
+ positions_.push_back(ELM_ACTIONSLIDER_CENTER);
+ positions_.push_back(ELM_ACTIONSLIDER_LEFT);
+ positions_.push_back(ELM_ACTIONSLIDER_RIGHT);
+ positions_.push_back(ELM_ACTIONSLIDER_CENTER);
+
return;
}
void setup()
{
- elm_win_resize_object_add(window_, control_);
- window_.show();
- control_.show();
-
- const Elm_Actionslider_Pos position[] = {
- ELM_ACTIONSLIDER_LEFT,
- ELM_ACTIONSLIDER_CENTER,
- ELM_ACTIONSLIDER_RIGHT
- };
-
- unsigned int p;
- for (p = 0; p < (sizeof(position) / sizeof(Elm_Actionslider_Pos)); p++)
+ SET_CHECK_SHOW(window_);
+ SET_CHECK_SHOW(control_);
+
+ control_.setSize(200, 100);
+ control_.setPosition(50, 10);
+
+ vector<Elm_Actionslider_Pos>::iterator it;
+ for (it = positions_.begin(); it != positions_.end(); it++)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(&Actionslider::setPos, boost::ref(control_), position[p]),
- boost::bind(&ActionsliderPosTest::checkPos, boost::ref(*this), position[p])
+ boost::bind(elm_actionslider_indicator_pos_set, boost::ref(control_), *it),
+ boost::bind(&ActionsliderPosTest::checkPos, boost::ref(*this), *it)
)
);
}
}
- void checkPos(Elm_Actionslider_Pos pos)
+ void checkPos(const Elm_Actionslider_Pos expected)
{
- BOOST_CHECK_EQUAL(control_.getPos(), pos);
+ BOOST_CHECK_EQUAL(elm_actionslider_indicator_pos_get(control_), expected);
}
private:
- Window window_;
- Actionslider control_;
+ Window window_;
+ EvasObject control_;
+ vector<Elm_Actionslider_Pos> positions_;
};
BOOST_AUTO_TEST_SUITE(EFL)