/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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/public-api/dali-core.h>
#include <dali/integration-api/core.h>
#include <dali-test-suite-utils.h>
+#include <dali/integration-api/processor-interface.h>
using namespace Dali;
class TestProcessor : public Integration::Processor
{
public:
+
TestProcessor()
: processRun(false)
{
END_TEST;
}
+
+int UtcDaliCoreProcessorMultipleP(void)
+{
+ TestApplication application;
+
+ TestProcessor testProcessor1;
+ TestProcessor testProcessor2;
+ TestProcessor testProcessor3;
+
+ Integration::Core& core = application.GetCore();
+ core.RegisterProcessor( testProcessor1 );
+
+ tet_infoline("Test that the processor has not been executed yet:");
+ DALI_TEST_CHECK( testProcessor1.processRun == false );
+
+ application.SendNotification();
+
+ tet_infoline("Test that the processor has been executed:");
+ DALI_TEST_CHECK( testProcessor1.processRun );
+
+ // Clear down for next part of test
+ testProcessor1.processRun = false;
+
+ core.RegisterProcessor( testProcessor2 );
+ core.RegisterProcessor( testProcessor3 );
+
+ tet_infoline("Test that the processors have not been executed yet:");
+ DALI_TEST_CHECK( testProcessor1.processRun == false );
+ DALI_TEST_CHECK( testProcessor2.processRun == false );
+ DALI_TEST_CHECK( testProcessor3.processRun == false );
+
+ application.SendNotification();
+
+ tet_infoline("Test that the processors have been executed:");
+ DALI_TEST_CHECK( testProcessor1.processRun );
+ DALI_TEST_CHECK( testProcessor2.processRun );
+ DALI_TEST_CHECK( testProcessor3.processRun );
+
+ // Clear down for next part of test
+ testProcessor2.processRun = false;
+
+ core.UnregisterProcessor( testProcessor2 );
+ application.SendNotification();
+ tet_infoline("Test that the unregistered processor has not been executed again but others have");
+ DALI_TEST_CHECK( testProcessor1.processRun );
+ DALI_TEST_CHECK( testProcessor2.processRun == false );
+ DALI_TEST_CHECK( testProcessor3.processRun );
+
+ END_TEST;
+}
\ No newline at end of file
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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/public-api/common/dali-common.h>
#include <dali/integration-api/events/event.h>
#include <dali/integration-api/gl-sync-abstraction.h>
+#include <dali/integration-api/processor-interface.h>
#include <dali/internal/common/core-impl.h>
namespace Dali
#define DALI_INTEGRATION_CORE_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
namespace Integration
{
-
class Core;
class GestureManager;
class GlAbstraction;
class GlSyncAbstraction;
class PlatformAbstraction;
+class Processor;
class RenderController;
class SystemOverlay;
struct Event;
bool needsPostRender :1; ///< True if post-render is required to be run.
};
-/**
- * Interface to enable classes to be processed after the event loop. Classes are processed
- * in the order they are registered.
- */
-class DALI_CORE_API Processor
-{
-public:
- /**
- * @brief Run the processor
- */
- virtual void Process() = 0;
-
-protected:
- virtual ~Processor() { }
-};
-
/**
* Integration::Core is used for integration with the native windowing system.
$(platform_abstraction_src_dir)/gesture-manager.h \
$(platform_abstraction_src_dir)/render-controller.h \
$(platform_abstraction_src_dir)/platform-abstraction.h \
+ $(platform_abstraction_src_dir)/processor-interface.h \
$(platform_abstraction_src_dir)/system-overlay.h \
$(platform_abstraction_src_dir)/lockless-buffer.h \
$(platform_abstraction_src_dir)/render-task-list-integ.h
--- /dev/null
+#ifndef DALI_INTEGRATION_PROCESSOR_INTERFACE_H
+#define DALI_INTEGRATION_PROCESSOR_INTERFACE_H
+
+/*
+ * Copyright (c) 2019 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+
+namespace Integration
+{
+
+/**
+ * Interface to enable classes to be processed after the event loop. Classes are processed
+ * in the order they are registered.
+ */
+class DALI_CORE_API Processor
+{
+public:
+ /**
+ * @brief Run the processor
+ */
+ virtual void Process() = 0;
+
+protected:
+
+ /**
+ * Virtual protected destructor
+ */
+ virtual ~Processor() { }
+};
+
+} // Dali
+
+} // Integration
+
+#endif // DALI_INTEGRATION_PROCESSOR_INTERFACE_H
\ No newline at end of file
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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/integration-api/events/event.h>
#include <dali/integration-api/gl-sync-abstraction.h>
#include <dali/integration-api/platform-abstraction.h>
+#include <dali/integration-api/processor-interface.h>
#include <dali/integration-api/render-controller.h>
#include <dali/internal/event/actors/actor-impl.h>