cedric pushed a commit to branch master.
commit f07d4c17e9610030b2dfae1c0e3abf362a9a1a72
Author: Cedric Bail <[email protected]>
Date: Wed Jul 10 13:29:01 2013 +0900
eina: add eina_tiler_empty.
---
src/lib/eina/eina_tiler.c | 8 ++++++++
src/lib/eina/eina_tiler.h | 14 +++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/lib/eina/eina_tiler.c b/src/lib/eina/eina_tiler.c
index f54c2ba..6734b2f 100644
--- a/src/lib/eina/eina_tiler.c
+++ b/src/lib/eina/eina_tiler.c
@@ -1198,6 +1198,14 @@ EAPI void eina_tiler_tile_size_set(Eina_Tiler *t, int w,
int h)
_splitter_tile_size_set(t, w, h);
}
+EAPI Eina_Bool
+eina_tiler_empty(Eina_Tiler *t)
+{
+ EINA_MAGIC_CHECK_TILER(t, EINA_TRUE);
+
+ return !memcmp(&t->splitter.rects, &list_zeroed, sizeof (list_t));
+}
+
EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t, const Eina_Rectangle *r)
{
Eina_Rectangle tmp;
diff --git a/src/lib/eina/eina_tiler.h b/src/lib/eina/eina_tiler.h
index e1de173..3a48383 100644
--- a/src/lib/eina/eina_tiler.h
+++ b/src/lib/eina/eina_tiler.h
@@ -228,7 +228,7 @@ EAPI void eina_tiler_area_size_set(Eina_Tiler
*t, int w, int h);
*
* @since 1.8
*/
-EAPI void eina_tiler_area_size_get(const Eina_Tiler *t, int *w, int *h);
+EAPI void eina_tiler_area_size_get(const Eina_Tiler *t, int *w,
int *h);
/**
* @brief Define if we need to follow a strict grid of tile or a loosy one
@@ -237,10 +237,22 @@ EAPI void eina_tiler_area_size_get(const Eina_Tiler *t,
int *w, int *h);
* @param strict Define if it will be strict or loosy
*
* By default it will be loosy.
+ *
+ * @since 1.8
*/
EAPI void eina_tiler_strict_set(Eina_Tiler *t, Eina_Bool strict);
/**
+ * @brief Tell if a tiler is empty or not
+ *
+ * @param t The tiler to apply the strict rules to.
+ * @return EINA_TRUE when empty, EINA_FALSE when not.
+ *
+ * @since 1.8
+ */
+EAPI Eina_Bool eina_tiler_empty(Eina_Tiler *t);
+
+/**
* @brief Adds a rectangle to a tiler.
*
* @param t The tiler in which to add a container.
--
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk