}
result
-_SystemUtilImpl::GenerateKeyEvent(Tizen::Ui::KeyEventType KeyEvent, Tizen::Ui::_KeyCode keyCode)
+_SystemUtilImpl::GenerateKeyEvent(Tizen::Ui::KeyEventType keyEvent, Tizen::Ui::_KeyCode keyCode)
{
result r = E_SUCCESS;
Display* pDisplay = (Display*)ecore_x_display_get();
- SysTryReturnResult(NID_UI, pDisplay != null, E_SYSTEM, "[E_SYSTEM] pDisplay is invalid. something wrong!");
+ SysTryReturnResult(NID_UI, pDisplay != null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] pDisplay is invalid. something wrong!");
std::unique_ptr<Display, _DisplayDeleter> pDpy(XOpenDisplay(NULL));
- SysTryReturnResult(NID_UI, pDpy.get() != null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!");
+ SysTryReturnResult(NID_UI, pDpy.get() != null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] pDpy is invalid. something wrong!");
int key = -1;
return E_INVALID_ARG;
}
- switch (KeyEvent)
+ switch (keyEvent)
{
case KEY_EVENT_TYPE_PRESSED:
XTestFakeKeyEvent(pDisplay, key, true, CurrentTime);
result r = E_SUCCESS;
Display* pDisplay = (Display*)ecore_x_display_get();
- SysTryReturnResult(NID_UI, pDisplay != null, E_SYSTEM, "[E_SYSTEM] pDisplay is invalid. something wrong!");
+ SysTryReturnResult(NID_UI, pDisplay != null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] pDisplay is invalid. something wrong!");
std::unique_ptr<Display, _DisplayDeleter> pDpy(XOpenDisplay(NULL));
- SysTryReturnResult(NID_UI, pDpy.get() != null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!");
+ SysTryReturnResult(NID_UI, pDpy.get() != null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] pDpy is invalid. something wrong!");
int width = DisplayWidth(pDpy.get(), DefaultScreen(pDpy.get()));
int height = DisplayHeight(pDpy.get(), DefaultScreen(pDpy.get()));
result r = E_SUCCESS;
std::unique_ptr<Display, _DisplayDeleter> pDpy(XOpenDisplay(NULL));
- SysTryReturn(NID_UI, pDpy, null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!");
+ SysTryReturn(NID_UI, pDpy.get(), null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] pDpy is invalid. something wrong!");
int width = DisplayWidth(pDpy.get(), DefaultScreen(pDpy.get()));
int height = DisplayHeight(pDpy.get(), DefaultScreen(pDpy.get()));
void* pDump = utilx_create_screen_shot(pDpy.get(), width, height);
- SysTryReturn(NID_UI, pDump, null, E_SYSTEM, "[E_SYSTEM] pDump is invalid. something wrong!");
+ if (pDump == null)
+ {
+ SysLog(NID_UI, "pDump is invalid. Check if screen is off");
+ return null;
+ }
std::unique_ptr<ByteBuffer> pBuffer(new (std::nothrow) ByteBuffer());
- SysTryReturn(NID_UI, pBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failure.");
+ SysTryReturn(NID_UI, pBuffer != null, null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Memory allocation failure.");
r = pBuffer->Construct(static_cast<byte*>(pDump), 0, width*height*4, width*height*4);
SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
Tizen::Graphics::Dimension dim(width, height);
std::unique_ptr<Tizen::Graphics::Bitmap> pBitmap(new (std::nothrow) Bitmap());
- SysTryReturn(NID_UI, pBitmap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failure.");
+ SysTryReturn(NID_UI, pBitmap != null, null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Memory allocation failure.");
r = pBitmap->Construct(*pBuffer, dim, BITMAP_PIXEL_FORMAT_ARGB8888);
SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
Ecore_X_Window xWindow = *_keygrab_win;
r = ecore_x_client_message8_send(xWindow, type, msg_data, sizeof(msg_data));
- SysTryReturn(NID_UI, r == true, E_SYSTEM, E_SYSTEM, "ecore_x_client_message8_send failed.");
+ SysTryReturn(NID_UI, r == true, E_OPERATION_FAILED, E_OPERATION_FAILED, "ecore_x_client_message8_send failed.");
}
return E_SUCCESS;