boost::lambda::placeholder2_type _2_;
boost::lambda::placeholder3_type _3_;
+struct Geometry
+{
+ Geometry()
+ : x(-1)
+ , y(-1)
+ , width(-1)
+ , height(-1)
+ {
+ return;
+ }
+
+ int32_t x;
+ int32_t y;
+ int32_t width;
+ int32_t height;
+};
+
+struct Position
+{
+ Position()
+ : x(-1)
+ , y(-1)
+ {
+ return;
+ }
+
+ int32_t x;
+ int32_t y;
+};
+
#endif
ASSERT_MSG(condition(), message);
}
-ElmTestHarness::Geometry ElmTestHarness::getSurfaceGeometry(wl_surface* surface)
+Geometry ElmTestHarness::getSurfaceGeometry(wl_surface* surface)
{
WaylandFits::QueryRequest* request = wfits_.makeGeometryRequest(surface);
return result;
}
-ElmTestHarness::Position ElmTestHarness::getGlobalPointerPosition() const
+Position ElmTestHarness::getGlobalPointerPosition() const
{
WaylandFits::QueryRequest* request = wfits_.makeGlobalPointerPositionRequest();
class ElmTestHarness : public TestHarness
{
public:
- typedef WaylandFits::Geometry Geometry;
- typedef WaylandFits::Position Position;
typedef boost::function<bool (void)> Condition;
/**
return obj_;
}
+EvasObject::operator const Evas_Object*() const
+{
+ return obj_;
+}
+
void EvasObject::setSize(int w, int h)
{
evas_object_resize(*this, w, h);
evas_object_hide(*this);
}
-const int EvasObject::getX()
+Geometry EvasObject::getGeometry() const
+{
+ Geometry g;
+ evas_object_geometry_get(*this, &g.x, &g.y, &g.width, &g.height);
+ return g;
+}
+
+Position EvasObject::getPosition() const
+{
+ Position p;
+ evas_object_geometry_get(*this, &p.x, &p.y, NULL, NULL);
+ return p;
+}
+
+int EvasObject::getX() const
{
int x;
evas_object_geometry_get(*this, &x, NULL, NULL, NULL);
return x;
}
-const int EvasObject::getY()
+int EvasObject::getY() const
{
int y;
evas_object_geometry_get(*this, NULL, &y, NULL, NULL);
return y;
}
-const int EvasObject::getWidth()
+int EvasObject::getWidth() const
{
int w;
evas_object_geometry_get(*this, NULL, NULL, &w, NULL);
return w;
}
-const int EvasObject::getHeight()
+int EvasObject::getHeight() const
{
int h;
evas_object_geometry_get(*this, NULL, NULL, NULL, &h);
return h;
}
-const Eina_Bool EvasObject::isVisible()
+Eina_Bool EvasObject::isVisible() const
{
return evas_object_visible_get(*this);
}
#define __WAYLAND_EFL_EVAS_OBJECT_H__
#include <Evas.h>
+#include "common/util.h"
class EvasObject
{
void show();
void hide();
- const int getWidth();
- const int getHeight();
- const int getX();
- const int getY();
- const Eina_Bool isVisible();
+ int getWidth() const;
+ int getHeight() const;
+ int getX() const;
+ int getY() const;
+ Geometry getGeometry() const;
+ Position getPosition() const;
+
+ Eina_Bool isVisible() const;
+
// operator Evas*();
operator Evas_Object*();
+ operator const Evas_Object*() const;
void checkSize(const int width, const int height);
void checkPosition(const int x, const int y);
ASSERT(wfits_query_ != NULL);
}
-WaylandFits::Geometry::Geometry()
- : x(-1)
- , y(-1)
- , width(-1)
- , height(-1)
-{
- return;
-}
-
-WaylandFits::Position::Position()
- : x(-1)
- , y(-1)
-{
- return;
-}
-
WaylandFits::QueryRequest::QueryRequest()
: done(false)
, data(NULL)
wl_fixed_t x, wl_fixed_t y, int32_t w, int32_t h)
{
WaylandFits::QueryRequest* qr = static_cast<WaylandFits::QueryRequest*>(data);
- WaylandFits::Geometry* g = static_cast<WaylandFits::Geometry*>(qr->data);
+ Geometry* g = static_cast<Geometry*>(qr->data);
g->x = wl_fixed_to_int(x);
g->y = wl_fixed_to_int(y);
g->width = w;
wl_fixed_t x, wl_fixed_t y)
{
WaylandFits::QueryRequest* qr = static_cast<WaylandFits::QueryRequest*>(data);
- WaylandFits::Position* g = static_cast<WaylandFits::Position*>(qr->data);
+ Position* g = static_cast<Position*>(qr->data);
g->x = wl_fixed_to_int(x);
g->y = wl_fixed_to_int(y);
qr->done = true;
#include <Ecore.h>
#include <Ecore_Wayland.h>
#include "extensions/protocol/wayland-fits-client-protocol.h"
+#include "common/util.h"
class WaylandFits
{
virtual ~WaylandFits();
- class Geometry
- {
- public:
- Geometry();
- int32_t x;
- int32_t y;
- int32_t width;
- int32_t height;
- };
-
- class Position
- {
- public:
- Position();
- int32_t x;
- int32_t y;
- };
-
class QueryRequest
{
public: