// EXTERNAL INCLUDES
#include <dali/public-api/object/base-object.h>
-#include <Ecore_X.h>
// INTERNAL INCLUDES
#include <clipboard.h>
{
public:
+ // Hide the specific windowing system
+ struct Impl;
+
/**
* @copydoc Dali::ClipboardEventNotifier::Get()
*/
/**
* Constructor
- * @param[in] ecoreXwin, The window is created by application.
+ * @param[in] impl Some data from a specific windowing system.
*/
- Clipboard(Ecore_X_Window ecoreXwin);
+ Clipboard(Impl* impl);
+ /**
+ * Destructor
+ */
virtual ~Clipboard();
/**
*/
void HideClipboard();
-
private:
- Ecore_X_Window mApplicationWindow;
+
+ // Undefined
Clipboard( const Clipboard& );
Clipboard& operator=( Clipboard& );
+private:
+
+ Impl* mImpl;
+
}; // class clipboard
+++ /dev/null
-#ifndef __DALI_INTERNAL_CLIPBOARD_H__
-#define __DALI_INTERNAL_CLIPBOARD_H__
-
-/*
- * Copyright (c) 2014 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/object/base-object.h>
-#include <Ecore.h>
-#include <Ecore_Wayland.h>
-
-// INTERNAL INCLUDES
-#include <clipboard.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * Implementation of the Clip Board
- */
-
-class Clipboard : public Dali::BaseObject
-{
-public:
-
- /**
- * @copydoc Dali::ClipboardEventNotifier::Get()
- */
- static Dali::Clipboard Get();
-
- virtual ~Clipboard();
-
- /**
- * @copydoc Dali::Clipboard::SetItem()
- */
- bool SetItem(const std::string &itemData);
-
- /**
- * @copydoc Dali::Clipboard::GetItem()
- */
- std::string GetItem( unsigned int index );
-
- /**
- * @copydoc Dali::Clipboard::NumberOfClipboardItems()
- */
- unsigned int NumberOfItems();
-
- /**
- * @copydoc Dali::Clipboard::ShowClipboard()
- */
- void ShowClipboard();
-
- /**
- * @copydoc Dali::Clipboard::HideClipboard()
- */
- void HideClipboard();
-
-
-private:
- Clipboard( const Clipboard& );
- Clipboard& operator=( Clipboard& );
-
-}; // class clipboard
-
-
-} // namespace Adaptor
-
-} // namespace Internal
-
- inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
- {
- DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
- BaseObject& handle = clipboard.GetBaseObject();
- return static_cast<Internal::Adaptor::Clipboard&>(handle);
- }
-
- inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
- {
- DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
- const BaseObject& handle = clipboard.GetBaseObject();
- return static_cast<const Internal::Adaptor::Clipboard&>(handle);
- }
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_CLIPBOARD_H__
namespace Adaptor
{
-namespace
+struct Clipboard::Impl
{
+ Impl( Ecore_X_Window ecoreXwin )
+ {
+ mApplicationWindow = ecoreXwin;
+ }
+
+ Ecore_X_Window mApplicationWindow;
+};
+
+namespace // unnamed namespace
+{
+
BaseHandle Create()
{
BaseHandle handle( Clipboard::Get() );
// If we fail to get Ecore_X_Window, we can't use the Clipboard correctly.
// Thus you have to call "ecore_imf_context_client_window_set" somewhere.
// In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().
- Dali::Clipboard clipboard = Dali::Clipboard( new Clipboard( ecoreXwin ) );
+ Clipboard::Impl* impl( new Clipboard::Impl( ecoreXwin ) );
+ Dali::Clipboard clipboard = Dali::Clipboard( new Clipboard( impl ) );
service.Register( typeid( clipboard ), clipboard );
handle = clipboard;
}
return handle;
}
+
TypeRegistration CLIPBOARD_TYPE( typeid(Dali::Clipboard), typeid(Dali::BaseHandle), Create, true /* Create Instance At Startup */ );
} // unnamed namespace
-Clipboard::Clipboard( Ecore_X_Window ecoreXwin)
+Clipboard::Clipboard(Impl* impl)
+: mImpl( impl )
{
- mApplicationWindow = ecoreXwin;
}
Clipboard::~Clipboard()
{
+ delete mImpl;
}
Dali::Clipboard Clipboard::Get()
void Clipboard::ShowClipboard()
{
// Claim the ownership of the SECONDARY selection.
- ecore_x_selection_secondary_set(mApplicationWindow, "", 1);
+ ecore_x_selection_secondary_set(mImpl->mApplicationWindow, "", 1);
Ecore_X_Window cbhmWin = ECore::WindowInterface::GetWindow();
// Launch the clipboard window