SetSystemWindow(true);
+ __liveboxSize = size;
+
#if defined(MULTI_WINDOW)
r = CreateRootVisualElement();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
#else // MULTI_WINDOW
- unique_ptr<_LiveboxLayer> pLayer(new (std::nothrow) _LiveboxLayer(*this));\r
+ unique_ptr<_LiveboxLayer> pLayer(new (std::nothrow) _LiveboxLayer(__liveboxSize));
SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
\r
pLayer->Construct();\r
result
_LiveboxFrame::CreateLayer(void)
{
- unique_ptr<_LiveboxLayer> pLayer(new (std::nothrow) _LiveboxLayer(*this));
+ unique_ptr<_LiveboxLayer> pLayer(new (std::nothrow) _LiveboxLayer(__liveboxSize));
SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
result r = pLayer->Construct();
#endif // !MULTI_WINDOW
Tizen::Ui::Animations::_RootVisualElement* __pLiveboxFrameRootVisualElement;
Tizen::Ui::_IUiEventManager* __pEventManager;
+ Tizen::Graphics::Dimension __liveboxSize;
}; // _LiveboxFrame
}} // Tizen::Shell
using namespace Tizen::Ui;
using namespace Tizen::Shell;
-namespace {
+namespace
+{
void*
AllocRenderBuffer(void* pData, int size)
namespace Tizen { namespace Shell
{
-_LiveboxLayer::_LiveboxLayer(const _Window& window)
+_LiveboxLayer::_LiveboxLayer(const Dimension& size)
: __isReleased(false)
+ , __size(size)
, __pEcoreEvas(null)
, __pEvasObject(null)
- , __pWindow(&window)
, __providerId(L"")
, __pRenderBuffer(null)
, __bufferSize(0)
_LiveboxLayer::~_LiveboxLayer(void)
{
- __pWindow = null;
__pRenderBuffer = null;
__pixmapId = -1;
}
{
result r = E_SUCCESS;
- Rectangle bounds = __pWindow->GetBounds();
-
- unique_ptr<Ecore_Evas, _EcoreEvasDeleter> pEcoreEvas(ecore_evas_buffer_allocfunc_new(bounds.width, bounds.height, AllocRenderBuffer, FreeRenderBuffer, this));
+ unique_ptr<Ecore_Evas, _EcoreEvasDeleter> pEcoreEvas(ecore_evas_buffer_allocfunc_new(__size.width, __size.height, AllocRenderBuffer, FreeRenderBuffer, this));
SysTryReturn(NID_UI_CTRL, pEcoreEvas, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
ecore_evas_alpha_set(pEcoreEvas.get(), EINA_TRUE);
ecore_evas_manual_render_set(pEcoreEvas.get(), EINA_FALSE);
- ecore_evas_resize(pEcoreEvas.get(), bounds.width, bounds.height);
+ ecore_evas_resize(pEcoreEvas.get(), __size.width, __size.height);
ecore_evas_activate(pEcoreEvas.get());
Evas* pEvas = ecore_evas_get(pEcoreEvas.get());
unique_ptr<Evas_Object, _EvasObjectDeleter> pEvasObject(evas_object_rectangle_add(pEvas));
SysTryReturn(NID_UI_CTRL, pEvasObject, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
- evas_object_resize(pEvasObject.get(), bounds.width, bounds.height);
+ evas_object_resize(pEvasObject.get(), __size.width, __size.height);
evas_object_color_set(pEvasObject.get(), 0, 0, 0, 255);
r = Initialize(pEvasObject.get());
return r;
}
-const Tizen::Ui::_Window*
-_LiveboxLayer::GetWindow(void) const
-{
- return __pWindow;
-}
-
result
_LiveboxLayer::SetProviderId(const String& providerId)
{
void
_LiveboxLayer::SetLayerBounds(const Rectangle& bounds)
{
- ecore_evas_resize(__pEcoreEvas.get(), bounds.width, bounds.height);
+ __size = Dimension(bounds.width, bounds.height);
+
+ ecore_evas_resize(__pEcoreEvas.get(), __size.width, __size.height);
FloatRectangle fBounds(static_cast<float>(bounds.x), static_cast<float>(bounds.y), static_cast<float>(bounds.width), static_cast<float>(bounds.height));
SetBounds(fBounds);
}
result
-_LiveboxLayer::SyncPixmap(const Tizen::Graphics::Rectangle& bounds)
+_LiveboxLayer::SyncPixmap(const Dimension& size)
{
SysTryReturn(NID_UI_CTRL, __pRenderBuffer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
Screen* pScreen = null;
Visual* pVisual = null;
- /*const int bitsPerPixel = 32;
- int __bufferSize = bounds.width * bounds.height * bitsPerPixel / 8;*/
-
xShmSegmentInfo.shmid = shmget(IPC_PRIVATE, __bufferSize, IPC_CREAT | 0666);
SysTryReturn(NID_UI_CTRL, xShmSegmentInfo.shmid >= 0, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
SysTryCatch(NID_UI_CTRL, pVisual, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
// XCreatePixmap can only uses 24 bits depth only.
- pXImage = XShmCreateImage(pDisplay, pVisual, 24, ZPixmap, null, &xShmSegmentInfo, bounds.width, bounds.height);
+ pXImage = XShmCreateImage(pDisplay, pVisual, 24, ZPixmap, null, &xShmSegmentInfo, size.width, size.height);
SysTryCatch(NID_UI_CTRL, pXImage, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
pXImage->data = xShmSegmentInfo.shmaddr;
memcpy(pXImage->data, __pRenderBuffer, __bufferSize);
// Do not send the event. Instead of X event, master will send the updated event to the viewer
- XShmPutImage(pDisplay, static_cast<Pixmap>(__pixmapId), gc, pXImage, 0, 0, 0, 0, bounds.width, bounds.height, False);
+ XShmPutImage(pDisplay, static_cast<Pixmap>(__pixmapId), gc, pXImage, 0, 0, 0, 0, size.width, size.height, False);
XSync(pDisplay, False);
XFreeGC(pDisplay, gc);
void
_LiveboxLayer::OnRendered(void)
{
- Rectangle bounds = __pWindow->GetBounds();
-
if (__pixmapId == -1)
{
__pixmapId = AcquirePixmap();
SysTryReturnVoidResult(NID_UI_CTRL, __pixmapId >= 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
}
- result r = SyncPixmap(bounds);
+ result r = SyncPixmap(__size);
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- r = Sync(bounds);
+ r = Sync(__size);
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
int pixmapId = -1;
- const _Window* pWindow = GetWindow();
- SysTryReturn(NID_UI_CTRL, pWindow, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
-
- Rectangle bounds = pWindow->GetBounds();
-
- result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSharedMemoryId(__providerId, bounds.width, bounds.height, pixmapId);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSharedMemoryId(__providerId, __size.width, __size.height, pixmapId);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
- SysLog(NID_UI_CTRL, "pixmapId(%d) bounds(%d %d %d %d)", pixmapId, bounds.x, bounds.y, bounds.width, bounds.height);
+ SysLog(NID_UI_CTRL, "pixmapId(%d) size(%d %d)", pixmapId, __size.width, __size.height);
return pixmapId;
}
result
-_LiveboxLayer::Sync(const Tizen::Graphics::Rectangle& bounds)
+_LiveboxLayer::Sync(const Dimension& size)
{
SysTryReturn(NID_UI_CTRL, !__providerId.IsEmpty(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSyncSharedMemory(__providerId, bounds.width, bounds.height);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSyncSharedMemory(__providerId, size.width, size.height);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
int
_LiveboxLayer::OnTouchEventRecevied(int eventType, double timestamp, double x, double y)
{
- Rectangle bounds = __pWindow->GetBounds();
-
- int xPos = bounds.width * x;
- int yPos = bounds.height * y;
+ int xPos = __size.width * x;
+ int yPos = __size.height * y;
Evas* pEvas = ecore_evas_get(__pEcoreEvas.get());
SysTryReturn(NID_UI_CTRL, pEvas, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
, public Tizen::Shell::_ILiveboxTouchEventListener
{
public:
- _LiveboxLayer(const Tizen::Ui::_Window& window);
+ _LiveboxLayer(const Tizen::Graphics::Dimension& size);
virtual ~_LiveboxLayer(void);
virtual result OnConstructed(void);
- const Tizen::Ui::_Window* GetWindow(void) const;
result SetProviderId(const Tizen::Base::String& providerId);
Tizen::Base::String GetProviderId(void) const;
int GetPixmapId(void) const;
void* AllocCanvas(int size);
void FreeCanvas(void* pCanvas);
int EventHandler(int eventType, double timestamp, double x, double y);
- result SyncPixmap(const Tizen::Graphics::Rectangle& bounds);
+ result SyncPixmap(const Tizen::Graphics::Dimension& size);
void OnRendered(void);
virtual result RegisterTouchEventListener(void);
virtual int AcquirePixmap(void);
- virtual result Sync(const Tizen::Graphics::Rectangle& bounds);
+ virtual result Sync(const Tizen::Graphics::Dimension& size);
virtual void ReleasePixmap(void);
virtual int OnTouchEventRecevied(int eventType, double timestamp, double x, double y);
protected:
bool __isReleased;
+ Tizen::Graphics::Dimension __size;
private:
struct _EcoreEvasDeleter
std::unique_ptr<Ecore_Evas, _EcoreEvasDeleter> __pEcoreEvas;
std::unique_ptr<Evas_Object, _EvasObjectDeleter> __pEvasObject;
- const Tizen::Ui::_Window* __pWindow;
Tizen::Base::String __providerId;
void* __pRenderBuffer;
int __bufferSize;
: public _LiveboxLayer
{
public:
- _LiveboxPopupLayer(const _Window& window);
+ _LiveboxPopupLayer(const Dimension& size);
virtual ~_LiveboxPopupLayer(void);
private:
virtual result RegisterTouchEventListener(void);
virtual int AcquirePixmap(void);
- virtual result Sync(const Tizen::Graphics::Rectangle& bounds);
+ virtual result Sync(const Dimension& size);
virtual void ReleasePixmap(void);
};
-_LiveboxPopupLayer::_LiveboxPopupLayer(const _Window& window)
- : _LiveboxLayer(window)
+_LiveboxPopupLayer::_LiveboxPopupLayer(const Dimension& size)
+ : _LiveboxLayer(size)
{
}
int pixmapId = -1;
- const _Window* pWindow = GetWindow();
- SysTryReturn(NID_UI_CTRL, pWindow, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
-
- Rectangle bounds = pWindow->GetBounds();
-
- result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSharedMemoryIdForPD(GetProviderId(), bounds.width, bounds.height, pixmapId);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSharedMemoryIdForPD(GetProviderId(), __size.width, __size.height, pixmapId);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
SystemTime::GetTicks(ticks);
SysLog(NID_UI_CTRL, "%lld", ticks);
- SysLog(NID_UI_CTRL, "pixmapId(%d) bounds(%d %d %d %d)", pixmapId, bounds.x, bounds.y, bounds.width, bounds.height);
+ SysLog(NID_UI_CTRL, "pixmapId(%d) size(%d %d)", pixmapId, __size.width, __size.height);
return pixmapId;
}
result
-_LiveboxPopupLayer::Sync(const Tizen::Graphics::Rectangle& bounds)
+_LiveboxPopupLayer::Sync(const Dimension& size)
{
result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSyncSharedMemoryForPD(GetProviderId());
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
result
-_LiveboxPopup::Initialize(const Tizen::Graphics::Dimension& size)
+_LiveboxPopup::Initialize(const Dimension& size)
{
long long ticks = 0;
SystemTime::GetTicks(ticks);
result r = E_SUCCESS;
+ __liveboxSize = size;
+
SetSystemWindow(true);
#if defined(MULTI_WINDOW)
r = CreateRootVisualElement();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
#else // MULTI_WINDOW
- unique_ptr<_LiveboxPopupLayer> pLayer(new (std::nothrow) _LiveboxPopupLayer(*this));\r
+ unique_ptr<_LiveboxPopupLayer> pLayer(new (std::nothrow) _LiveboxPopupLayer(__liveboxSize));
SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
\r
r = pLayer->Construct();\r
result
_LiveboxPopup::CreateLayer(void)
{
- unique_ptr<_LiveboxPopupLayer> pLayer(new (std::nothrow) _LiveboxPopupLayer(*this));
+ unique_ptr<_LiveboxPopupLayer> pLayer(new (std::nothrow) _LiveboxPopupLayer(__liveboxSize));
SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
result r = pLayer->Construct();
#endif // !MULTI_WINDOW
Tizen::Ui::Animations::_RootVisualElement* __pLiveboxPopupRootVisualElement;
Tizen::Ui::_IUiEventManager* __pEventManager;
+ Tizen::Graphics::Dimension __liveboxSize;
}; // _LiveboxPopup
}} // Tizen::Shell
evas_object_image_native_surface_set(__pPixmapObject.get(), &surface);
- __pixmapDamage.reset(ecore_x_damage_new(pixmap, ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES));
+ /*__pixmapDamage.reset(ecore_x_damage_new(pixmap, ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES));
SysTryReturnVoidResult(NID_UI_CTRL, __pixmapDamage.get() != 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
__pPixmapEventHandler.reset(ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, OnPixmapDamaged, (void*)this));
- SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapEventHandler, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+ SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapEventHandler, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");*/
SysLog(NID_UI_CTRL, "[0x%x]", surface.data.x11.pixmap);
}
surface.data.x11.pixmap = pixmap;
evas_object_image_native_surface_set(__pPixmapObject.get(), &surface);
-
+/*
__pixmapDamage.reset(ecore_x_damage_new(pixmap, ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES));
SysTryReturnVoidResult(NID_UI_CTRL, __pixmapDamage.get() != 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
__pPixmapEventHandler.reset(ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, OnPixmapDamaged, (void*)this));
SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapEventHandler, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
-
- SysLog(NID_UI_CTRL, "[0x%x]", surface.data.x11.pixmap);
+*/
+ SysLog(NID_UI_CTRL, "[0x%x][%d %d]", surface.data.x11.pixmap, absoluteBounds.x, absoluteBounds.y);
}
SysLog(NID_UI_CTRL, "[%d %d %d %d]", x, y, width, height);
int type = livebox_size(pLivebox);
livebox_service_get_size(type, &width, &height);
- SysLog(NID_UI_CTRL, "size [%d %d]", 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);
+// SysLog(NID_UI_CTRL, "size [%d %d]", width, height);
return Dimension(width, height);
}
int type = livebox_lb_type(pLivebox);
- SysLog(NID_UI_CTRL, "type (%d)", type);
+// SysLog(NID_UI_CTRL, "type (%d)", type);
switch (type)
{
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.");
int type = livebox_pd_type(pLivebox);
- SysLog(NID_UI_CTRL, "type (%d)", type);
+// SysLog(NID_UI_CTRL, "type (%d)", type);
switch (type)
{