static bool ewk_js_properties_enumerate(NPObject* npObject, NPIdentifier** value, uint32_t* count) { Ewk_JS_Object* object = reinterpret_cast<Ewk_JS_Object*>(npObject); Eina_Iterator* it; char* key; int i = 0; EINA_SAFETY_ON_NULL_RETURN_VAL(npObject, false); EINA_MAGIC_CHECK_OR_RETURN(object, false); *count = eina_hash_population(object->properties); *value = static_cast<NPIdentifier*>(malloc(sizeof(NPIdentifier) * *count)); if (!*value) { ERR("Could not allocate memory for NPIdentifier"); return false; } it = eina_hash_iterator_key_new(object->properties); EINA_ITERATOR_FOREACH(it, key) (*value)[i++] = _NPN_GetStringIdentifier(key); eina_iterator_free(it); return true; }
NPIdentifier WebBindings::getStringIdentifier(const NPUTF8* string) { return _NPN_GetStringIdentifier(string); }
NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name) { return _NPN_GetStringIdentifier(name); }
static Eina_Bool ewk_js_npobject_property_del(Ewk_JS_Object* jsObject, const char* name) { NPIdentifier id = _NPN_GetStringIdentifier(name); return _NPN_RemoveProperty(0, reinterpret_cast<NPObject*>(jsObject), id); }