ENDIF(_WIN32)
ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(example)
--- /dev/null
+SET(this_target test-application)
+
+INCLUDE_DIRECTORIES(
+ ../inc
+)
+
+SET(${this_target}_SOURCE_FILES
+ TestApplication.cpp
+)
+
+SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+ADD_EXECUTABLE(${this_target} ${${this_target}_SOURCE_FILES})
+
+TARGET_LINK_LIBRARIES(${this_target} "-lui-core")
--- /dev/null
+#include <UcInterface.h>
+
+int main(void)
+{
+ InitLibrary(0, 480, 800);
+ CreateVisualElement(0, 0, 100, 100);
+
+ for (int i = 0; ;i++)
+ {
+ if (i == 1000)
+ {
+ IterateMainLoop();
+ }
+ }
+
+ return 0;
+}
JNIEXPORT void JNICALL UpdateScreen(float delayedTime);
#else
void InitLibrary(int windowHandle, int width, int height);
+void CreateVisualElement(int x, int y, int width, int height);
void ResizeWindow(int width, int height);
void UpdateScreen(float delayedTime);
+void IterateMainLoop(void);
#endif
${UIFW_DIRECTORY}/src/ui/inc
${UIFW_DIRECTORY}/src/ui/animations
${RSA_DEV_DIRECTORY}/external/boost
- /usr/include/glib-2.0/
- /usr/lib/i386-linux-gnu/glib-2.0/include
)
ELSEIF(_WIN32)
INCLUDE_DIRECTORIES(
#include "UcInterface.h"
#include "FUiAnim_DisplayManager.h"
+#include "FUiAnim_AnimationManager.h"
+#include "FUiAnim_RootVisualElement.h"
+#include "FUiAnimVisualElement.h"
+#include "FUiAnimVisualElementSurface.h"
#include "FUiAnim_NativeLayer.h"
+#include "FGrpFloatRectangle.h"
+#include "FGrpBufferInfo.h"
+#include "FUiAnimDisplayContext.h"
+#include "FUiAnim_DisplayContextImpl.h"
+#include "FUiAnim_Looper.h"
+#include "FUiAnim_NativeWindow.h"
+using namespace Tizen::Graphics;
using namespace Tizen::Ui::Animations;
_NativeLayer* pNativeLayer = null;
+DisplayContext* pDisplayContext = null;
void InitLibrary(int windowHandle, int width, int height)
{
- _DisplayManager::CreateInstance();
+#ifdef LINUX
+ _DisplayManager::CreateInstance();
+ _AnimationManager::CreateInstance();
pNativeLayer = _NativeLayer::CreateInstanceN();
- pNativeLayer->SetShowState(true);
+ pNativeLayer->SetShowState(true);
+#elif _WIN32
+#endif
+ pDisplayContext = _DisplayContextImpl::CreatePublicInstance(*pNativeLayer);
+}
+
+void CreateVisualElement(int x, int y, int width, int height)
+{
+ _RootVisualElement* pRoot = pNativeLayer->GetRootVisualElement();
+
+ VisualElement* pElement = new VisualElement();
+ pElement->Construct();
+ pElement->SetShowState(true);
+ pElement->SetBounds(FloatRectangle(x, y, width, height));
+ pRoot->AttachChild(pElement);
+
+ //VisualElementSurface* pSurface = pElement->GetSurfaceN();
+ VisualElementSurface* pSurface = new VisualElementSurface();
+ pSurface->Construct(*pDisplayContext, FloatDimension(100, 100));
+
+ BufferInfo bufferInfo;
+ pSurface->GetBufferInfo(bufferInfo);
+
+ memset(bufferInfo.pPixels, 0xFF, width * height * 4);
+
+ pElement->SetSurface(pSurface);
+
+ pElement->Flush();
}
void ResizeWindow(int width, int height)
{
pNativeLayer->Flush();
}
+
+
+void IterateMainLoop()
+{
+ _Looper* pLooper = _Looper::GetInstance();
+
+ _RawEvent rawEvent;
+
+ if(pLooper->GetRawEvent(rawEvent, -1) != 0)
+ {
+ pLooper->DispatchRawEvent(rawEvent);
+ printf("OnMainLoop:event(%d) \n",rawEvent.type);
+ }
+}
#include "FUiAnim_GlRenderManager.h"
#include "FUiAnim_VisualElementSurfaceManager.h"
-#ifndef BUILD_UI_CORE
+#ifndef _WIN32
#include "FUiAnim_Looper.h"
#endif
return E_OUT_OF_MEMORY;
}
-#ifndef BUILD_UI_CORE
+#ifndef _WIN32
_Looper::CreateInstance();
#endif
_NativeWindow::WindowSystemInit();
_GlRenderManager::CreateInstance();
// _GlRenderManager::GetInstance()->SyncRenderManager();
-#ifndef BUILD_UI_CORE
+#ifndef _WIN32
_Looper::GetInstance()->AddWakeupEvent();
#endif
-
return E_SUCCESS;
}
delete __pInstance;
__pInstance = null;
-#ifndef BUILD_UI_CORE
+#ifndef _WIN32
_Looper::ReleaseInstance();
#endif
return E_SUCCESS;
void
_DisplayManager::AddWakeUpEvent(void)
{
-#ifndef BUILD_UI_CORE
+#ifndef _WIN32
// _AnimationManager::GetInstance()->SetAnimatorEnabled(true);
if(_Looper::GetInstance())
{
, __epollFD(-1)
, __epollFDCount(0)
, __eventLock()
+#ifndef BUILD_UI_CORE
, __pGlibCondition(null)
, __pGlibFDs(null)
, __glibFDBufferCount(G_POLL_INITIAL_FD_SIZE)
+#endif
{
SysAssertf(!__pLooper, "main loop was created already");
__pLooper = this;
#else
__epollFD = epoll_create(10);
SysAssertf(__epollFD >= 0, "epoll creation failed");
-
+#ifndef BUILD_UI_CORE
__pGlibFDs = new (std::nothrow) GPollFD[G_POLL_INITIAL_FD_SIZE];
+#endif
#endif
__eventProducers.RemoveAt(0);
}
-
+#ifndef BUILD_UI_CORE
if (__pGlibCondition)
{
g_cond_free(__pGlibCondition);
{
delete [] __pGlibFDs;
}
-
+#endif
#if defined (USE_ECORE_LOOP)
while (__ecoreFdHandlers.GetCount() > 0)
{
bool
_Looper::WaitForEvents(int timeout)
{
+ int glibFDCount = 0;
+#ifndef BUILD_UI_CORE
GStaticMutex glibLock = G_STATIC_MUTEX_INIT;
GMutex *pGlibMutex = g_static_mutex_get_mutex(&glibLock);
GMainContext *pGlibCtx = g_main_context_default();
- int ret, glibPriority = 0, glibTimeout = 0, glibFDCount = 0;
+ int glibPriority = 0, glibTimeout = 0 ;
bool needRelease = true;
if (g_main_context_acquire(pGlibCtx))
needRelease = false;
}
+#endif
struct epoll_event epollEvent[glibFDCount + __epollFDCount];
memset(&epollEvent, 0, sizeof (epollEvent));
timeout = -1;
}
- ret = epoll_wait(__epollFD, epollEvent, glibFDCount + __epollFDCount,timeout);
+ int ret = epoll_wait(__epollFD, epollEvent, glibFDCount + __epollFDCount,timeout);
if (ret < 0)
{
return false;
}
-
+#ifndef BUILD_UI_CORE
int epollFDCount = ret;
if (likely(glibFDCount > 0))
g_main_context_release(pGlibCtx);
g_static_mutex_free(&glibLock);
}
-
+#endif
return true;
}
+#ifndef BUILD_UI_CORE
int
_Looper::GetGlibFDCount(GMainContext* pGlibCtx, int& glibPriority, int& glibTimeout)
{
return true;
}
+#endif
}}} // Tizen::Ui::Animations
return pLayer;
#else
- _GlLayer* pLayer = new (std::nothrow) _GlLayer;
+ _GlLayer* pLayer = new (std::nothrow) _GlLayer();
if (pLayer)
{
pLayer->Construct();
-
#include <X11/Xutil.h>
#include <X11/extensions/Xrender.h>
#include <X11/extensions/sync.h>
XMoveResizeWindow(pDisplay, window, x, y, w, h); // CHECKME: What's the result of this API ?
- XSync(pDisplay,FALSE);
+ XSync(pDisplay,False);
// XFlush(pDisplay); // CHECKME: Why is this needed ???
}
}
PRINT("ProcessEvent :: MapNotify \n");
__isMapped = true;
-// _GlRenderManager::GetInstance()->Composite(pLayer);
+ _GlRenderManager::GetInstance()->Composite(pLayer);
break;
case UnmapNotify:
PRINT("ProcessEvent :: UnmapNotify \n");
#ifndef _FUI_ANIM_INTERNAL_LOOPER_H_
#define _FUI_ANIM_INTERNAL_LOOPER_H_
+#ifndef BUILD_UI_CORE
#include <glib.h>
+#endif
#include <FBaseColQueueT.h>
#include <FBaseColArrayListT.h>
#include <FBaseColHashMapT.h>
static result ReleaseInstance(void);
bool WaitForEvents(int timeout);
-
+#ifndef BUILD_UI_CORE
int GetGlibFDCount(GMainContext* pGlibCtx, int& glibPriority, int& glibTimeout);
bool AddGlibFDToWaitEvent(int glibFDCount);
int DispatchGlib(struct epoll_event* pEpollEvent, int& eventCount, GMainContext* pGlibCtx, int& glibPriority, int glibFDCount);
bool RemoveGlibFDFromWaitEvent(int glibFDCount);
+#endif
EventProducerInfo* GetRawEventProducer(int fd);
_Mutex __eventLock;
friend class _DisplayManager;
-
+#ifndef BUILD_UI_CORE
GCond* __pGlibCondition;
GPollFD* __pGlibFDs;
int __glibFDBufferCount;
+#endif
static const unsigned int G_POLL_INITIAL_FD_SIZE = 128;
static int __eventType;