__thread Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
} // unnamed namespace
-Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, const DeviceLayout& baseLayout,
- Dali::Configuration::ContextLoss configuration )
+Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration )
{
Dali::Adaptor* adaptor = new Dali::Adaptor;
- Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, baseLayout );
+ Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface );
adaptor->mImpl = impl;
impl->Initialize(configuration);
mNotificationOnIdleInstalled = false;
}
-Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout)
+Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface)
: mResizedSignal(),
mLanguageChangedSignal(),
mAdaptor(adaptor),
mObservers(),
mDragAndDropDetector(),
mDeferredRotationObserver(NULL),
- mBaseLayout(baseLayout),
mEnvironmentOptions(),
mPerformanceInterface(NULL),
mObjectProfiler(NULL)
#include <render-surface.h>
#include <tts-player.h>
#include <imf-manager.h>
-#include <device-layout.h>
#include <clipboard.h>
#include <tizen-platform-abstraction.h>
* @param[in] surface A render surface can be one of the following
* - Pixmap, adaptor will use existing Pixmap to draw on to
* - Window, adaptor will use existing Window to draw on to
- * @param[in] baseLayout The base layout that the application has been written for
* @param[in] configuration The context loss configuration ( to choose resource discard policy )
*/
static Dali::Adaptor* New( Any nativeWindow,
RenderSurface* surface,
- const DeviceLayout& baseLayout,
Dali::Configuration::ContextLoss configuration );
/**
* @param[in] surface A render surface can be one of the following
* - Pixmap, adaptor will use existing Pixmap to draw on to
* - Window, adaptor will use existing Window to draw on to
- * @param[in] baseLayout The base layout that the application has been written for
*/
- Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout );
+ Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface );
private: // Types
ObserverContainer mObservers; ///< A list of adaptor observer pointers
DragAndDropDetectorPtr mDragAndDropDetector; ///< The Drag & Drop detector
RotationObserver* mDeferredRotationObserver; ///< deferred Rotation observer needs event handler
- DeviceLayout mBaseLayout; ///< The base layout of the application
EnvironmentOptions mEnvironmentOptions; ///< environment options
PerformanceInterface* mPerformanceInterface; ///< Performance interface
KernelTrace mKernelTracer; ///< Kernel tracer
Adaptor& Adaptor::New( Window window )
{
- return New( window, DeviceLayout::DEFAULT_BASE_LAYOUT, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+ return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
}
-Adaptor& Adaptor::New( Window window, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
{
Any winId = window.GetNativeHandle();
Internal::Adaptor::Window& windowImpl = GetImplementation(window);
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( winId, windowImpl.GetSurface(), baseLayout, configuration );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( winId, windowImpl.GetSurface(), configuration );
windowImpl.SetAdaptor(*adaptor);
return *adaptor;
}
Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
{
- return New( nativeWindow, surface, DeviceLayout::DEFAULT_BASE_LAYOUT, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+ return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
{
Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, baseLayout, configuration );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration );
return *adaptor;
}
ApplicationPtr Application::New(
int* argc,
char **argv[],
- const std::string& name,
- const DeviceLayout& baseLayout,
+ const std::string& stylesheet,
Dali::Application::WINDOW_MODE windowMode)
{
- ApplicationPtr application ( new Application (argc, argv, name, baseLayout, windowMode ) );
+ ApplicationPtr application ( new Application (argc, argv, stylesheet, windowMode ) );
return application;
}
-Application::Application( int* argc, char** argv[], const std::string& name, const DeviceLayout& baseLayout, Dali::Application::WINDOW_MODE windowMode)
+Application::Application( int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode )
: mInitSignal(),
mTerminateSignal(),
mPauseSignal(),
mAdaptor( NULL ),
mWindow(),
mWindowMode( windowMode ),
- mName( name ),
+ mName(),
+ mStylesheet( stylesheet ),
mInitialized( false ),
- mBaseLayout( baseLayout ),
mSlotDelegate( this )
{
+ // Copy mName from command-line args
+ if( argc && ( *argc > 0 ) )
+ {
+ mName = (*argv)[0];
+ }
+
mCommandLineOptions = new CommandLineOptions(argc, argv);
- mFramework = new Framework(*this, argc, argv, name);
+ mFramework = new Framework(*this, argc, argv, mName);
}
Application::~Application()
{
DALI_ASSERT_ALWAYS( mWindow && "Window required to create adaptor" );
- mAdaptor = &Dali::Adaptor::New( mWindow, mBaseLayout, mContextLossConfiguration );
+ mAdaptor = &Dali::Adaptor::New( mWindow, mContextLossConfiguration );
mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
}
Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetViewMode( viewMode );
}
+ if( ! mStylesheet.empty() )
+ {
+ Dali::StyleMonitor::Get().SetTheme( mStylesheet );
+ }
+
mInitialized = true;
// Wire up the LifecycleController
return mWindow;
}
-const std::string& Application::GetTheme()
-{
- return Dali::StyleMonitor::Get().GetTheme();
-}
-
-void Application::SetTheme(const std::string& themeFilePath)
-{
- return Dali::StyleMonitor::Get().SetTheme(themeFilePath);
-}
-
// Stereoscopy
void Application::SetViewMode( ViewMode viewMode )
typedef Dali::Application::AppSignalType AppSignalType;
typedef Dali::Application::AppControlSignalType AppControlSignalType;
+ typedef Dali::Application::WINDOW_MODE WINDOW_MODE;
/**
- * Constructor
- * @param[in] app The public instance of the Application
+ * Create a new application
* @param[in] argc A pointer to the number of arguments
* @param[in] argv A pointer to the argument list
- * @param[in] name A name of application
- * @param[in] baseLayout The base layout that the application has been written for
+ * @param[in] stylesheet The path to user defined theme file
* @param[in] windowMode A member of Dali::Application::WINDOW_MODE
*/
- static ApplicationPtr New(int* argc, char **argv[], const std::string& name,
- const DeviceLayout& baseLayout,
- Dali::Application::WINDOW_MODE windowMode);
-
- Application( int* argc, char **argv[], const std::string& name, const DeviceLayout& baseLayout, Dali::Application::WINDOW_MODE windowMode );
-
- /**
- * Destructor
- */
- virtual ~Application();
+ static ApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
public:
Dali::Window GetWindow();
/**
- * @copydoc Dali::Application::GetTheme();
- */
- const std::string& GetTheme();
-
- /**
- * @copydoc Dali::Application::SetTheme();
- */
- void SetTheme(const std::string& themeFilePath);
-
- /**
* @copydoc Dali::Application::ReplaceWindow();
*/
void ReplaceWindow(PositionSize windowPosition, const std::string& name);
private:
+ /**
+ * Private Constructor
+ * @param[in] argc A pointer to the number of arguments
+ * @param[in] argv A pointer to the argument list
+ * @param[in] stylesheet The path to user defined theme file
+ * @param[in] windowMode A member of Dali::Application::WINDOW_MODE
+ */
+ Application( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+
+ /**
+ * Destructor
+ */
+ virtual ~Application();
+
// Undefined
Application(const Application&);
Application& operator=(Application&);
Dali::Window mWindow;
Dali::Application::WINDOW_MODE mWindowMode;
std::string mName;
+ std::string mStylesheet;
bool mInitialized;
- DeviceLayout mBaseLayout;
SlotDelegate< Application > mSlotDelegate;
};
namespace Dali
{
-struct DeviceLayout;
class RenderSurface;
namespace Internal
* @brief Create a new adaptor using the window.
*
* @param[in] window The window to draw onto
- * @note The default base layout DeviceLayout::DEFAULT_BASE_LAYOUT will be used.
* @return a reference to the adaptor handle
*/
static Adaptor& New( Window window );
* @brief Create a new adaptor using the window.
*
* @param[in] window The window to draw onto
- * @param[in] baseLayout The base layout that the application has been written for
* @param[in] configuration The context loss configuration.
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Window window, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration );
+ static Adaptor& New( Window window, Configuration::ContextLoss configuration );
/**
* @brief Create a new adaptor using render surface.
*
* @param[in] nativeWindow native window handle
* @param[in] surface The surface to draw onto
- * @note The default base layout DeviceLayout::DEFAULT_BASE_LAYOUT will be used.
* @return a reference to the adaptor handle
*/
static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface );
*
* @param[in] nativeWindow native window handle
* @param[in] surface The surface to draw onto
- * @param[in] baseLayout The base layout that the application has been written for
* @param[in] configuration The context loss configuration.
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
+ static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
/**
* @brief Virtual Destructor.
Application Application::New( int* argc, char **argv[] )
{
- Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
+ Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE );
return Application(internal.Get());
}
-Application Application::New( int* argc, char **argv[], const std::string& name )
+Application Application::New( int* argc, char **argv[], const std::string& stylesheet )
{
- Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
+ Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE );
return Application(internal.Get());
}
-Application Application::New( int* argc, char **argv[], const std::string& name, WINDOW_MODE windowMode )
+Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode )
{
- Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, windowMode );
- return Application(internal.Get());
-}
-
-Application Application::New(int* argc, char **argv[], const DeviceLayout& baseLayout)
-{
- Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", baseLayout, OPAQUE );
- return Application(internal.Get());
-}
-
-Application Application::New(int* argc, char **argv[], const std::string& name, const DeviceLayout& baseLayout)
-{
- Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, baseLayout, OPAQUE );
+ Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode );
return Application(internal.Get());
}
// INTERNAL INCLUDES
#include "application-configuration.h"
-#include "device-layout.h"
#include "window.h"
namespace Dali
/**
* This is the constructor for applications without an argument list.
- *
- * @note The default base layout (DeviceLayout::DEFAULT_BASE_LAYOUT) will be used with this constructor.
*/
static Application New();
*
* @param[in,out] argc A pointer to the number of arguments
* @param[in,out] argv A pointer the the argument list
- *
- * @note The default base layout (DeviceLayout::DEFAULT_BASE_LAYOUT) will be used with this constructor.
- * @note Supported options are stripped from argv, and argc is updated appropriately.
*/
static Application New( int* argc, char **argv[] );
/**
* This is the constructor for applications with a name
*
- * @param[in,out] argc A pointer to the number of arguments
- * @param[in,out] argv A pointer the the argument list
- * @param[in] name A name of application
- *
- * @note The default base layout (DeviceLayout::DEFAULT_BASE_LAYOUT) will be used with this constructor.
- * @note Supported options are stripped from argv, and argc is updated appropriately.
- */
- static Application New( int* argc, char **argv[], const std::string& name );
-
- /**
- * This is the constructor for applications with a name, and also require a
- * transparent top-level window
- *
- * @param[in,out] argc A pointer to the number of arguments
- * @param[in,out] argv A pointer the the argument list
- * @param[in] name A name of application
- * @param[in] windowMode A member of WINDOW_MODE
- *
- * @note The default base layout (DeviceLayout::DEFAULT_BASE_LAYOUT) will be used with this constructor.
- * @note Supported options are stripped from argv, and argc is updated appropriately.
- */
- static Application New( int* argc, char **argv[], const std::string& name, WINDOW_MODE windowMode );
-
- /**
- * This is the constructor for applications when a layout for the application is specified.
- *
* @param[in,out] argc A pointer to the number of arguments
* @param[in,out] argv A pointer the the argument list
- * @param[in] baseLayout The base layout that the application has been written for
- *
- * @note Supported options are stripped from argv, and argc is updated appropriately.
+ * @param[in] stylesheet The path to user defined theme file
*/
- static Application New( int* argc, char **argv[], const DeviceLayout& baseLayout );
+ static Application New( int* argc, char **argv[], const std::string& stylesheet );
/**
- * This is the constructor for applications with a name and when a layout for the application is specified.
- *
- * @param[in,out] argc A pointer to the number of arguments
- * @param[in,out] argv A pointer the the argument list
- * @param[in] name A name of application
- * @param[in] baseLayout The base layout that the application has been written for
+ * This is the constructor for applications with a name
*
- * @note Supported options are stripped from argv, and argc is updated appropriately.
+ * @param[in,out] argc A pointer to the number of arguments
+ * @param[in,out] argv A pointer the the argument list
+ * @param[in] stylesheet The path to user defined theme file
+ * @param[in] windowMode A member of WINDOW_MODE
*/
- static Application New( int* argc, char **argv[], const std::string& name, const DeviceLayout& baseLayout );
+ static Application New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
/**
* Construct an empty handle
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <device-layout.h>
-
-namespace Dali
-{
-
-const DeviceLayout DeviceLayout::DEFAULT_BASE_LAYOUT
-(
- Vector2(720.0f, 1280.0f), // The resolution of the screen
- 4.65f, // The screen size
- Vector2(316.0f, 316.0f), // The DPI
- 30.0f // The Viewing Distance
-);
-
-DeviceLayout::DeviceLayout()
-: resolution(),
- screenSize(0.0f),
- dpi(),
- viewingDistance(0.0f)
-{
-}
-
-DeviceLayout::DeviceLayout(Vector2 resolution, float screenSize, Vector2 dpi, float viewingDistance)
-: resolution(resolution),
- screenSize(screenSize),
- dpi(dpi),
- viewingDistance(viewingDistance)
-{
-}
-
-DeviceLayout::~DeviceLayout()
-{
-}
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_DEVICE_LAYOUT_H__
-#define __DALI_DEVICE_LAYOUT_H__
-
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/math/vector2.h>
-
-namespace Dali
-{
-
-/**
- * @brief The attributes of the screen on the device.
- *
- * An application can specify the base layout that they used by inputting the values in this
- * structure and passing it to the Application or Adaptor class.
- * @see Dali::Application::Application(* argc, char **argv[], DeviceLayout baseLayout)
- * @see Dali::Adaptor::Adaptor(RenderSurface& surface, DeviceLayout baseLayout)
- */
-struct DALI_IMPORT_API DeviceLayout
-{
-public: // Construction & Destruction
-
- /**
- * @brief Default Constructor.
- */
- DeviceLayout();
-
- /**
- * @brief Create a DeviceLayout with specific parameters.
- * @param[in] resolution The resolution of the screen the application is based upon.
- * @param[in] screenSize The size of the screen the application is based upon.
- * @param[in] dpi The DPI of the screen the application is based upon.
- * @param[in] viewingDistance The default viewing distance of the screen the application is based upon.
- */
- DeviceLayout(Vector2 resolution, float screenSize, Vector2 dpi, float viewingDistance);
-
- /**
- * @brief Destructor.
- */
- ~DeviceLayout();
-
-public: // Data
-
- Vector2 resolution; ///< Resolution (width and height) of the screen.
- float screenSize; ///< Size of the screen in inches (diagonal size).
- Vector2 dpi; ///< DPI (Dots per Inch) of the screen on the device (x & y).
- float viewingDistance; ///< Average distance between the user and the device.
-
-public: // Defaults Layouts
-
- /**
- * @brief This is the default base layout that Dali will assume if no layout is passed in from the
- * application.
- *
- * Resolution: 720.0f x 1280.0f
- * Screen Size: 4.65f
- * DPI: 316.0f x 316.0f
- * Viewing Distance: 30.0f
- */
- static const DeviceLayout DEFAULT_BASE_LAYOUT;
-};
-
-} // namespace Dali
-
-#endif // __DALI_DEVICE_LAYOUT_H__
public_api_src_files = \
$(adaptor_public_api_dir)/adaptor-framework/application.cpp \
- $(adaptor_public_api_dir)/adaptor-framework/device-layout.cpp \
$(adaptor_public_api_dir)/adaptor-framework/key.cpp \
$(adaptor_public_api_dir)/adaptor-framework/orientation.cpp \
$(adaptor_public_api_dir)/adaptor-framework/window.cpp \
public_api_adaptor_framework_header_files = \
$(adaptor_public_api_dir)/adaptor-framework/application.h \
$(adaptor_public_api_dir)/adaptor-framework/application-configuration.h \
- $(adaptor_public_api_dir)/adaptor-framework/device-layout.h \
$(adaptor_public_api_dir)/adaptor-framework/key.h \
$(adaptor_public_api_dir)/adaptor-framework/orientation.h \
$(adaptor_public_api_dir)/adaptor-framework/style-change.h \
handler->SendEvent( fontChange );
}
-
- /**
- * Called when style is changed
- */
- static void VconfNotifyThemeChanged( keynode_t* node, void* data )
- {
- EventHandler* handler( static_cast<EventHandler*>(data) );
-
- StyleChange themeChange;
- themeChange.themeChange = true;
-
- handler->SendEvent( themeChange );
- }
#endif // DALI_PROFILE_UBUNTU
// Data