# Checks for libraries.
PKG_CHECK_MODULES([PEPPER], [pepper xkbcommon])
PKG_CHECK_MODULES([WAYLAND], [wayland-server xdg-shell-server tizen-extension-client])
-PKG_CHECK_MODULES([DALI], [dali-core dali-adaptor dali-toolkit])
+PKG_CHECK_MODULES([DALI], [dali-core dali-adaptor dali-toolkit dali-adaptor-integration])
PKG_CHECK_MODULES([EFL], [ecore ecore-input ecore-wayland])
PKG_CHECK_MODULES([WAYLAND_TBM], [wayland-tbm-server])
BuildRequires: pkgconfig(dali-core)
BuildRequires: pkgconfig(dali-adaptor)
+BuildRequires: pkgconfig(dali-adaptor-integration)
BuildRequires: pkgconfig(dali-toolkit)
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(pepper)
libpepper_dali_la_LDFLAGS = ${LDFLAGS}
libpepper_dali_la_CXXFLAGS = \
${CFLAGS} \
- $(DALICORE_CFLAGS) \
+ $(DALI_CFLAGS) \
@EFL_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@PEPPER_CFLAGS@ \
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <wayland-server.h>
+#include <wayland-tbm-server.h>
#include <tizen-extension-client-protocol.h>
#include <Ecore_Wayland.h>
return true;
}
+void ObjectView::Show()
+{
+ if( mSurface )
+ {
+ Pepper::Internal::ShellClientPtr shellClient = reinterpret_cast< Pepper::Internal::ShellClient* >( pepper_object_get_user_data( reinterpret_cast< pepper_object_t* >( mSurface ), pepper_surface_get_role( mSurface ) ) );
+ if( shellClient )
+ {
+ shellClient->MapSurface();
+ }
+ }
+
+ Self().SetVisible( true );
+}
+
+void ObjectView::Hide()
+{
+ if( mSurface )
+ {
+ Pepper::Internal::ShellClientPtr shellClient = reinterpret_cast< Pepper::Internal::ShellClient* >( pepper_object_get_user_data( reinterpret_cast< pepper_object_t* >( mSurface ), pepper_surface_get_role( mSurface ) ) );
+ if( shellClient )
+ {
+ shellClient->UnmapSurface();
+ }
+ }
+
+ Self().SetVisible( false );
+}
+
void ObjectView::SetSurface( pepper_surface_t* surface )
{
mSurface = surface;
bool CancelTouchEvent();
/**
+ * @copydoc Dali::Pepper::ObjectView::Show
+ */
+ void Show();
+
+ /**
+ * @copydoc Dali::Pepper::ObjectView::Hide
+ */
+ void Hide();
+
+ /**
* Set pepper surface
*/
void SetSurface( pepper_surface_t* surface );
// EXTERNAL INCLUDES
#include <dali/integration-api/adaptors/adaptor.h>
#include <dali/devel-api/adaptor-framework/render-surface.h>
+#include <dali/integration-api/adaptors/ecore-wl-render-surface.h>
+#include <dali/integration-api/adaptors/trigger-event-factory.h>
#include <dali/integration-api/debug.h>
namespace Dali
Output::OnStartRepaintLoop,
Output::OnRepaint,
Output::OnAttachSurface,
- Output::OnFlushSurface
+ Output::OnFlushSurfaceDamage
};
} // unnamed namespace
: mSize(),
mOutput( NULL ),
mPrimaryPlane( NULL ),
- mRepaintRequest( false )
+ mBufferAttached( false )
{
}
application.ResizeSignal().Connect( this, &Output::OnResize );
- // Set the thread-synchronization interface on the render-surface
- surface.SetThreadSynchronization( *this );
+ // Sets the render notification trigger to call when rendering is completed a frame
+ TriggerEventFactory triggerEventFactory;
+ TriggerEventInterface* renderNotification = triggerEventFactory.CreateTriggerEvent( MakeCallback( this, &Output::OnPostRender ),
+ TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
+
+ ECore::EcoreWlRenderSurface* renderSurface = dynamic_cast< ECore::EcoreWlRenderSurface* >( &surface );
+ if( renderSurface )
+ {
+ renderSurface->SetRenderNotification( renderNotification );
+ }
DALI_LOG_INFO( gPepperOutputLogging, Debug::Verbose, "Output::Initialize: success [width = %.2f height = %.2f]\n", mSize.width, mSize.height );
}
void Output::OnRepaint( void* data, const pepper_list_t* planeList )
{
- Output* output = static_cast< Output* >( data );
-
- DALI_LOG_INFO( gPepperOutputLogging, Debug::Verbose, "Output::OnRepaint\n" );
-
- output->mRepaintRequest = true;
-
- // TODO: temp
- if( !output->mRenderFinishTimer )
- {
- output->mRenderFinishTimer= Timer::New(1);
- output->mRenderFinishTimer.TickSignal().Connect( output, &Output::OnRenderFinishTimerTick );
- }
-
- output->mRenderFinishTimer.Start();
}
void Output::OnAttachSurface( void* data, pepper_surface_t* surface, int* width, int* height )
*height = 0;
}
- // TODO: temp
- struct timespec ts;
-
- pepper_compositor_get_time( static_cast< pepper_compositor_t* >( Pepper::GetImplementation( output->mCompositor ).GetCompositorHandle() ), &ts );
- pepper_output_finish_frame( output->mOutput, &ts );
+ output->mBufferAttached = true;
}
-void Output::OnFlushSurface( void* data, pepper_surface_t* surface, pepper_bool_t* keepBuffer )
+void Output::OnFlushSurfaceDamage( void* data, pepper_surface_t* surface, pepper_bool_t* keepBuffer )
{
}
}
}
-void Output::PostRenderComplete()
+void Output::OnPostRender()
{
- if( mRepaintRequest )
+ if( mBufferAttached )
{
struct timespec ts;
- DALI_LOG_INFO( gPepperOutputLogging, Debug::Verbose, "Output::PostRenderComplete" );
+ DALI_LOG_INFO( gPepperOutputLogging, Debug::Verbose, "Output::OnPostRender" );
pepper_compositor_get_time( static_cast< pepper_compositor_t* >( Pepper::GetImplementation( mCompositor ).GetCompositorHandle() ), &ts );
pepper_output_finish_frame( mOutput, &ts );
- mRepaintRequest = false;
+ mBufferAttached = false;
}
}
-void Output::PostRenderStarted()
-{
- // Do nothing
-}
-
-void Output::PostRenderWaitForCompletion()
-{
- // Do nothing
-}
-
-// TODO: temp
-bool Output::OnRenderFinishTimerTick()
-{
- struct timespec ts;
-
- DALI_LOG_INFO( gPepperOutputLogging, Debug::Verbose, "Output::OnRenderFinishTimerTick\n" );
-
- pepper_compositor_get_time( static_cast< pepper_compositor_t* >( Pepper::GetImplementation( mCompositor ).GetCompositorHandle() ), &ts );
- pepper_output_finish_frame( mOutput, &ts );
-
- return false;
-}
-
} // namespace Internal
} // namespace Pepper
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/signals/connection-tracker.h>
-#include <dali/integration-api/adaptors/thread-synchronization-interface.h>
#include <pepper-output-backend.h>
-// TODO: temp
-#include <dali/public-api/adaptor-framework/timer.h>
-
namespace Dali
{
class Output;
typedef IntrusivePtr<Output> OutputPtr;
-class Output : public BaseObject, public ConnectionTracker, public ThreadSynchronizationInterface
+class Output : public BaseObject, public ConnectionTracker
{
public:
static void OnStartRepaintLoop( void* data );
static void OnRepaint( void* data, const pepper_list_t* planeList );
static void OnAttachSurface( void* data, pepper_surface_t* surface, int* width, int* height );
- static void OnFlushSurface( void* data, pepper_surface_t* surface, pepper_bool_t* keepBuffer );
+ static void OnFlushSurfaceDamage( void* data, pepper_surface_t* surface, pepper_bool_t* keepBuffer );
public: //Signals
void OnObjectViewAdded( Pepper::Object object, Pepper::ObjectView objectView );
void OnObjectViewDeleted( Pepper::Object object, Pepper::ObjectView objectView );
-private: // From ThreadSynchronizationInterface
-
- /////////////////////////////////////////////////////////////////////////////////////////////////
- // Called by the Event Thread if post-rendering is required
- /////////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * @copydoc ThreadSynchronizationInterface::PostRenderComplete()
- */
- virtual void PostRenderComplete();
-
- /////////////////////////////////////////////////////////////////////////////////////////////////
- //// Called by the Render Thread if post-rendering is required
- /////////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * @copydoc ThreadSynchronizationInterface::PostRenderStarted()
- */
- virtual void PostRenderStarted();
-
/**
- * @copydoc ThreadSynchronizationInterface::PostRenderStarted()
+ * Callback function that is called when render thread is completed a frame
*/
- virtual void PostRenderWaitForCompletion();
-
- // TODO: temp
- bool OnRenderFinishTimerTick();
+ void OnPostRender();
private:
Pepper::Output::OutputSignalType mObjectViewAddedSignal;
Pepper::Output::OutputSignalType mObjectViewDeletedSignal;
- bool mRepaintRequest;
-
- // TODO: temp
- Timer mRenderFinishTimer;
+ bool mBufferAttached;
};
} // namespace Internal
mSurfaceCommitListener( NULL ),
mTitle(),
mAppId(),
- mSurfaceMapped( false ),
+ mNeedSurfaceMap( false ),
mAckConfigure( false ),
mConfigureCallback( NULL ),
mConfigureCallbackData( NULL ),
mSurfaceCommitListener = pepper_object_add_event_listener( reinterpret_cast< pepper_object_t* >( mSurface ), PEPPER_EVENT_SURFACE_COMMIT, 0, ShellClient::OnSurfaceCommit, this );
- mSurfaceMapped = false;
+ mNeedSurfaceMap = true;
pepper_surface_set_role( mSurface, "xdg_surface" );
return mAppId;
}
+void ShellClient::MapSurface()
+{
+ if( !mNeedSurfaceMap )
+ {
+ pepper_view_map( mView );
+ mNeedSurfaceMap = true;
+
+ DALI_LOG_INFO( gPepperShellClientLogging, Debug::Verbose, "ShellClient::MapSurface: view is mapped.\n" );
+ }
+}
+
+void ShellClient::UnmapSurface()
+{
+ if( mNeedSurfaceMap )
+ {
+ pepper_view_unmap( mView );
+ mNeedSurfaceMap = false;
+
+ DALI_LOG_INFO( gPepperShellClientLogging, Debug::Verbose, "ShellClient::UnmapSurface: view is unmapped.\n" );
+ }
+}
+
void ShellClient::SurfaceResourceDestroy( struct wl_resource* resource )
{
ShellClient* shellClient = static_cast< ShellClient* >( wl_resource_get_user_data( resource ) );
{
ShellClient* shellClient = static_cast< ShellClient* >( data );
- if( !shellClient->mSurfaceMapped )
+ if( shellClient->mNeedSurfaceMap && !pepper_view_is_mapped( shellClient->mView ) )
{
pepper_view_map( shellClient->mView );
- shellClient->mSurfaceMapped = true;
+ DALI_LOG_INFO( gPepperShellClientLogging, Debug::Verbose, "ShellClient::OnSurfaceCommit: view is mapped.\n" );
}
}
void SetAppId( const std::string& appId );
const std::string& GetAppId() const;
+ void MapSurface();
+ void UnmapSurface();
+
private:
/**
std::string mTitle;
std::string mAppId;
- bool mSurfaceMapped;
+ bool mNeedSurfaceMap;
bool mAckConfigure;
ConfigureCallback mConfigureCallback;
return Dali::Pepper::GetImplementation( *this ).CancelTouchEvent();
}
+void ObjectView::Show()
+{
+ Dali::Pepper::GetImplementation( *this ).Show();
+}
+
+void ObjectView::Hide()
+{
+ Dali::Pepper::GetImplementation( *this ).Hide();
+}
+
ObjectView::ObjectView( Internal::ObjectView& implementation )
: Control( implementation )
{
*/
bool CancelTouchEvent();
+ /**
+ * @brief Shows the ObjectView
+ *
+ * @since_tizen 3.0
+ */
+ void Show();
+
+ /**
+ * @brief Hides the ObjectView
+ *
+ * @since_tizen 3.0
+ */
+ void Hide();
+
public: // Not intended for application developers
/**