本文整理汇总了C++中BaseHandle类的典型用法代码示例。如果您正苦于以下问题:C++ BaseHandle类的具体用法?C++ BaseHandle怎么用?C++ BaseHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: popStackHandles
extern "C" void popStackHandles(char* nextFrame) {
DeltaProcess* active = DeltaProcess::active();
if (active->thread_id() != os::current_thread_id()) {
active = Processes::find_from_thread_id(os::current_thread_id());
}
BaseHandle* current = active->firstHandle();
while (current && (char*) current < nextFrame) {
current->pop();
current = active->firstHandle();
}
}
示例2: UtcDaliBaseHandleGetBaseObject
int UtcDaliBaseHandleGetBaseObject(void)
{
TestApplication application;
tet_infoline("Testing Dali::BaseHandle::GetBaseObject()");
BaseHandle object = Actor::New();
BaseObject& handle = object.GetBaseObject();
DALI_TEST_EQUALS(1, handle.ReferenceCount(), TEST_LOCATION);
END_TEST;
}
示例3: UtcDaliBaseHandleReset
int UtcDaliBaseHandleReset(void)
{
TestApplication application;
tet_infoline("Testing Dali::BaseHandle::Reset()");
// Initialize an object, ref count == 1
BaseHandle object = Actor::New();
DALI_TEST_EQUALS(1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION);
object.Reset();
DALI_TEST_CHECK(!object);
END_TEST;
}
示例4: typeid
Dali::PhysicalKeyboard PhysicalKeyboard::Get()
{
Dali::PhysicalKeyboard keyboardHandle;
// Ensure the adaptor has been created
if ( Adaptor::IsAvailable() )
{
Dali::Adaptor& adaptor = Adaptor::Get();
BaseHandle handle = adaptor.GetSingleton( typeid( Dali::PhysicalKeyboard ) );
if( handle )
{
// If so, downcast the handle of singleton to focus manager
keyboardHandle = Dali::PhysicalKeyboard( dynamic_cast< PhysicalKeyboard* >( handle.GetObjectPtr() ) );
}
}
return keyboardHandle;
}
示例5: UtcDaliBaseHandleAssignmentOperator
int UtcDaliBaseHandleAssignmentOperator(void)
{
TestApplication application;
tet_infoline("Testing Dali::BaseHandle::operator=");
BaseHandle object = Actor::New();
DALI_TEST_CHECK(object);
if (object)
{
DALI_TEST_EQUALS(1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION);
}
BaseHandle copy = object;
DALI_TEST_CHECK(copy);
if (copy)
{
DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
}
END_TEST;
}
示例6: UtcDaliBaseHandleCopyConstructor
int UtcDaliBaseHandleCopyConstructor(void)
{
TestApplication application;
tet_infoline("Testing Dali::BaseHandle::BaseHandle(const BaseHandle&)");
// Initialize an object, ref count == 1
BaseHandle object = Actor::New();
DALI_TEST_EQUALS(1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION);
// Copy the object, ref count == 2
BaseHandle copy(object);
DALI_TEST_CHECK(copy);
if (copy)
{
DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
}
{
// Pass by value, and return another copy, ref count == 3
BaseHandle anotherCopy = ImplicitCopyConstructor(copy);
DALI_TEST_CHECK(anotherCopy);
if (anotherCopy)
{
DALI_TEST_EQUALS(3, anotherCopy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
}
}
// anotherCopy out of scope, ref count == 2
DALI_TEST_CHECK(copy);
if (copy)
{
DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
}
END_TEST;
}
示例7: DownCast
Handle Handle::DownCast( BaseHandle handle )
{
return Handle( dynamic_cast<Dali::Internal::Object*>(handle.GetObjectPtr()) );
}
示例8: DownCast
Animation Animation::DownCast( BaseHandle handle )
{
return Animation( dynamic_cast<Dali::Internal::Animation*>(handle.GetObjectPtr()) );
}
示例9: DownCast
Material Material::DownCast( BaseHandle handle )
{
return Material( dynamic_cast<Dali::Internal::Material*>(handle.GetObjectPtr()));
}
示例10: DownCast
Layer Layer::DownCast( BaseHandle handle )
{
return Layer( dynamic_cast<Dali::Internal::Layer*>(handle.GetObjectPtr()) );
}
示例11: DownCast
JsonParser DownCast( BaseHandle handle )
{
return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
}
示例12: DownCast
GestureDetector GestureDetector::DownCast( BaseHandle handle )
{
return GestureDetector( dynamic_cast<Dali::Internal::GestureDetector*>(handle.GetObjectPtr()) );
}
示例13: UtcDaliBaseHandleDoAction
int UtcDaliBaseHandleDoAction(void)
{
TestApplication application;
tet_infoline("Positive Test Dali::BaseHandle::UtcDaliBaseHandleDoAction");
Actor actor = Actor::New();
BaseHandle actorObject = actor;
DALI_TEST_CHECK(actorObject);
// Check that an invalid command is not performed
Property::Map attributes;
DALI_TEST_CHECK(actorObject.DoAction("invalidCommand", attributes) == false);
// Check that the actor is visible
actor.SetVisible(true);
DALI_TEST_CHECK(actor.IsVisible() == true);
// Check the actor performed an action to hide itself
DALI_TEST_CHECK(actorObject.DoAction("hide", attributes) == true);
// flush the queue and render once
application.SendNotification();
application.Render();
// Check that the actor is now invisible
DALI_TEST_CHECK(actor.IsVisible() == false);
// Check the actor performed an action to show itself
DALI_TEST_CHECK(actorObject.DoAction("show", attributes) == true);
// flush the queue and render once
application.SendNotification();
application.Render();
// Check that the actor is now visible
DALI_TEST_CHECK(actor.IsVisible() == true);
Stage::GetCurrent().Add(actor);
// Build an animation with initial duration of 1 second
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
BaseHandle animationObject = animation;
DALI_TEST_CHECK(animationObject);
// Check the current animation duration is 1 second
DALI_TEST_EQUALS(animation.GetDuration(), durationSeconds, TEST_LOCATION);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Set the new duration to be 2 seconds
float newDurationSeconds(2.0f);
Property::Value newDurationSecondsValue = Property::Value( newDurationSeconds );
attributes["duration"] = newDurationSecondsValue;
// Check the animation performed an action to play itself with the specified duration of 2 seconds
animationObject.DoAction("play", attributes);
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
application.Render(static_cast<unsigned int>(newDurationSeconds * 1000.0f) + 1u/*just beyond the animation duration*/);
// We expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
// Check the new animation duration is 2 seconds
DALI_TEST_EQUALS(animation.GetDuration(), newDurationSeconds, TEST_LOCATION);
END_TEST;
}
示例14: DownCast
Geometry Geometry::DownCast( BaseHandle handle )
{
return Geometry( dynamic_cast<Dali::Internal::Geometry*>(handle.GetObjectPtr()));
}
示例15: handleCallBack
extern "C" volatile void* handleCallBack(int index, int params) {
DeltaProcess* proc = NULL;
if (Universe::callBack_receiver()->is_nil()) {
warning("callBack receiver is not set");
}
int low = get_unsigned_bitfield(params, 0, 16);
int high = get_unsigned_bitfield(params, 16, 16);
if (DeltaProcess::active()->thread_id() != os::current_thread_id()) {
// We'are now back in a asynchronous DLL call so give up the control
// Fix this:
// remove warning when it has been tested
proc = Processes::find_from_thread_id(os::current_thread_id());
assert(proc, "process must be present");
DLLs::exit_async_call(&proc);
}
DeltaProcess::active()->setIsCallback(true);
oop res = Delta::call(Universe::callBack_receiver(),
Universe::callBack_selector(),
as_smiOop(index),
as_smiOop(high),
as_smiOop(low));
assert(DeltaProcess::active()->thread_id() == os::current_thread_id(), "check for process torch");
void* result;
// convert return result
if (have_nlr_through_C) {
// Continues the NLR after at the next Delta frame
BaseHandle* handle = DeltaProcess::active()->firstHandle();
if (handle && ((char*) handle < (char*)DeltaProcess::active()->last_Delta_fp()))
handle->pop();
ErrorHandler::continue_nlr_in_delta();
}
if (res->is_smi()) {
result = (void*) smiOop(res)->value();
} else if (res->is_proxy()) {
result = (void*) proxyOop(res)->get_pointer();
} else {
warning("Wrong return type for call back, returning NULL");
result = NULL;
}
// Return value has to be converted before we transfer control to another
// thread.
if (proc) {
// We'are now back in a asynchronous DLL call so give up the control
proc->resetStepping();
proc->transfer_and_continue();
}
// Call Delta level error routine
return result;
}