* to do soon:
* - iconfication api needs to work
* - maximization api nees to work
- * - attach keyed data to an ecore_evas canvas
* - document all calls
*
* later:
/* generic manipulation calls */
void ecore_evas_free(Ecore_Evas *ee);
+void *ecore_evas_data_get(Ecore_Evas *ee, const char *key);
+void ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data);
void ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
void ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
return;
}
ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
+ if (ee->data) evas_hash_free(ee->data);
if (ee->driver) free(ee->driver);
if (ee->name) free(ee->name);
if (ee->prop.title) free(ee->prop.title);
if (ee->prop.cursor.file) free(ee->prop.cursor.file);
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
if (ee->evas) evas_free(ee->evas);
+ ee->data = NULL;
ee->driver = NULL;
ee->name = NULL;
ee->prop.title = NULL;
free(ee);
}
+void *
+ecore_evas_data_get(Ecore_Evas *ee, const char *key)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_data_get");
+ return NULL;
+ }
+
+ if (!key) return NULL;
+
+ return evas_hash_find(ee->data, key);
+}
+
+void
+ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_data_set");
+ return;
+ }
+
+ if (!key) return;
+
+ ee->data = evas_hash_del(ee->data, key, NULL);
+ ee->data = evas_hash_add(ee->data, key, data);
+}
+
#define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
#define IFE return;}