/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/common/type-registry-impl.h>
-using namespace std;
-
namespace Dali
{
void BaseObject::RegisterObject()
{
- if( Internal::Stage::IsInstalled() )
+ Internal::Stage* stage = Internal::Stage::GetCurrent();
+ if( stage )
{
- Internal::Stage::GetCurrent()->GetObjectRegistry().RegisterObject( this );
+ stage->RegisterObject( this );
}
}
void BaseObject::UnregisterObject()
{
// Guard to allow handle destruction after Core has been destroyed
- if( Internal::Stage::IsInstalled() )
+ Internal::Stage* stage = Internal::Stage::GetCurrent();
+ if( stage )
{
- Internal::Stage::GetCurrent()->GetObjectRegistry().UnregisterObject( this );
+ stage->UnregisterObject( this );
}
}
-bool BaseObject::DoAction(const std::string& actionName, const std::vector<Property::Value>& attributes)
+bool BaseObject::DoAction(const std::string& actionName, const Property::Map& attributes)
{
Dali::Internal::TypeRegistry* registry = Dali::Internal::TypeRegistry::Get();
}
}
- // We should not reach here
- static const std::string INVALID_NAME;
- DALI_LOG_ERROR( "TypeName Not Found\n" );
- return INVALID_NAME;
+ // Return an empty string if type-name not found.
+ DALI_LOG_WARNING( "TypeName Not Found\n" );
+ static std::string empty;
+ return empty;
+}
+
+bool BaseObject::GetTypeInfo(Dali::TypeInfo& typeInfo) const
+{
+ Dali::Internal::TypeRegistry* registry = Dali::Internal::TypeRegistry::Get();
+
+ Dali::TypeInfo info = registry->GetTypeInfo(this);
+ if(info)
+ {
+ typeInfo = info;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
bool BaseObject::DoConnectSignal( ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor )