#include "els_scroller.h"
#include "elm_gen_common.h"
+// internally allocated
+#define CLASS_ALLOCATED 0x3a70f00f
+
/* --
* TODO:
* Handle non-homogeneous objects too.
itc = calloc(1, sizeof(Elm_Gengrid_Item_Class));
if (!itc)
return NULL;
- itc->version = ELM_GENGRID_ITEM_CLASS_VERSION;
+ itc->version = CLASS_ALLOCATED;
itc->refcount = 1;
itc->delete_me = EINA_FALSE;
EAPI void
elm_gengrid_item_class_free(Elm_Gengrid_Item_Class *itc)
{
- if (itc && (itc->version == ELM_GENGRID_ITEM_CLASS_VERSION))
+ if (itc && (itc->version == CLASS_ALLOCATED))
{
if (!itc->delete_me) itc->delete_me = EINA_TRUE;
if (itc->refcount > 0) elm_gengrid_item_class_unref(itc);
EAPI void
elm_gengrid_item_class_ref(Elm_Gengrid_Item_Class *itc)
{
- if (itc && (itc->version == ELM_GENGRID_ITEM_CLASS_VERSION))
+ if (itc && (itc->version == CLASS_ALLOCATED))
{
itc->refcount++;
if (itc->refcount == 0) itc->refcount--;
EAPI void
elm_gengrid_item_class_unref(Elm_Gengrid_Item_Class *itc)
{
- if (itc && (itc->version == ELM_GENGRID_ITEM_CLASS_VERSION))
+ if (itc && (itc->version == CLASS_ALLOCATED))
{
if (itc->refcount > 0) itc->refcount--;
if (itc->delete_me && (!itc->refcount))
#include "els_scroller.h"
#include "elm_gen_common.h"
+// internally allocated
+#define CLASS_ALLOCATED 0x3a70f11f
+
#define MAX_ITEMS_PER_BLOCK 32
#define REORDER_EFFECT_TIME 0.5
ERR("Genlist_Item_Class(itc) is NULL"); \
return; \
} \
- if (itc->version != ELM_GENLIST_ITEM_CLASS_VERSION) \
+ if ((itc->version != ELM_GENLIST_ITEM_CLASS_VERSION) && \
+ (itc->version != CLASS_ALLOCATED)) \
{ \
- ERR("Genlist_Item_Class version mismatched! required = (%d), current = (%d)", itc->version, ELM_GENLIST_ITEM_CLASS_VERSION); \
+ ERR("Genlist_Item_Class version mismatched! current = (%d), required = (%d) or (%d)", itc->version, ELM_GENLIST_ITEM_CLASS_VERSION, CLASS_ALLOCATED); \
return; \
} \
} \
itc = calloc(1, sizeof(Elm_Genlist_Item_Class));
if (!itc)
return NULL;
- itc->version = ELM_GENLIST_ITEM_CLASS_VERSION;
+ itc->version = CLASS_ALLOCATED;
itc->refcount = 1;
itc->delete_me = EINA_FALSE;
EAPI void
elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
{
- if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
+ if (itc && (itc->version == CLASS_ALLOCATED))
{
if (!itc->delete_me) itc->delete_me = EINA_TRUE;
if (itc->refcount > 0) elm_genlist_item_class_unref(itc);
EAPI void
elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
{
- if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
+ if (itc && (itc->version == CLASS_ALLOCATED))
{
itc->refcount++;
if (itc->refcount == 0) itc->refcount--;
EAPI void
elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
{
- if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
+ if (itc && (itc->version == CLASS_ALLOCATED))
{
if (itc->refcount > 0) itc->refcount--;
if (itc->delete_me && (!itc->refcount))