当前位置: 首页>>代码示例>>C++>>正文


C++ TestApplication::GetCore方法代码示例

本文整理汇总了C++中TestApplication::GetCore方法的典型用法代码示例。如果您正苦于以下问题:C++ TestApplication::GetCore方法的具体用法?C++ TestApplication::GetCore怎么用?C++ TestApplication::GetCore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestApplication的用法示例。


在下文中一共展示了TestApplication::GetCore方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UtcDaliTapGestureSystemOverlay

int UtcDaliTapGestureSystemOverlay(void)
{
  TestApplication application;
  Dali::Integration::Core& core = application.GetCore();
  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
  systemOverlay.GetOverlayRenderTasks().CreateTask();

  Actor actor = Actor::New();
  actor.SetSize(100.0f, 100.0f);
  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
  systemOverlay.Add(actor);

  // Render and notify
  application.SendNotification();
  application.Render();

  SignalData data;
  GestureReceivedFunctor functor(data);

  TapGestureDetector detector = TapGestureDetector::New();
  detector.Attach(actor);
  detector.DetectedSignal().Connect(&application, functor);

  Vector2 screenCoords( 50.0f, 50.0f );

  // Do a tap inside actor's area
  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:31,代码来源:utc-Dali-TapGestureDetector.cpp

示例2: UtcDaliHoverSystemOverlayActor

int UtcDaliHoverSystemOverlayActor(void)
{
  TestApplication application;
  Dali::Integration::Core& core( application.GetCore() );
  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
  systemOverlay.GetOverlayRenderTasks().CreateTask();

  // Create an actor and add it to the system overlay.
  Actor systemActor = Actor::New();
  systemActor.SetSize(100.0f, 100.0f);
  systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
  systemOverlay.Add( systemActor );

  // Create an actor and add it to the stage as per normal, same position and size as systemActor
  Actor actor = Actor::New();
  actor.SetSize(100.0f, 100.0f);
  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
  Stage::GetCurrent().Add(actor);

  // Connect to the hover signals.
  SignalData data;
  HoverEventFunctor functor( data );
  systemActor.HoveredSignal().Connect( &application, functor );
  actor.HoveredSignal().Connect( &application, functor );

  // Render and notify
  application.SendNotification();
  application.Render();

  // Emit a started signal, the system overlay is drawn last so is at the top, should hit the systemActor.
  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
  DALI_TEST_CHECK( systemActor == data.hoveredActor );
  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:35,代码来源:utc-Dali-HoverProcessing.cpp

示例3: UtcDaliTapGestureTouchBehindGesturedSystemOverlay

int UtcDaliTapGestureTouchBehindGesturedSystemOverlay(void)
{
  TestApplication application;
  Dali::Integration::Core& core = application.GetCore();
  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
  systemOverlay.GetOverlayRenderTasks().CreateTask();

  // SystemOverlay actor
  Actor systemOverlayActor = Actor::New();
  systemOverlayActor.SetSize(100.0f, 100.0f);
  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
  systemOverlay.Add(systemOverlayActor);

  // Stage actor
  Actor stageActor = Actor::New();
  stageActor.SetSize(100.0f, 100.0f);
  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
  Stage::GetCurrent().Add(stageActor);

  // Render and notify
  application.SendNotification();
  application.Render();

  // Set stage actor to touchable
  TouchEventData touchData;
  TouchEventDataFunctor touchFunctor( touchData );
  stageActor.TouchedSignal().Connect(&application, touchFunctor);

  // Set system-overlay actor to have the gesture
  SignalData data;
  GestureReceivedFunctor functor(data);

  TapGestureDetector detector = TapGestureDetector::New();
  detector.Attach(systemOverlayActor);
  detector.DetectedSignal().Connect(&application, functor);

  Vector2 screenCoords( 50.0f, 50.0f );

  // Do a tap inside both actors' area
  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );

  data.Reset();
  touchData.Reset();

  // Do touch in the same area
  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );

  END_TEST;
}
开发者ID:tizenorg,项目名称:platform.core.uifw.dali-core,代码行数:54,代码来源:utc-Dali-TapGestureDetector.cpp

示例4: UtcDaliStageGetDpiP2

int UtcDaliStageGetDpiP2(void)
{
  TestApplication application; // Initializes core DPI to default values

  // Test that setting core DPI explicitly also sets up the Stage's DPI.
  application.GetCore().SetDpi( 200, 180 );

  Stage stage = Stage::GetCurrent();
  Vector2 dpi = stage.GetDpi();
  DALI_TEST_EQUALS( dpi.x, 200.0f, TEST_LOCATION );
  DALI_TEST_EQUALS( dpi.y, 180.0f, TEST_LOCATION );
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:13,代码来源:utc-Dali-Stage.cpp

示例5: UtcDaliStageSceneCreatedSignalP

int UtcDaliStageSceneCreatedSignalP(void)
{
  TestApplication app;
  Stage stage = Stage::GetCurrent();

  bool signalCalled = false;
  SceneCreatedStatusFunctor sceneCreatedFunctor( signalCalled );
  stage.SceneCreatedSignal().Connect( &app, sceneCreatedFunctor );

  Integration::Core& core = app.GetCore();
  core.SceneCreated();
  DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:15,代码来源:utc-Dali-Stage.cpp

示例6: UtcDaliStageContextLostSignalP

int UtcDaliStageContextLostSignalP(void)
{
  TestApplication app;
  Stage stage = Stage::GetCurrent();

  bool contextLost = false;
  ContextStatusFunctor contextLostFunctor( contextLost );
  stage.ContextLostSignal().Connect( &app, contextLostFunctor );

  Integration::ContextNotifierInterface* notifier = app.GetCore().GetContextNotifier();
  notifier->NotifyContextLost();
  DALI_TEST_EQUALS( contextLost, true, TEST_LOCATION );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:15,代码来源:utc-Dali-Stage.cpp

示例7: UtcDaliNativeImageContextLoss

int UtcDaliNativeImageContextLoss(void)
{
  TestApplication application;
  tet_infoline( "Testing Dali::NativeImage behaviour through a context lost/regained cycle." );

  // Build an image that is expected to have a GL texture created for it and
  // recreated in a GL context recovery:
  TestNativeImagePointer eagerImageInterface = TestNativeImage::New( 16, 16 );
  NativeImage eagerImage = NativeImage::New( *(eagerImageInterface.Get()) );
  DALI_TEST_CHECK( eagerImage );

  // Build a regular lazy-allocated image for comparison:
  TestNativeImagePointer lazyImageInterface = TestNativeImage::New( 16, 16 );
  NativeImage lazyImage = NativeImage::New( *(lazyImageInterface.Get()) );
  DALI_TEST_CHECK( lazyImage );

  eagerImage.CreateGlTexture();

  application.SendNotification();
  application.Render(16);

  // Cycle through a context loss and regain, asserting that the texture is
  // not reallocated if it already existed before the cycle and is never allocated
  // throughout the cycle if of the regular lazy kind:

  // Call render thread context destroyed / created functions:
  application.ResetContext();

  // Call event thread function:
  application.GetCore().RecoverFromContextLoss();

  // Run update/render loop
  application.SendNotification();
  application.Render(16);

  DALI_TEST_EQUALS( eagerImageInterface->mExtensionCreateCalls, 1, TEST_LOCATION );
  DALI_TEST_EQUALS( eagerImageInterface->mTargetTextureCalls, 1, TEST_LOCATION );

  DALI_TEST_EQUALS( lazyImageInterface->mExtensionCreateCalls, 0, TEST_LOCATION );
  DALI_TEST_EQUALS( lazyImageInterface->mTargetTextureCalls, 0, TEST_LOCATION );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:43,代码来源:utc-Dali-NativeImage.cpp


注:本文中的TestApplication::GetCore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。