Ejemplo n.º 1
0
void zfSkinUnload(void)
{
    ZFCoreMutexLocker();
    _ZFP_ZFSkinMapGlobal.clear();

    zfSkinNotifyChanged();
}
Ejemplo n.º 2
0
void zfLangUnload(void)
{
    ZFCoreMutexLocker();
    _ZFP_ZFLangMapGlobal().clear();

    zfLangNotifyChanged();
}
Ejemplo n.º 3
0
void ZFLeakTestVerboseObserverAdd(ZF_IN const ZFClass *cls)
{
    if(cls != zfnull)
    {
        ZFCoreMutexLocker();
        ZF_GLOBAL_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->clsList.add(cls);
        _ZFP_ZFLeakTestVerboseObserverEnabled = zftrue;
    }
}
Ejemplo n.º 4
0
void ZFLeakTestVerboseObserverAdd(ZF_IN ZFObject *obj)
{
    if(obj != zfnull)
    {
        ZFCoreMutexLocker();
        ZF_GLOBAL_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->objList.add(obj);
        _ZFP_ZFLeakTestVerboseObserverEnabled = zftrue;
    }
}
Ejemplo n.º 5
0
void ZFLeakTestVerboseObserverRemove(ZF_IN ZFObject *obj)
{
    ZFCoreMutexLocker();
    ZF_GLOBAL_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->objList.removeElement(obj);

    _ZFP_ZFLeakTestVerboseObserverEnabled =
        (ZF_GLOBAL_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->clsList.isEmpty()
         && ZF_GLOBAL_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->objList.isEmpty());
}
Ejemplo n.º 6
0
void ZFLeakTestVerboseObserverRemove(ZF_IN const ZFClass *cls)
{
    ZFCoreMutexLocker();
    ZF_STATIC_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->clsList.removeElement(cls);

    _ZFP_ZFLeakTestVerboseObserverEnabled =
        (ZF_STATIC_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->clsList.isEmpty()
         && ZF_STATIC_INITIALIZER_INSTANCE(ZFLeakTestVerboseObserverDataHolder)->objList.isEmpty());
}
Ejemplo n.º 7
0
ZFMethod *ZFMethod::_ZFP_ZFMethodAccess(ZF_IN const zfchar *internalMethodId)
{
    ZFCoreMutexLocker();
    ZFMethod *v = _ZFP_ZFMethodMap.get<ZFMethod *>(internalMethodId);
    if(v == zfnull)
    {
        v = zfnew(ZFMethod);
        _ZFP_ZFMethodMap.set(internalMethodId, ZFCorePointerForObject<ZFMethod *>(v));
    }
    return v;
}
Ejemplo n.º 8
0
_ZFP_ZFStyleableDefaultPointerHolder *_ZFP_ZFStyleableDefaultRefAccess(ZF_IN const zfchar *name)
{
    ZFCoreMutexLocker();
    ZFCoreMap &m = ZF_STATIC_INITIALIZER_INSTANCE(ZFStyleableDefaultStyleDataHolder)->instanceDataMap;
    ZFCorePointerBase *v = m.get(name);
    if(v == zfnull)
    {
        m.set(name, ZFCorePointerForObject<_ZFP_ZFStyleableDefaultPointerHolder *>(zfnew(_ZFP_ZFStyleableDefaultPointerHolder)));
        v = m.get(name);
    }
    return v->pointerValueT<_ZFP_ZFStyleableDefaultPointerHolder *>();
}
Ejemplo n.º 9
0
void zfLangSetDefault(ZF_IN const zfchar *key, ZF_IN const zfchar *value)
{
    if(key && value)
    {
        ZFCoreMutexLocker();
        _ZFP_ZFLangMapType &m = _ZFP_ZFLangMapGlobal();
        _ZFP_ZFLangMapType::iterator it = m.find(key);
        if(it == m.end())
        {
            m[key] = value;
        }
    }
}
Ejemplo n.º 10
0
void zfLangSet(ZF_IN const zfchar *key, ZF_IN const zfchar *value)
{
    if(key != zfnull)
    {
        ZFCoreMutexLocker();
        if(value == zfnull)
        {
            _ZFP_ZFLangMapGlobal().erase(key);
        }
        else
        {
            _ZFP_ZFLangMapGlobal()[key] = value;
        }
    }
}
Ejemplo n.º 11
0
void zfSkinSetDefault(ZF_IN const zfchar *key, ZF_IN ZFStyleable *value)
{
    if(key && value)
    {
        if(!value->classData()->classIsTypeOf(ZFSerializable::ClassData()))
        {
            zfCoreCriticalMessage(zfTextA("skin value must be type of %s"), zfsCoreZ2A(ZFSerializable::ClassData()->className()));
            return ;
        }

        ZFCoreMutexLocker();
        _ZFP_ZFSkinMapType &m = _ZFP_ZFSkinMapGlobal;
        _ZFP_ZFSkinMapType::iterator it = m.find(key);
        if(it == m.end())
        {
            m[key] = zfautoObjectCreateMarkCached(value->toObject());
        }
    }
}
Ejemplo n.º 12
0
void ZFLeakTestExcludeInstanceRemove(ZF_IN ZFObject *obj)
{
    if(!_ZFP_ZFLeakTestInitFlag || obj == zfnull)
    {
        return ;
    }

    ZFCoreMutexLocker();

    _ZFP_ZFLeakTestGlobalExcludeInstanceType::iterator it = _ZFP_ZFLeakTestGlobalExcludeInstances.find(obj);
    if(it != _ZFP_ZFLeakTestGlobalExcludeInstances.end())
    {
        --(it->second);
        if(it->second == 0)
        {
            _ZFP_ZFLeakTestGlobalExcludeInstances.erase(it);
        }
    }
}
Ejemplo n.º 13
0
void ZFLeakTestExcludeInstanceAdd(ZF_IN ZFObject *obj)
{
    if(!_ZFP_ZFLeakTestInitFlag || obj == zfnull)
    {
        return ;
    }

    ZFCoreMutexLocker();

    _ZFP_ZFLeakTestGlobalExcludeInstanceType::iterator it = _ZFP_ZFLeakTestGlobalExcludeInstances.find(obj);
    if(it != _ZFP_ZFLeakTestGlobalExcludeInstances.end())
    {
        ++(it->second);
    }
    else
    {
        _ZFP_ZFLeakTestGlobalExcludeInstances[obj] = 1;
    }
}
Ejemplo n.º 14
0
void ZFLeakTestExcludeNameRemove(ZF_IN const zfchar *name)
{
    if(!_ZFP_ZFLeakTestInitFlag || name == zfnull)
    {
        return ;
    }

    ZFCoreMutexLocker();

    _ZFP_ZFLeakTestGlobalExcludeNameType::iterator it = _ZFP_ZFLeakTestGlobalExcludeNames.find(name);
    if(it != _ZFP_ZFLeakTestGlobalExcludeNames.end())
    {
        --(it->second);
        if(it->second == 0)
        {
            _ZFP_ZFLeakTestGlobalExcludeNames.erase(it);
        }
    }
}
Ejemplo n.º 15
0
void ZFLeakTestExcludeNameAdd(ZF_IN const zfchar *name)
{
    if(!_ZFP_ZFLeakTestInitFlag || name == zfnull)
    {
        return ;
    }

    ZFCoreMutexLocker();

    _ZFP_ZFLeakTestGlobalExcludeNameType::iterator it = _ZFP_ZFLeakTestGlobalExcludeNames.find(name);
    if(it != _ZFP_ZFLeakTestGlobalExcludeNames.end())
    {
        ++(it->second);
    }
    else
    {
        _ZFP_ZFLeakTestGlobalExcludeNames[name] = 1;
    }
}
Ejemplo n.º 16
0
void zfSkinSet(ZF_IN const zfchar *key, ZF_IN ZFStyleable *value)
{
    if(key != zfnull)
    {
        ZFCoreMutexLocker();
        if(value == zfnull)
        {
            _ZFP_ZFSkinMapGlobal.erase(key);
        }
        else
        {
            if(value->classData()->classIsTypeOf(ZFSerializable::ClassData()))
            {
                _ZFP_ZFSkinMapGlobal[key] = zfautoObjectCreateMarkCached(value->toObject());
            }
            else
            {
                zfCoreCriticalMessage(zfTextA("skin value must be type of %s"), zfsCoreZ2A(ZFSerializable::ClassData()->className()));
            }
        }
    }
}
Ejemplo n.º 17
0
// ============================================================
zfautoObject zfSkin(ZF_IN const zfchar *key,
                    ZF_IN_OPT ZFStyleable *valueDefault /* = zfnull */)
{
    ZFCoreMutexLocker();
    _ZFP_ZFSkinMapType &m = _ZFP_ZFSkinMapGlobal;
    _ZFP_ZFSkinMapType::iterator it = m.find(key);
    if(it != m.end())
    {
        return zfautoObjectCreate(it->second.toObject());
    }
    else
    {
        if(valueDefault != zfnull)
        {
            return zfautoObjectCreate(valueDefault->toObject());
        }
        else
        {
            return zfautoObjectNull;
        }
    }
}
Ejemplo n.º 18
0
void zfLang(ZF_IN_OUT zfstring &ret,
            ZF_IN const zfchar *key,
            ZF_IN_OPT const zfchar *valueDefault /* = zfnull */)
{
    ZFCoreMutexLocker();
    _ZFP_ZFLangMapType &m = _ZFP_ZFLangMapGlobal();
    _ZFP_ZFLangMapType::iterator it = m.find(key);
    if(it != m.end())
    {
        ret += it->second;
    }
    else
    {
        if(valueDefault != zfnull)
        {
            ret += valueDefault;
        }
        else
        {
            ret += key;
        }
    }
}
Ejemplo n.º 19
0
void _ZFP_ZFMethodInstanceCleanup(ZF_IN const zfchar *internalMethodId)
{
    ZFCoreMutexLocker();
    _ZFP_ZFMethodMap.remove(internalMethodId);
}