BuildRequires: pkgconfig(osp-uifw)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(appsvc)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(ail)
BuildRequires: pkgconfig(provider)
BuildRequires: pkgconfig(livebox-viewer)
BuildRequires: pkgconfig(livebox-service)
TARGET_LINK_LIBRARIES(${this_target} "-levas" )
TARGET_LINK_LIBRARIES(${this_target} "-leina" )
TARGET_LINK_LIBRARIES(${this_target} "-lecore_evas" )
+TARGET_LINK_LIBRARIES(${this_target} "-lelementary" )
TARGET_LINK_LIBRARIES(${this_target} "-lminicontrol-provider" )
#TARGET_LINK_LIBRARIES(${this_target} "-lcapi-system-runtime-info")
TARGET_LINK_LIBRARIES(${this_target} "-lX11" )
TARGET_LINK_LIBRARIES(${this_target} "-llivebox-service" )
TARGET_LINK_LIBRARIES(${this_target} "-lprovider" )
TARGET_LINK_LIBRARIES(${this_target} "-lshortcut" )
-TARGET_LINK_LIBRARIES(${this_target} "-lail" )
SET_TARGET_PROPERTIES(${this_target}
PROPERTIES
*/
#include <new>
+#include <Ecore_X.h>
#include <livebox.h>
#include <FBaseSysLog.h>
#include <FBaseString.h>
#include "FShell_LiveboxView.h"
#include "FShell_ILiveboxPopupViewEventListener.h"
#include "FUi_ControlManager.h"
+#include "FUiAnim_EflNode.h"
#include "FUiAnim_VisualElement.h"
+#include "FUiAnim_VisualElementImpl.h"\r
+#include "FUiAnim_VisualElementSurfaceImpl.h"
using namespace std;
using namespace Tizen::Base;
, __pLiveboxView(&liveBoxView)
, __pLiveboxPopupViewEvent(_LiveboxPopupViewEvent::CreateInstanceN(*this))
, __firstUpdated(false)
+ , __pixmap(-1)
{
}
{
if (__firstUpdated)
{
+ if (__pPixmapObject)
+ {
+ _VisualElement* pVisualElement = GetVisualElement();
+ SysTryReturn(NID_UI_CTRL, pVisualElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ _EflNode* pEflNode = dynamic_cast<_EflNode*>(pVisualElement->GetNativeNode());
+ SysTryReturn(NID_UI_CTRL, pEflNode, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ Evas_Object* pSmartObject = (Evas_Object*)pEflNode->GetGroupContainer();
+ SysTryReturn(NID_UI_CTRL, pSmartObject, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ Evas* pEvas = evas_object_evas_get(pSmartObject);
+ SysTryReturn(NID_UI_CTRL, pEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ pEflNode->AddNativeSmartObject(*pVisualElement, __pPixmapObject.get());
+
+ }
+
PlayAnimation(true);
}
}
void
+_LiveboxPopupView::OnLiveboxUpdated(int pixmap)
+{
+ int x = 0;\r
+ int y = 0;\r
+ int width = 0;\r
+ int height = 0;\r
+\r
+ ecore_x_pixmap_geometry_get(pixmap, &x, &y, &width, &height);
+
+ if (__pixmap != pixmap )
+ {
+ SetBackgroundColor(Color(0, 0, 0, 0));
+
+ _VisualElement* pVisualElement = GetVisualElement();
+ SysTryReturnVoidResult(NID_UI_CTRL, pVisualElement, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ _EflNode* pEflNode = dynamic_cast<_EflNode*>(pVisualElement->GetNativeNode());
+ SysTryReturnVoidResult(NID_UI_CTRL, pEflNode, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ Evas_Object* pSmartObject = (Evas_Object*)pEflNode->GetGroupContainer();
+ SysTryReturnVoidResult(NID_UI_CTRL, pSmartObject, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ Evas* pEvas = evas_object_evas_get(pSmartObject);
+ SysTryReturnVoidResult(NID_UI_CTRL, pEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ __pPixmapObject.reset(evas_object_image_filled_add(pEvas));
+ SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapObject.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ pEflNode->AddNativeSmartObject(*pVisualElement, __pPixmapObject.get());
+
+ evas_object_image_size_set(__pPixmapObject.get(), width, height);
+ evas_object_image_colorspace_set(__pPixmapObject.get(), EVAS_COLORSPACE_ARGB8888);\r
+ evas_object_image_alpha_set(__pPixmapObject.get(), EINA_TRUE);\r
+\r
+ Rectangle absoluteBounds = GetAbsoluteBounds();\r
+\r
+ evas_object_move(__pPixmapObject.get(), absoluteBounds.x, absoluteBounds.y);
+ evas_object_show(__pPixmapObject.get());
+
+ Evas_Native_Surface surface;
+
+ surface.version = EVAS_NATIVE_SURFACE_VERSION;
+ surface.type = EVAS_NATIVE_SURFACE_X11;
+ surface.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
+ surface.data.x11.pixmap = pixmap;
+
+ evas_object_image_native_surface_set(__pPixmapObject.get(), &surface);
+
+ SysLog(NID_UI_CTRL, "[0x%x]", surface.data.x11.pixmap);
+ }
+
+ SysLog(NID_UI_CTRL, "[%d %d %d %d]", x, y, width, height);
+
+ evas_object_image_size_set(__pPixmapObject.get(), width, height);
+ evas_object_image_pixels_dirty_set(__pPixmapObject.get(), EINA_TRUE);
+ evas_object_image_fill_set(__pPixmapObject.get(), 0, 0, width, height);
+ evas_object_image_data_update_add(__pPixmapObject.get(), 0, 0, width, height);
+ evas_object_resize(__pPixmapObject.get(), width, height);
+
+ Dimension size(width, height);
+ if (size != GetSize())
+ {
+ SetPopupBounds(size);
+ }
+
+ if (!__firstUpdated)
+ {
+ PlayAnimation(true);
+ __firstUpdated = true;
+ }
+
+ __pixmap = pixmap;
+}
+
+void
_LiveboxPopupView::OnLiveboxPopupCreated(struct livebox *pLivebox, int ret, void* pData)
{
SysTryReturnVoidResult(NID_UI_CTRL, pLivebox, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
#define _FSHELL_INTERNAL_LIVEBOX_POPUP_VIEW_H_
#include <unique_ptr.h>
+#include <Evas.h>
#include <FUiAnimIVisualElementAnimationStatusEventListener.h>
#include "FUi_Window.h"
virtual void OnDraw(void);
void OnLiveboxUpdated(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Dimension& size);
+ void OnLiveboxUpdated(int pixmap);
static void OnLiveboxPopupCreated(struct livebox *pLivebox, int ret, void* pData);
static void OnLiveboxPopupDestroyed(struct livebox *pLivebox, int ret, void* pData);
_LiveboxView* __pLiveboxView;
std::unique_ptr<_LiveboxPopupViewEvent> __pLiveboxPopupViewEvent;
bool __firstUpdated;
+
+ struct _EvasObjectDeleter
+ {
+ void operator()(Evas_Object* pEvasObject)
+ {
+ evas_object_del(pEvasObject);
+ }
+ };
+
+ std::unique_ptr<Evas_Object, _EvasObjectDeleter> __pPixmapObject;
+ int __pixmap;
}; // _LiveboxPopupView
}} // Tizen::Shell
*/
#include <new>
-#include <ail.h>
+#include <Ecore_X.h>
#include <livebox.h>
#include <FBaseSysLog.h>
#include <FBaseString.h>
#include "FShell_LiveboxViewPresenter.h"
#include "FShell_LiveboxPopupView.h"
#include "FShell_LiveboxViewManager.h"
-#include "FUiAnim_VisualElement.h"
+#include "FUiAnim_EflNode.h"
+#include "FUiAnim_VisualElementImpl.h"\r
+#include "FUiAnim_VisualElementSurfaceImpl.h"\r
using namespace std;
using namespace Tizen::App;
, __pLiveboxViewManager(null)
, __resizeFromRemote(false)
, __updated(false)
+ , __pixmap(-1)
{
__pLiveboxViewManager = _LiveboxViewManager::GetInstance();
SysTryReturnVoidResult(NID_UI_CTRL, __pLiveboxViewManager, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
Invalidate(false);
}
+void
+_LiveboxView::OnLiveboxUpdated(int pixmap)
+{
+ int x = 0;\r
+ int y = 0;\r
+ int width = 0;\r
+ int height = 0;\r
+\r
+ ecore_x_pixmap_geometry_get(pixmap, &x, &y, &width, &height);
+
+ if (__pixmap != pixmap )
+ {
+ SetBackgroundColor(Color(0, 0, 0, 0));
+
+ _VisualElement* pVisualElement = GetVisualElement();
+ SysTryReturnVoidResult(NID_UI_CTRL, pVisualElement, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ _EflNode* pEflNode = dynamic_cast<_EflNode*>(pVisualElement->GetNativeNode());
+ SysTryReturnVoidResult(NID_UI_CTRL, pEflNode, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ Evas_Object* pSmartObject = (Evas_Object*)pEflNode->GetGroupContainer();
+ SysTryReturnVoidResult(NID_UI_CTRL, pSmartObject, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ Evas* pEvas = evas_object_evas_get(pSmartObject);
+ SysTryReturnVoidResult(NID_UI_CTRL, pEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ __pPixmapObject.reset(evas_object_image_filled_add(pEvas));
+ SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapObject.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ pEflNode->AddNativeSmartObject(*pVisualElement, __pPixmapObject.get());
+
+ evas_object_image_size_set(__pPixmapObject.get(), width, height);
+ evas_object_image_colorspace_set(__pPixmapObject.get(), EVAS_COLORSPACE_ARGB8888);\r
+ evas_object_image_alpha_set(__pPixmapObject.get(), EINA_TRUE);\r
+\r
+ Rectangle absoluteBounds = GetAbsoluteBounds();\r
+\r
+ evas_object_move(__pPixmapObject.get(), absoluteBounds.x, absoluteBounds.y);
+ evas_object_show(__pPixmapObject.get());
+
+ Evas_Native_Surface surface;
+
+ surface.version = EVAS_NATIVE_SURFACE_VERSION;
+ surface.type = EVAS_NATIVE_SURFACE_X11;
+ surface.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
+ surface.data.x11.pixmap = pixmap;
+
+ evas_object_image_native_surface_set(__pPixmapObject.get(), &surface);
+
+ SysLog(NID_UI_CTRL, "[0x%x]", surface.data.x11.pixmap);
+ }
+
+ SysLog(NID_UI_CTRL, "[%d %d %d %d]", x, y, width, height);
+
+ evas_object_image_size_set(__pPixmapObject.get(), width, height);
+ evas_object_image_pixels_dirty_set(__pPixmapObject.get(), EINA_TRUE);
+ evas_object_image_fill_set(__pPixmapObject.get(), 0, 0, width, height);
+ evas_object_image_data_update_add(__pPixmapObject.get(), 0, 0, width, height);
+ evas_object_resize(__pPixmapObject.get(), width, height);
+
+ __resizeFromRemote = true;
+ SetSize(Dimension(width, height));
+ __resizeFromRemote = false;
+ __updated = true;
+
+ __pixmap = pixmap;
+}
+
}} // Tizen::Shell
#define _FSHELL_INTERNAL_LIVEBOX_VIEW_H_
#include <unique_ptr.h>
+#include <Evas.h>
#include "FUi_Control.h"
#include "FUi_ITouchFlickGestureEventListener.h"
+#include "FUiAnim_VisualElement.h"
#include "FShell_ILiveboxPopupViewEventListener.h"
namespace Tizen { namespace Base
virtual void OnDraw(void);
void OnLiveboxUpdated(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Dimension& size);
+ void OnLiveboxUpdated(int pixmap);
private:
std::unique_ptr<_LiveboxViewPresenter> __pLiveboxViewPresenter;
std::unique_ptr<Tizen::Ui::_TouchFlickGestureDetector> __pTouchFlickGestureDetector;
bool __resizeFromRemote;
bool __updated;
+
+ struct _EvasObjectDeleter
+ {
+ void operator()(Evas_Object* pEvasObject)
+ {
+ evas_object_del(pEvasObject);
+ }
+ };
+
+ std::unique_ptr<Evas_Object, _EvasObjectDeleter> __pPixmapObject;
+
+ int __pixmap;
}; // _LiveboxView
}} // Tizen::Shell
#include <new>
#include <Ecore_X.h>
+#include <Evas.h>
+extern "C"
+{
+#include <elm_config.h>
+}
#include <livebox-service.h>
#include <livebox.h>
#include <FBaseColHashMapT.h>
int type = livebox_size(pLivebox);
livebox_service_get_size(type, &width, &height);
+ SysLog(NID_UI_CTRL, "size [%d %d]", width, height);
+
return Dimension(width, height);
}
livebox_get_pdsize(pLivebox, &width, &height);
+ SysLog(NID_UI_CTRL, "size [%d %d]", width, height);
+
return Dimension(width, height);
}
}
_LiveboxViewManager::_LiveboxViewManager(void)
+ : __glMode(false)
{
// _LogicalResolution sourceResolution = RESOLUTION_LOGICAL_720;
// _PhysicalResolution destResolution = _CoordinateSystem::GetInstance()->GetPhysicalResolution();
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
__pViewMap = move(pViewMap);
+ __glMode = IsGlMode();
// r = _CreateCoordinateTransformer(__pCoordinateTransformer, sourceResolution, BASE_SCREEN_SIZE_NORMAL, destResolution, BASE_SCREEN_SIZE_NORMAL);
// SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
return pBitmap.release();
}
+bool
+_LiveboxViewManager::IsGlMode(void) const
+{
+ int mode = 0;
+ bool glMode = false;
+ String preferred(elm_config_preferred_engine_get());
+ if(preferred == L"opengl_x11")
+ {
+ glMode = true;
+ mode = 1;
+ }
+ else if(preferred == L"software_x11")
+ {
+ glMode = false;
+ mode = 2;
+ }
+ else
+ {
+ String engineConfig(elm_config_engine_get());
+ if(engineConfig == L"opengl_x11")
+ {
+ glMode = true;
+ mode = 3;
+ }
+ }
+
+ SysLog(NID_UI_CTRL, "[%d %d]", mode, glMode);
+
+ return glMode;
+}
+
void
_LiveboxViewManager::OnLiveboxCreated(livebox* pLivebox)
{
break;
case LB_TYPE_BUFFER:
- case LB_TYPE_PIXMAP:
{
void* pBuffer = livebox_acquire_fb(pLivebox);
SysTryReturnVoidResult(NID_UI_CTRL, pBuffer, E_SYSTEM, "[E_SYSTEM] A system error occured.");
Dimension sourceSize = GetLiveboxSize(pLivebox);
+ SysLog(NID_UI_CTRL, "size [%d %d]", sourceSize.width, sourceSize.height);
+
unique_ptr<Bitmap> pBitmap(GetBitmapN(pBuffer, sourceSize));
SysTryReturnVoidResult(NID_UI_CTRL, pBitmap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
}
break;
- case LB_TYPE_TEXT:
+ case LB_TYPE_PIXMAP:
+ if (__glMode)
+ {
+ pLiveboxView->OnLiveboxUpdated(livebox_lb_pixmap(pLivebox));
+ }
+ else
+ {
+ void* pBuffer = livebox_acquire_fb(pLivebox);
+ SysTryReturnVoidResult(NID_UI_CTRL, pBuffer, E_SYSTEM, "[E_SYSTEM] A system error occured.");
+
+ Dimension sourceSize = GetLiveboxSize(pLivebox);
+ SysLog(NID_UI_CTRL, "size [%d %d]", sourceSize.width, sourceSize.height);
+
+ unique_ptr<Bitmap> pBitmap(GetBitmapN(pBuffer, sourceSize));
+ SysTryReturnVoidResult(NID_UI_CTRL, pBitmap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ pLiveboxView->OnLiveboxUpdated(*pBitmap.get(), sourceSize);
+ livebox_release_fb(pBuffer);
+ pBitmap.release();
+ }
break;
default:
switch (type)
{
- case PD_TYPE_TEXT:
+ case PD_TYPE_BUFFER:
+ {
+ void* pBuffer = livebox_acquire_pdfb(pLivebox);
+ SysTryReturnVoidResult(NID_UI_CTRL, pBuffer, E_SYSTEM, "[E_SYSTEM] A system error occured.");
+
+ Dimension sourceSize = GetLiveboxPopupSize(pLivebox);
+
+ unique_ptr<Bitmap> pBitmap(GetBitmapN(pBuffer, sourceSize));
+ SysTryReturnVoidResult(NID_UI_CTRL, pBitmap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ pLiveboxPopupView->OnLiveboxUpdated(*pBitmap.get(), sourceSize);
+ livebox_release_pdfb(pBuffer);
+ pBitmap.release();
+ }
break;
- case PD_TYPE_BUFFER:
case PD_TYPE_PIXMAP:
+ if (__glMode)
+ {
+ pLiveboxPopupView->OnLiveboxUpdated(livebox_pd_pixmap(pLivebox));
+ }
+ else
{
void* pBuffer = livebox_acquire_pdfb(pLivebox);
SysTryReturnVoidResult(NID_UI_CTRL, pBuffer, E_SYSTEM, "[E_SYSTEM] A system error occured.");
Dimension sourceSize = GetLiveboxPopupSize(pLivebox);
+
unique_ptr<Bitmap> pBitmap(GetBitmapN(pBuffer, sourceSize));
SysTryReturnVoidResult(NID_UI_CTRL, pBitmap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
pLiveboxPopupView->OnLiveboxUpdated(*pBitmap.get(), sourceSize);
livebox_release_pdfb(pBuffer);
- pBitmap.release();
+ pBitmap.release();
}
break;
Tizen::Media::MediaPixelFormat GetPixelFormat(Tizen::Graphics::BitmapPixelFormat format) const;
Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& fileName) const;
Tizen::Graphics::Bitmap* GetBitmapN(void* pBuffer, const Tizen::Graphics::Dimension& size) const;
+ bool IsGlMode(void) const;
void OnLiveboxCreated(livebox* pLivebox);
void OnLiveboxUpdated(livebox* pLivebox);
std::unique_ptr<Tizen::Graphics::_ICoordinateSystemTransformer> __pCoordinateTransformer;
std::unique_ptr<int, _EventHandlerDeleter> __eventHandler;
std::unique_ptr<int, _FaultEventHandlerDeleter> __faultEventHandler;
+ bool __glMode;
};
}} // Tizen::Shell