+BaseHandle Create()
+{
+ return Dali::BaseHandle();
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Dali::WidgetView::WidgetView, Toolkit::Control, Create );
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "widgetId", BOOLEAN, WIDGET_ID )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "instanceId", BOOLEAN, INSTANCE_ID )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "contentInfo", BOOLEAN, CONTENT_INFO )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "title", BOOLEAN, TITLE )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "updatePeriod", BOOLEAN, UPDATE_PERIOD )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "preview", MAP, PREVIEW )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "loadingText", MAP, LOADING_TEXT )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "widgetStateFaulted", BOOLEAN, WIDGET_STATE_FAULTED )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "permanentDelete", BOOLEAN, PERMANENT_DELETE )
+
+// Signals
+DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetAdded", SIGNAL_WIDGET_ADDED )
+DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetDeleted", SIGNAL_WIDGET_DELETED )
+DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetCreationAborted", SIGNAL_WIDGET_CREATION_ABORTED )
+DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetContentUpdated", SIGNAL_WIDGET_CONTENT_UPDATED )
+DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetUpdatePeriodChanged", SIGNAL_WIDGET_UPDATE_PERIOD_CHANGED )
+DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetFaulted", SIGNAL_WIDGET_FAULTED )
+
+// Actions
+DALI_ACTION_REGISTRATION( Dali::WidgetView, WidgetView, "pauseWidget", ACTION_WIDGETVIEW_PAUSE_WIDGET );
+DALI_ACTION_REGISTRATION( Dali::WidgetView, WidgetView, "resumeWidget", ACTION_WIDGETVIEW_RESUME_WIDGET );
+DALI_ACTION_REGISTRATION( Dali::WidgetView, WidgetView, "cancelTouchEvent", ACTION_WIDGETVIEW_CANCEL_TOUCH_EVENT );
+DALI_ACTION_REGISTRATION( Dali::WidgetView, WidgetView, "activateFaultedWidget", ACTION_WIDGETVIEW_ACTIVATE_FAULTED_WIDGET );
+
+DALI_TYPE_REGISTRATION_END()
+
+static Eina_Bool OnKeyDown( void* data, int type, void* eventInfo )
+{
+ Ecore_Event_Key *event = static_cast< Ecore_Event_Key* >( eventInfo );
+ tizen_remote_surface* surface = static_cast< tizen_remote_surface* >( data );
+
+ tizen_remote_surface_transfer_key_event( surface,
+ TIZEN_REMOTE_SURFACE_EVENT_TYPE_KEY_DOWN,
+ event->keycode,
+ ecore_device_class_get(event->dev),
+ ecore_device_subclass_get(event->dev),
+ ecore_device_identifier_get(event->dev),
+ event->timestamp
+ );
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool OnKeyUp(void* data, int type, void* eventInfo)
+{
+ Ecore_Event_Key *event = static_cast< Ecore_Event_Key* >( eventInfo );
+ tizen_remote_surface* surface = static_cast< tizen_remote_surface* >( data );
+
+ tizen_remote_surface_transfer_key_event( surface,
+ TIZEN_REMOTE_SURFACE_EVENT_TYPE_KEY_UP,
+ event->keycode,
+ ecore_device_class_get(event->dev),
+ ecore_device_subclass_get(event->dev),
+ ecore_device_identifier_get(event->dev),
+ event->timestamp
+ );
+ return EINA_TRUE;
+}
+
+static void OnSurfaceUpdate( struct tizen_remote_surface* surface, wl_buffer* buffer, uint32_t time, void* data )
+{
+ Dali::WidgetView::Internal::WidgetView* widgetView = static_cast< Dali::WidgetView::Internal::WidgetView* >( data );
+
+ if( widgetView )
+ {
+ if( !widgetView->IsWidgetImageView() )
+ {
+ tizen_remote_surface_transfer_visibility( surface, TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE);
+
+ widgetView->CreateWidgetImageView();
+ widgetView->ConnectSignal( surface );
+ ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, OnKeyDown, surface );
+ ecore_event_handler_add( ECORE_EVENT_KEY_UP, OnKeyUp, surface );
+ }
+
+ //get tbm surface from buffer
+ tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) );
+ widgetView->UpdateImageSource( tbmSurface );
+ }
+}
+
+static void OnSurfaceMissing( struct tizen_remote_surface* surface, void* data )
+{
+ //ToDo: WidgetDeletedSignal
+}
+
+
+static struct aul_rsm_handler_s remoteSurfaceHandler = {
+ OnSurfaceUpdate,
+ OnSurfaceMissing,
+};
+