/**
* @copydoc Dali::IsKey()
*/
-bool IsKey( const Dali::KeyEvent& keyEvent, Dali::KEY daliKey);
+bool IsKey( const Dali::KeyEvent& keyEvent, Dali::KEY daliKey );
/**
* Check if a the given key name string is a button on the device itself.
*/
bool IsDeviceButton( const char* keyName );
+/**
+ * Get the key name from the dali key code.
+ * @param daliKey The dali key code
+ * @return The key name
+ */
+const char* GetKeyName( Dali::KEY daliKey );
+
} // namespace KeyLookup
} // namespace Adaptor
*/
enum IndicatorBgOpacity
{
- OPAQUE = 100, // Fully opaque indicator Bg
- TRANSLUCENT = 50, // Semi translucent indicator Bg
- TRANSPARENT = 0 // Fully transparent indicator Bg
+ OPAQUE = 100, ///< Fully opaque indicator Bg
+ TRANSLUCENT = 50, ///< Semi translucent indicator Bg
+ TRANSPARENT = 0 ///< Fully transparent indicator Bg
};
/**
*/
enum IndicatorVisibleMode
{
- INVISIBLE = 0, // hide indicator
- VISIBLE = 1, // show indicator
- AUTO = 2 // hide in default, will show when necessary
+ INVISIBLE = 0, ///< hide indicator
+ VISIBLE = 1, ///< show indicator
+ AUTO = 2 ///< hide in default, will show when necessary
};
// Methods
}
}
+ const char* GetKeyName( int daliKeyCode ) const
+ {
+ for( size_t i = 0; i < KEY_LOOKUP_COUNT ; ++i )
+ {
+ const KeyLookup& keyLookup( KeyLookupTable[i] );
+ if( keyLookup.daliKeyCode == daliKeyCode )
+ {
+ return keyLookup.keyName;
+ }
+ }
+ return "";
+ }
+
bool IsDeviceButton( const char* keyName ) const
{
Lookup::const_iterator i = mLookup.find( keyName );
return globalKeyLookup.IsDeviceButton( keyName );
}
+const char* GetKeyName( Dali::KEY daliKey )
+{
+ return globalKeyLookup.GetKeyName( daliKey );
+}
+
} // namespace KeyLookup
} // namespace Adaptor
}
}
+ const char* GetKeyName( int daliKeyCode ) const
+ {
+ for( size_t i = 0; i < KEY_LOOKUP_COUNT ; ++i )
+ {
+ const KeyLookup& keyLookup( KeyLookupTable[i] );
+ if( keyLookup.daliKeyCode == daliKeyCode )
+ {
+ return keyLookup.keyName;
+ }
+ }
+ return "";
+ }
+
bool IsDeviceButton( const char* keyName ) const
{
Lookup::const_iterator i = mLookup.find( keyName );
return globalKeyLookup.IsDeviceButton( keyName );
}
+const char* GetKeyName( Dali::KEY daliKey )
+{
+ return globalKeyLookup.GetKeyName( daliKey );
+}
+
} // namespace KeyLookup
} // namespace Adaptor
}
}
+ const char* GetKeyName( int daliKeyCode ) const
+ {
+ for( size_t i = 0; i < KEY_LOOKUP_COUNT ; ++i )
+ {
+ const KeyLookup& keyLookup( KeyLookupTable[i] );
+ if( keyLookup.daliKeyCode == daliKeyCode )
+ {
+ return keyLookup.keyName;
+ }
+ }
+ return "";
+ }
+
bool IsDeviceButton( const char* keyName ) const
{
Lookup::const_iterator i = mLookup.find( keyName );
return globalKeyLookup.IsDeviceButton( keyName );
}
+const char* GetKeyName( Dali::KEY daliKey )
+{
+ return globalKeyLookup.GetKeyName( daliKey );
+}
+
} // namespace KeyLookup
} // namespace Adaptor
$(adaptor_x11_dir)/accessibility-manager-impl-x.cpp \
$(adaptor_x11_dir)/framework-x.cpp \
$(adaptor_x11_dir)/key-impl-x.cpp \
- $(adaptor_x11_dir)/window-extensions.cpp
+ $(adaptor_x11_dir)/window-extensions.cpp \
+ $(adaptor_x11_dir)/key-grab-x.cpp
adaptor_x11_tv_internal_src_files = \
$(_adaptor_x11_internal_src_files) \
$(adaptor_x11_dir)/system-settings-x.cpp
public_api_adaptor_tizen_x11_header_files = \
- $(adaptor_x11_dir)/window-extensions.h
+ $(adaptor_x11_dir)/window-extensions.h \
+ $(adaptor_x11_dir)/key-grab.h
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <key-grab.h>
+
+// EXTERNAL INCLUDES
+#include <Ecore.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+
+// INTERNAL INCLUDES
+#include <window.h>
+#include <key-impl.h>
+#include <ecore-x-types.h>
+
+namespace Dali
+{
+
+namespace KeyGrab
+{
+
+bool GrabKey( Window window, Dali::KEY daliKey, KeyGrabMode grabMode )
+{
+ int xGrabMode;
+ if( grabMode == TOP_POSITION )
+ {
+ xGrabMode = TOP_POSITION_GRAB;
+ }
+ else if( grabMode == SHARED )
+ {
+ xGrabMode = SHARED_GRAB;
+ }
+ else
+ {
+ return false;
+ }
+
+ int ret = utilx_grab_key ( static_cast<Display*>( ecore_x_display_get() ),
+ static_cast<XWindow>( AnyCast<Ecore_X_Window>( window.GetNativeHandle() ) ),
+ Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKey ), xGrabMode );
+ return ret==0;
+}
+
+bool UngrabKey( Window window, Dali::KEY daliKey )
+{
+ int ret = utilx_ungrab_key ( static_cast<Display*>( ecore_x_display_get() ),
+ static_cast<XWindow>( AnyCast<Ecore_X_Window>( window.GetNativeHandle() ) ),
+ Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKey ) );
+ return ret==0;
+}
+
+} // namespace KeyGrab
+
+} // namespace Dali
+
+
--- /dev/null
+#ifndef __DALI_KEY_GRAB_H__
+#define __DALI_KEY_GRAB_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include "key.h"
+
+namespace Dali
+{
+class Window;
+
+namespace KeyGrab
+{
+
+/**
+ * @brief Key grab mode.
+ */
+enum KeyGrabMode
+{
+ TOP_POSITION = 0, ///< Grab a key only when on the top of the grabbing-window stack mode.
+ SHARED ///< Grab a key together with the other client window(s) mode.
+};
+
+/**
+ * @brief Grabs the key specfied by @a key for @a window in @a grabMode.
+ *
+ * The key grab feature is designed for following example scenarios:
+ * TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app.
+ * Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app.
+ *
+ * @note This function is only specified by Tizen.
+ * @param[in] window The window to set
+ * @param[in] dailKey The key code to grab (defined in key.h)
+ * @param[in] grabMode The grab mode for the key
+ * @return true if the grab succeed.
+ */
+DALI_IMPORT_API bool GrabKey( Window window, Dali::KEY daliKey, KeyGrabMode grabMode );
+
+/**
+ * @brief Ungrabs the key specfied by @a key for @a window.
+ * @note This function is only specified by Tizen.
+ * @param[in] window The window to set
+ * @param[in] dailKey The key code to ungrab (defined in key.h)
+ * @return true if the ungrab succeed.
+ */
+DALI_IMPORT_API bool UngrabKey( Window window, Dali::KEY daliKey );
+
+} // namespace KeyGrab
+
+} // namespace Dali
+
+#endif // __DALI_KEY_GRAB_H__
}
}
+ const char* GetKeyName( int daliKeyCode ) const
+ {
+ for( size_t i = 0; i < KEY_LOOKUP_COUNT ; ++i )
+ {
+ const KeyLookup& keyLookup( KeyLookupTable[i] );
+ if( keyLookup.daliKeyCode == daliKeyCode )
+ {
+ return keyLookup.keyName;
+ }
+ }
+ return "";
+ }
+
bool IsDeviceButton( const char* keyName ) const
{
Lookup::const_iterator i = mLookup.find( keyName );
return globalKeyLookup.IsDeviceButton( keyName );
}
+const char* GetKeyName( Dali::KEY daliKey )
+{
+ return globalKeyLookup.GetKeyName( daliKey );
+}
+
} // namespace KeyLookup
} // namespace Adaptor
*
* The effect will be shown when the application is launched, quit, shown and hiden.
*
- * @note This function is only specified by tizen.
+ * @note This function is only specified by Tizen.
*
* @param[in] window The window to set.
* @param[in] enable True if the effect is enabled.
/**
* @brief Retrieve whether the effect is enabled or not.
*
- * @note This function is only specified by tizen.
+ * @note This function is only specified by Tizen.
*
* @param[in] window The window to set.
* @return True if the effect is enabled.
libdali_adaptor_la_LIBADD +=
endif
+if !UBUNTU_PROFILE
+if WAYLAND
+else
+# X11
+libdali_adaptor_la_CXXFLAGS += $(UTILX_CFLAGS)
+libdali_adaptor_la_LIBADD += $(UTILX_LIBS)
+endif
+endif
+
if TURBO_JPEG_IS_ON
libdali_adaptor_la_LIBADD += -lturbojpeg
CFLAGS += -D_TURBO_JPEG_LOADER
PKG_CHECK_MODULES(VCONF, vconf)
PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings)
+if test "x$enable_wayland" != "xyes"; then
+PKG_CHECK_MODULES(UTILX, utilX)
+fi
+
if test "x$with_over_tizen_2_2" = "xyes"; then
PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, capi-system-info)
fi