PROJECT(utilX C)
SET(SRCS x11.c)
-SET(HEADERS utilX.h)
+SET(HEADERS utilX.h utilX_ext.h)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED x11 xext xv xdamage libdrm libdrm_slp libdri2)
+pkg_check_modules(pkgs REQUIRED x11 xext xv xdamage libdrm libtbm libdri2 xrandr)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+++ /dev/null
-Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
-
- 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.
-
--- /dev/null
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All Rights Reserved.\r
+\r
+ Apache License\r
+ Version 2.0, January 2004\r
+ http://www.apache.org/licenses/\r
+\r
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+ 1. Definitions.\r
+\r
+ "License" shall mean the terms and conditions for use, reproduction,\r
+ and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+ "Licensor" shall mean the copyright owner or entity authorized by\r
+ the copyright owner that is granting the License.\r
+\r
+ "Legal Entity" shall mean the union of the acting entity and all\r
+ other entities that control, are controlled by, or are under common\r
+ control with that entity. For the purposes of this definition,\r
+ "control" means (i) the power, direct or indirect, to cause the\r
+ direction or management of such entity, whether by contract or\r
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+ outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+ "You" (or "Your") shall mean an individual or Legal Entity\r
+ exercising permissions granted by this License.\r
+\r
+ "Source" form shall mean the preferred form for making modifications,\r
+ including but not limited to software source code, documentation\r
+ source, and configuration files.\r
+\r
+ "Object" form shall mean any form resulting from mechanical\r
+ transformation or translation of a Source form, including but\r
+ not limited to compiled object code, generated documentation,\r
+ and conversions to other media types.\r
+\r
+ "Work" shall mean the work of authorship, whether in Source or\r
+ Object form, made available under the License, as indicated by a\r
+ copyright notice that is included in or attached to the work\r
+ (an example is provided in the Appendix below).\r
+\r
+ "Derivative Works" shall mean any work, whether in Source or Object\r
+ form, that is based on (or derived from) the Work and for which the\r
+ editorial revisions, annotations, elaborations, or other modifications\r
+ represent, as a whole, an original work of authorship. For the purposes\r
+ of this License, Derivative Works shall not include works that remain\r
+ separable from, or merely link (or bind by name) to the interfaces of,\r
+ the Work and Derivative Works thereof.\r
+\r
+ "Contribution" shall mean any work of authorship, including\r
+ the original version of the Work and any modifications or additions\r
+ to that Work or Derivative Works thereof, that is intentionally\r
+ submitted to Licensor for inclusion in the Work by the copyright owner\r
+ or by an individual or Legal Entity authorized to submit on behalf of\r
+ the copyright owner. For the purposes of this definition, "submitted"\r
+ means any form of electronic, verbal, or written communication sent\r
+ to the Licensor or its representatives, including but not limited to\r
+ communication on electronic mailing lists, source code control systems,\r
+ and issue tracking systems that are managed by, or on behalf of, the\r
+ Licensor for the purpose of discussing and improving the Work, but\r
+ excluding communication that is conspicuously marked or otherwise\r
+ designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+ "Contributor" shall mean Licensor and any individual or Legal Entity\r
+ on behalf of whom a Contribution has been received by Licensor and\r
+ subsequently incorporated within the Work.\r
+\r
+ 2. Grant of Copyright License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ copyright license to reproduce, prepare Derivative Works of,\r
+ publicly display, publicly perform, sublicense, and distribute the\r
+ Work and such Derivative Works in Source or Object form.\r
+\r
+ 3. Grant of Patent License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ (except as stated in this section) patent license to make, have made,\r
+ use, offer to sell, sell, import, and otherwise transfer the Work,\r
+ where such license applies only to those patent claims licensable\r
+ by such Contributor that are necessarily infringed by their\r
+ Contribution(s) alone or by combination of their Contribution(s)\r
+ with the Work to which such Contribution(s) was submitted. If You\r
+ institute patent litigation against any entity (including a\r
+ cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+ or a Contribution incorporated within the Work constitutes direct\r
+ or contributory patent infringement, then any patent licenses\r
+ granted to You under this License for that Work shall terminate\r
+ as of the date such litigation is filed.\r
+\r
+ 4. Redistribution. You may reproduce and distribute copies of the\r
+ Work or Derivative Works thereof in any medium, with or without\r
+ modifications, and in Source or Object form, provided that You\r
+ meet the following conditions:\r
+\r
+ (a) You must give any other recipients of the Work or\r
+ Derivative Works a copy of this License; and\r
+\r
+ (b) You must cause any modified files to carry prominent notices\r
+ stating that You changed the files; and\r
+\r
+ (c) You must retain, in the Source form of any Derivative Works\r
+ that You distribute, all copyright, patent, trademark, and\r
+ attribution notices from the Source form of the Work,\r
+ excluding those notices that do not pertain to any part of\r
+ the Derivative Works; and\r
+\r
+ (d) If the Work includes a "NOTICE" text file as part of its\r
+ distribution, then any Derivative Works that You distribute must\r
+ include a readable copy of the attribution notices contained\r
+ within such NOTICE file, excluding those notices that do not\r
+ pertain to any part of the Derivative Works, in at least one\r
+ of the following places: within a NOTICE text file distributed\r
+ as part of the Derivative Works; within the Source form or\r
+ documentation, if provided along with the Derivative Works; or,\r
+ within a display generated by the Derivative Works, if and\r
+ wherever such third-party notices normally appear. The contents\r
+ of the NOTICE file are for informational purposes only and\r
+ do not modify the License. You may add Your own attribution\r
+ notices within Derivative Works that You distribute, alongside\r
+ or as an addendum to the NOTICE text from the Work, provided\r
+ that such additional attribution notices cannot be construed\r
+ as modifying the License.\r
+\r
+ You may add Your own copyright statement to Your modifications and\r
+ may provide additional or different license terms and conditions\r
+ for use, reproduction, or distribution of Your modifications, or\r
+ for any such Derivative Works as a whole, provided Your use,\r
+ reproduction, and distribution of the Work otherwise complies with\r
+ the conditions stated in this License.\r
+\r
+ 5. Submission of Contributions. Unless You explicitly state otherwise,\r
+ any Contribution intentionally submitted for inclusion in the Work\r
+ by You to the Licensor shall be under the terms and conditions of\r
+ this License, without any additional terms or conditions.\r
+ Notwithstanding the above, nothing herein shall supersede or modify\r
+ the terms of any separate license agreement you may have executed\r
+ with Licensor regarding such Contributions.\r
+\r
+ 6. Trademarks. This License does not grant permission to use the trade\r
+ names, trademarks, service marks, or product names of the Licensor,\r
+ except as required for reasonable and customary use in describing the\r
+ origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+ 7. Disclaimer of Warranty. Unless required by applicable law or\r
+ agreed to in writing, Licensor provides the Work (and each\r
+ Contributor provides its Contributions) on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+ implied, including, without limitation, any warranties or conditions\r
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+ PARTICULAR PURPOSE. You are solely responsible for determining the\r
+ appropriateness of using or redistributing the Work and assume any\r
+ risks associated with Your exercise of permissions under this License.\r
+\r
+ 8. Limitation of Liability. In no event and under no legal theory,\r
+ whether in tort (including negligence), contract, or otherwise,\r
+ unless required by applicable law (such as deliberate and grossly\r
+ negligent acts) or agreed to in writing, shall any Contributor be\r
+ liable to You for damages, including any direct, indirect, special,\r
+ incidental, or consequential damages of any character arising as a\r
+ result of this License or out of the use or inability to use the\r
+ Work (including but not limited to damages for loss of goodwill,\r
+ work stoppage, computer failure or malfunction, or any and all\r
+ other commercial damages or losses), even if such Contributor\r
+ has been advised of the possibility of such damages.\r
+\r
+ 9. Accepting Warranty or Additional Liability. While redistributing\r
+ the Work or Derivative Works thereof, You may choose to offer,\r
+ and charge a fee for, acceptance of support, warranty, indemnity,\r
+ or other liability obligations and/or rights consistent with this\r
+ License. However, in accepting such obligations, You may act only\r
+ on Your own behalf and on Your sole responsibility, not on behalf\r
+ of any other Contributor, and only if You agree to indemnify,\r
+ defend, and hold each Contributor harmless for any liability\r
+ incurred by, or claims asserted against, such Contributor by reason\r
+ of your accepting any such warranty or additional liability.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ APPENDIX: How to apply the Apache License to your work.\r
+\r
+ To apply the Apache License to your work, attach the following\r
+ boilerplate notice, with the fields enclosed by brackets "[]"\r
+ replaced with your own identifying information. (Don't include\r
+ the brackets!) The text should be enclosed in the appropriate\r
+ comment syntax for the file format. We also recommend that a\r
+ file or class name and description of purpose be included on the\r
+ same "printed page" as the copyright notice for easier\r
+ identification within third-party archives.\r
+\r
+ Copyright [yyyy] [name of copyright owner]\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+\r
+\r
--- /dev/null
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All Rights Reserved.
+Except as noted, this software is licensed under the Apache License, Version 2.0.
+Please, see the LICENSE.APLv2 file for Apache License, Version 2 terms and conditions.
#!/bin/sh
-. ./config
+source ./config
+
export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
export PATH=$TET_TARGET_PATH/bin:$PATH
-TET_INSTALL_HOST_PATH=/home/nfs_mount/TETware
-TET_INSTALL_TARGET_PATH=/mnt/nfs/TETware
+PKG_NAME=utilX
+TET_INSTALL_HOST_PATH=/var/tmp/dts_fw/TC/TETware
+TET_INSTALL_TARGET_PATH=/opt/home/$PKG_NAME/TETware
-CC = gcc
+include ../config
-C_FILES = $(shell ls *.c)
+CC ?= gcc
-PKGS = elementary ecore-x ecore evas x11 dlog glib-2.0 utilX
+C_FILES = $(shell ls *.c)
+PKGS = $(PKG_NAME)
+PKGS += glib-2.0
+PKGS += ecore-x ecore-evas x11 ecore
+LDFLAGS = `pkg-config --libs $(PKGS)`
LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
-LDFLAGS += `pkg-config --libs $(PKGS)`
-CFLAGS += `pkg-config --cflags $(PKGS)`
-CFLAGS += -I.
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
CFLAGS += -I$(TET_ROOT)/inc/tet3
CFLAGS += -Wall
-#TARGETS = $(C_FILES:%.c=tc-%)
TCS := $(shell ls -1 *.c | cut -d. -f1)
all: $(TCS)
-/testcase/utc_utilx_test
+/testcase/utc_utilx_key_grab_test
+/testcase/utc_utilx_notification_level_test
+/testcase/utc_utilx_screen_shot_test
+/testcase/utc_utilx_opaque_test
+
--- /dev/null
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <tet_api.h>
+#include <X11/Xlib.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+#include <Ecore_Evas.h>
+#include <sys/types.h>
+#include <X11/X.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_utilx_grab_key_excl_p(void);
+static void utc_utilx_grab_key_top_p(void);
+static void utc_utilx_grab_key_share_p(void);
+static void utc_utilx_grab_key_excl_n(void);
+static void utc_utilx_grab_key_top_n(void);
+static void utc_utilx_grab_key_share_n(void);
+static void utc_utilx_ungrab_key_p(void);
+static void utc_utilx_ungrab_key_n(void);
+
+struct tet_testlist tet_testlist[] = {
+ { utc_utilx_grab_key_excl_p, 1 },
+ { utc_utilx_grab_key_top_p, 1 },
+ { utc_utilx_grab_key_share_p, 1 },
+ { utc_utilx_grab_key_excl_n, 1 },
+ { utc_utilx_grab_key_top_n, 1 },
+ { utc_utilx_grab_key_share_n, 1 },
+ { utc_utilx_ungrab_key_p, 1 },
+ { utc_utilx_ungrab_key_n, 1 },
+ // Do not remove below line
+ { NULL, 0 }
+};
+
+Ecore_Evas *ee;
+Ecore_X_Display *disp;
+Ecore_X_Window win;
+
+static void startup(void)
+{
+ /* start of TC */
+ if(!ecore_init()){
+ dts_fail("utilx_grab_key", "failed ecore_init");
+ }
+ if(!ecore_evas_init()){
+ dts_fail("utilx_grab_key", "failed ecore_evas_init");
+ }
+
+ ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 720, 1280);
+ if(!ee){
+ dts_fail("utilx_grab_key", "failed to make window");
+ }
+ ecore_evas_title_set(ee, "Ecore_Evas Template");
+ ecore_evas_borderless_set(ee, 0);
+ ecore_evas_show(ee);
+
+ disp = ecore_x_display_get();
+ if(!disp){
+ dts_fail("utilx_grab_key", "failed to get display");
+ }
+
+ win = ecore_evas_software_x11_window_get(ee);
+ if(!win){
+ dts_fail("utilx_grab_key", "failed to get ecore_x_window");
+ }
+}
+
+static void cleanup(void)
+{
+ /* end of TC */
+ ecore_evas_shutdown();
+ ecore_shutdown();
+}
+
+
+/**
+ * @brief test case of utilx_grab_key() / utilx_ungrab_key()
+ */
+
+static void utc_utilx_grab_key_excl_p(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ grab_result = utilx_grab_key(disp, win, KEY_MEDIA, EXCLUSIVE_GRAB);
+ if( grab_result == 0 )
+ {
+ dts_pass("utilx_grab_key", "passed");
+ ungrab_result = utilx_ungrab_key(disp, win, KEY_MEDIA);
+ if( ungrab_result != 0)
+ dts_fail("utilx_grab_key", "ungrab failed");
+ }
+ else
+ {
+ dts_fail("utilx_grab_key", "failed");
+ }
+}
+
+static void utc_utilx_grab_key_top_p(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ grab_result = utilx_grab_key(disp, win, KEY_STOPCD, TOP_POSITION_GRAB);
+ if( grab_result == 0 )
+ {
+ dts_pass("utilx_grab_key", "passed");
+ ungrab_result = utilx_ungrab_key(disp, win, KEY_STOPCD);
+ if( ungrab_result != 0)
+ dts_fail("utilx_grab_key", "ungrab failed");
+
+ }
+ else
+ {
+ dts_fail("utilx_grab_key", "failed");
+ }
+}
+
+static void utc_utilx_grab_key_share_p(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ grab_result = utilx_grab_key(disp, win, KEY_STOPCD, SHARED_GRAB);
+ if( grab_result == 0 )
+ {
+ dts_pass("utilx_grab_key", "passed");
+ ungrab_result = utilx_ungrab_key(disp, win, KEY_STOPCD);
+ if( ungrab_result != 0)
+ dts_fail("utilx_grab_key", "ungrab failed");
+ }
+ else
+ {
+ dts_fail("utilx_grab_key", "failed");
+ }
+}
+
+static void utc_utilx_grab_key_excl_n(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ grab_result = utilx_grab_key(NULL, win, KEY_STOPCD, EXCLUSIVE_GRAB);
+ if( grab_result != 0 )
+ {
+ dts_pass("utilx_grab_key", "passed");
+ }
+ else
+ {
+ dts_fail("utilx_grab_key", "failed");
+ ungrab_result = utilx_ungrab_key(disp, win, KEY_STOPCD);
+ if( ungrab_result != 0)
+ dts_fail("utilx_grab_key", "ungrab failed");
+
+ }
+}
+
+static void utc_utilx_grab_key_top_n(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ grab_result = utilx_grab_key(NULL, win, KEY_STOPCD, TOP_POSITION_GRAB);
+ if( grab_result != 0 )
+ {
+ dts_pass("utilx_grab_key", "passed");
+ }
+ else
+ {
+ dts_fail("utilx_grab_key", "failed");
+ ungrab_result = utilx_ungrab_key(disp, win, KEY_STOPCD);
+ if( ungrab_result != 0)
+ dts_fail("utilx_grab_key", "ungrab failed");
+
+ }
+}
+
+static void utc_utilx_grab_key_share_n(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ grab_result = utilx_grab_key(NULL, win, KEY_STOPCD, SHARED_GRAB);
+ if( grab_result != 0 )
+ {
+ dts_pass("utilx_grab_key", "passed");
+ }
+ else
+ {
+ dts_fail("utilx_grab_key", "failed");
+ ungrab_result = utilx_ungrab_key(disp, win, KEY_STOPCD);
+ if( ungrab_result != 0)
+ dts_fail("utilx_grab_key", "ungrab failed");
+
+ }
+}
+
+static void utc_utilx_ungrab_key_p(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ grab_result = utilx_grab_key(disp, win, KEY_STOPCD, SHARED_GRAB);
+ if( grab_result != 0 ){
+ dts_fail("utilx_ungrab_key", "failed to grab the key");
+ }
+
+ ungrab_result = utilx_ungrab_key(disp, win, KEY_STOPCD);
+ if(ungrab_result == 0)
+ {
+ dts_pass("utilx_ungrab_key", "passed");
+ }
+ else
+ {
+ dts_fail("utilx_ungrab_key", "failed");
+ }
+}
+
+static void utc_utilx_ungrab_key_n(void)
+{
+ int grab_result;
+ int ungrab_result;
+
+ ungrab_result = utilx_ungrab_key(NULL, win, KEY_STOPCD);
+ if(ungrab_result != 0)
+ {
+ dts_pass("utilx_ungrab_key", "passed");
+ }
+ else
+ {
+ dts_fail("utilx_ungrab_key", "failed");
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <tet_api.h>
+#include <X11/Xlib.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+#include <Ecore_Evas.h>
+#include <sys/types.h>
+#include <X11/X.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_utilx_system_notification_level_test_positive_1(void);
+static void utc_utilx_system_notification_level_test_positive_2(void);
+static void utc_utilx_system_notification_level_test_positive_3(void);
+static void utc_utilx_system_notification_level_test_positive_4(void);
+static void utc_utilx_system_notification_level_test_negative_1(void);
+static void utc_utilx_system_notification_level_test_negative_2(void);
+
+
+struct tet_testlist tet_testlist[] = {
+ { utc_utilx_system_notification_level_test_positive_1, 1 },
+ { utc_utilx_system_notification_level_test_positive_2, 1 },
+ { utc_utilx_system_notification_level_test_positive_3, 1 },
+ { utc_utilx_system_notification_level_test_positive_4, 1 },
+ { utc_utilx_system_notification_level_test_negative_1, 1 },
+ { utc_utilx_system_notification_level_test_negative_2, 1 },
+ // Do not remove below line
+ { NULL, 0 },
+};
+
+Display* dpy;
+Window root, win;
+
+static void startup(void)
+{
+ /* start of TC */
+ tet_printf("\n TC start");
+
+ dpy = XOpenDisplay(NULL);
+ root = XDefaultRootWindow(dpy);
+
+ win = XCreateSimpleWindow(dpy, root, 0, 0, 480, 800, 2, BlackPixel(dpy,0), WhitePixel(dpy,0));
+ XMapWindow(dpy, win);
+}
+
+static void cleanup(void)
+{
+ /* end of TC */
+ tet_printf("\n TC end");
+
+ XDestroyWindow(dpy, win);
+ XCloseDisplay(dpy);
+}
+
+/**
+ * @brief test case of utc_utilx_system_notification_level_test_positive_1()
+ */
+static void utc_utilx_system_notification_level_test_positive_1(void)
+{
+ Utilx_Notification_Level level = UTILX_NOTIFICATION_LEVEL_HIGH;
+
+ utilx_set_system_notification_level(dpy, win, UTILX_NOTIFICATION_LEVEL_LOW);
+ XFlush(dpy);
+
+ level = utilx_get_system_notification_level(dpy, win);
+
+ if (level == UTILX_NOTIFICATION_LEVEL_LOW)
+ {
+ dts_pass("utc_utilx_system_notification_level_test_positive_1", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_system_notification_level_test_positive_1", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_system_notification_level_test_positive_2()
+ */
+static void utc_utilx_system_notification_level_test_positive_2(void)
+{
+ Utilx_Notification_Level level = UTILX_NOTIFICATION_LEVEL_HIGH;
+
+ utilx_set_system_notification_level(dpy, win, UTILX_NOTIFICATION_LEVEL_NORMAL);
+ XFlush(dpy);
+
+ level = utilx_get_system_notification_level(dpy, win);
+
+ if (level == UTILX_NOTIFICATION_LEVEL_NORMAL)
+ {
+ dts_pass("utc_utilx_system_notification_level_test_positive_2", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_system_notification_level_test_positive_2", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_system_notification_level_test_positive_3()
+ */
+static void utc_utilx_system_notification_level_test_positive_3(void)
+{
+ Utilx_Notification_Level level = UTILX_NOTIFICATION_LEVEL_NORMAL;
+
+ utilx_set_system_notification_level(dpy, win, UTILX_NOTIFICATION_LEVEL_HIGH);
+ XFlush(dpy);
+
+ level = utilx_get_system_notification_level(dpy, win);
+
+ if (level == UTILX_NOTIFICATION_LEVEL_HIGH)
+ {
+ dts_pass("utc_utilx_system_notification_level_test_positive_3", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_system_notification_level_test_positive_3", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_system_notification_level_test_positive_4()
+ */
+static void utc_utilx_system_notification_level_test_positive_4(void)
+{
+ Utilx_Notification_Level level = UTILX_NOTIFICATION_LEVEL_HIGH;
+
+ utilx_set_system_notification_level(dpy, win, 100);
+ XFlush(dpy);
+
+ level = utilx_get_system_notification_level(dpy, win);
+
+ if (level == UTILX_NOTIFICATION_LEVEL_LOW)
+ {
+ dts_pass("utc_utilx_system_notification_level_test_positive_4", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_system_notification_level_test_positive_4", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_system_notification_level_test_negative_1()
+ */
+static void utc_utilx_system_notification_level_test_negative_1(void)
+{
+ Ecore_X_Display *dpy2 = NULL;
+ Utilx_Notification_Level level = UTILX_NOTIFICATION_LEVEL_HIGH;
+
+ // invalid display parameter
+ utilx_set_system_notification_level(dpy2, win, UTILX_NOTIFICATION_LEVEL_NORMAL);
+ XFlush(dpy);
+
+ level = utilx_get_system_notification_level(dpy, win);
+
+ if (level == UTILX_NOTIFICATION_LEVEL_LOW)
+ {
+ dts_pass("utc_utilx_system_notification_level_test_negative_1", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_system_notification_level_test_negative_1", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_system_notification_level_test_negative_2()
+ */
+static void utc_utilx_system_notification_level_test_negative_2(void)
+{
+ Ecore_X_Display *dpy2 = NULL;
+ Utilx_Notification_Level level = UTILX_NOTIFICATION_LEVEL_HIGH;
+
+ utilx_set_system_notification_level(dpy, win, UTILX_NOTIFICATION_LEVEL_NORMAL);
+ XFlush(dpy);
+
+ // invalid display parameter
+ level = utilx_get_system_notification_level(dpy2, win);
+
+ if (level == UTILX_NOTIFICATION_LEVEL_LOW)
+ {
+ dts_pass("utc_utilx_system_notification_level_test_negative_2", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_system_notification_level_test_negative_2", "failed");
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <tet_api.h>
+#include <X11/Xlib.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_utilx_window_opaque_state_test_positive_1(void);
+static void utc_utilx_window_opaque_state_test_positive_2(void);
+static void utc_utilx_window_opaque_state_test_negative_1(void);
+static void utc_utilx_window_opaque_state_test_negative_2(void);
+
+
+struct tet_testlist tet_testlist[] = {
+ { utc_utilx_window_opaque_state_test_positive_1, 1 },
+ { utc_utilx_window_opaque_state_test_positive_2, 1 },
+ { utc_utilx_window_opaque_state_test_negative_1, 1 },
+ { utc_utilx_window_opaque_state_test_negative_2, 1 },
+ // Do not remove below line
+ { NULL, 0 },
+};
+
+Display* dpy;
+Window root, win;
+
+static void startup(void)
+{
+ /* start of TC */
+ tet_printf("\n TC start");
+
+ dpy = XOpenDisplay(NULL);
+ root = XDefaultRootWindow(dpy);
+
+ win = XCreateSimpleWindow(dpy, root, 0, 0, 480, 800, 2, BlackPixel(dpy,0), WhitePixel(dpy,0));
+ XMapWindow(dpy, win);
+}
+
+static void cleanup(void)
+{
+ /* end of TC */
+ tet_printf("\n TC end");
+
+ XDestroyWindow(dpy, win);
+ XCloseDisplay(dpy);
+}
+
+
+/**
+ * @brief test case of utc_utilx_window_opaque_state_test_positive_1()
+ */
+static void utc_utilx_window_opaque_state_test_positive_1(void)
+{
+ int ret;
+
+ ret = utilx_set_window_opaque_state(dpy, win, UTILX_OPAQUE_STATE_ON);
+ XFlush(dpy);
+
+ if (ret == 1)
+ {
+ dts_pass("utc_utilx_window_opaque_state_test_positive_1", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_window_opaque_state_test_positive_1", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_window_opaque_state_test_positive_2()
+ */
+static void utc_utilx_window_opaque_state_test_positive_2(void)
+{
+ int ret;
+
+ ret = utilx_set_window_opaque_state(dpy, win, UTILX_OPAQUE_STATE_OFF);
+ XFlush(dpy);
+
+ if (ret == 1)
+ {
+ dts_pass("utc_utilx_window_opaque_state_test_positive_2", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_window_opaque_state_test_positive_2", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_window_opaque_state_test_negative_1()
+ */
+static void utc_utilx_window_opaque_state_test_negative_1(void)
+{
+ int ret;
+
+ ret = utilx_set_window_opaque_state(dpy, win, 100);
+ XFlush(dpy);
+
+ if (ret == 0)
+ {
+ dts_pass("utc_utilx_window_opaque_state_test_positive_2", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_window_opaque_state_test_positive_2", "failed");
+ }
+}
+
+
+/**
+ * @brief test case of utc_utilx_window_opaque_state_test_negative_2()
+ */
+static void utc_utilx_window_opaque_state_test_negative_2(void)
+{
+ int ret;
+
+ ret = utilx_set_window_opaque_state(NULL, win, UTILX_OPAQUE_STATE_ON);
+ XFlush(dpy);
+
+ if (ret == 0)
+ {
+ dts_pass("utc_utilx_window_opaque_state_test_positive_2", "passed");
+ }
+ else
+ {
+ dts_fail("utc_utilx_window_opaque_state_test_positive_2", "failed");
+ }
+}
+
+
+
--- /dev/null
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <tet_api.h>
+#include <X11/Xlib.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+#include <Ecore_Evas.h>
+#include <sys/types.h>
+#include <X11/X.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_utilx_screen_shot_test_positive_1(void);
+static void utc_utilx_screen_shot_test_positive_2(void);
+static void utc_utilx_screen_shot_test_positive_3(void);
+static void utc_utilx_screen_shot_test_negative_1(void);
+static void utc_utilx_screen_shot_test_negative_2(void);
+static void utc_utilx_screen_shot_test_negative_3(void);
+
+struct tet_testlist tet_testlist[] = {
+ { utc_utilx_screen_shot_test_positive_1, 1 },
+ { utc_utilx_screen_shot_test_positive_2, 1 },
+ { utc_utilx_screen_shot_test_positive_3, 1 },
+ { utc_utilx_screen_shot_test_negative_1, 1 },
+ { utc_utilx_screen_shot_test_negative_2, 1 },
+ { utc_utilx_screen_shot_test_negative_3, 1 },
+ // Do not remove below line
+ { NULL, 0 },
+};
+
+Display *dpy;
+int width, height;
+void *dump;
+
+static void startup(void)
+{
+ /* start of TC */
+ tet_printf("\n TC start");
+}
+
+static void cleanup(void)
+{
+ /* end of TC */
+ tet_printf("\n TC end");
+}
+
+/**
+ * @brief test case of utc_utilx_screen_shot_test_positive_1()
+ */
+static void utc_utilx_screen_shot_test_positive_1(void)
+{
+ dpy = XOpenDisplay (NULL);
+
+ dump = utilx_create_screen_shot (dpy, 720, 1280);
+
+ dts_pass ("utc_utilx_screen_shot_test_positive_1", "passed");
+
+ utilx_release_screen_shot ();
+
+ XCloseDisplay(dpy);
+}
+
+
+/**
+ * @brief test case of utc_utilx_screen_shot_test_positive_2()
+ */
+static void utc_utilx_screen_shot_test_positive_2(void)
+{
+ dpy = XOpenDisplay (NULL);
+
+ dump = utilx_create_screen_shot (dpy, 400, 400);
+
+ dts_pass ("utc_utilx_screen_shot_test_positive_2", "passed");
+
+ utilx_release_screen_shot ();
+
+ XCloseDisplay(dpy);
+}
+
+
+/**
+ * @brief test case of utc_utilx_screen_shot_test_positive_3()
+ */
+static void utc_utilx_screen_shot_test_positive_3(void)
+{
+ dpy = XOpenDisplay (NULL);
+
+ dump = utilx_create_screen_shot (dpy, 1280, 720);
+
+ dts_pass ("utc_utilx_screen_shot_test_positive_3", "passed");
+
+ utilx_release_screen_shot ();
+
+ XCloseDisplay(dpy);
+}
+
+/**
+ * @brief test case of utc_utilx_screen_shot_test_negative_1()
+ */
+static void utc_utilx_screen_shot_test_negative_1(void)
+{
+ dump = utilx_create_screen_shot (NULL, 720, 720);
+
+ if (dump == NULL)
+ dts_pass ("utc_utilx_screen_shot_test_negative_1", "passed");
+ else
+ dts_fail ("utc_utilx_screen_shot_test_negative_1", "failed");
+}
+
+
+/**
+ * @brief test case of utc_utilx_screen_shot_test_negative_2()
+ */
+static void utc_utilx_screen_shot_test_negative_2(void)
+{
+ dpy = XOpenDisplay (NULL);
+
+ dump = utilx_create_screen_shot (dpy, 0, 720);
+
+ if (dump == NULL)
+ dts_pass ("utc_utilx_screen_shot_test_negative_2", "passed");
+ else
+ dts_fail ("utc_utilx_screen_shot_test_negative_2", "failed");
+
+ XCloseDisplay(dpy);
+}
+
+
+/**
+ * @brief test case of utc_utilx_screen_shot_test_negative_3()
+ */
+static void utc_utilx_screen_shot_test_negative_3(void)
+{
+ dpy = XOpenDisplay (NULL);
+
+ dump = utilx_create_screen_shot (dpy, 720, 0);
+
+ if (dump == NULL)
+ dts_pass ("utc_utilx_screen_shot_test_negative_3", "passed");
+ else
+ dts_fail ("utc_utilx_screen_shot_test_negative_3", "failed");
+
+ XCloseDisplay(dpy);
+}
+++ /dev/null
-/*
- * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#include <tet_api.h>
-#include <X11/Xlib.h>
-#include <Ecore_X.h>
-#include <utilX.h>
-
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_utilx_enable_indicator(void);
-
-
-struct tet_testlist tet_testlist[] = {
- { utc_utilx_enable_indicator, 1 },
- // Do not remove below line
- { NULL, 0 },
-};
-
-static void startup(void)
-{
- /* start of TC */
-}
-
-static void cleanup(void)
-{
- /* end of TC */
-}
-
-
-/**
- * @brief test case of utilx_enable_indicator()
- */
-static void utc_utilx_enable_indicator(void)
-{
- Display* dpy;
- Window root, win;
- int ret;
-
- dpy = XOpenDisplay(NULL);
- root = XDefaultRootWindow(dpy);
-
- win = XCreateSimpleWindow(dpy, root, 0, 0, 480, 800, 2, BlackPixel(dpy,0), WhitePixel(dpy,0));
- XMapWindow(dpy, win);
-
- // If the win want to show indicator, enables indicator.
- utilx_enable_indicator(dpy, win, 1);
- XFlush(dpy);
-
- ret = 1;
-
- if(ret)
- {
- dts_pass("utc_efl_util_set_notification_window_level_positive", "passed");
- }
- else
- {
- dts_fail("utc_efl_util_set_notification_window_level_positive", "failed");
- }
-}
-
+++ /dev/null
-The Debian Package libslp-utilx
-----------------------------
-
-Comments regarding the Package
-
- -- unknown <wonguk.jeong@samsung.com> Fri, 13 Nov 2009 20:11:57 +0900
+++ /dev/null
-libslp-utilx for Debian
-----------------------
-
-<possible notes regarding this package - if none, delete this file>
-
- -- unknown <wonguk.jeong@samsung.com> Fri, 13 Nov 2009 20:11:57 +0900
+++ /dev/null
-libslp-utilx (0.1.7-5) unstable; urgency=low
-
- * Check the status and the dispmode of screen conf when setting the dispmode
- * Git: slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.7-5
-
- -- SooChan Lim <sc1.lim@samsung.com> Wed, 16 May 2012 11:21:10 +0900
-
-libslp-utilx (0.1.7-4) unstable; urgency=low
-
- * Add screen configuration apis
- * Git: slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.7-4
-
- -- SooChan Lim <sc1.lim@samsung.com> Mon, 14 May 2012 13:44:33 +0900
-
-libslp-utilx (0.1.7-3) unstable; urgency=low
-
- * Change code to use internal atom for indicator according to EFL 1.0 upgrade
- * Git: slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.7-3
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 13 Mar 2012 10:27:51 +0900
-
-libslp-utilx (0.1.7-2) unstable; urgency=low
-
- * Add a key string (KEY_MEDIA) for Earset multimedia key
- * Git: slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.7-2
-
- -- Sung-Jin Park <sj76.park@samsung.com> Thu, 02 Feb 2012 17:18:19 +0900
-
-libslp-utilx (0.1.7-1) unstable; urgency=low
-
- * Fix a bug related to OR_EXCLUSIVE_GRAB mode in utilx_grab_key()
- * Git: slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.7-1
-
- -- Sung-Jin Park <sj76.park@samsung.com> Tue, 20 Dec 2011 11:41:28 +0900
-
-libslp-utilx (0.1.7-0) unstable; urgency=low
-
- * Add an API - utilx_show_capture_effect.
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.7-0
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Wed, 23 Nov 2011 18:36:43 +0900
-
-libslp-utilx (0.1.6-0) unstable; urgency=low
-
- * Add an API - utilx_get_indicator_state.
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.6-0
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Wed, 09 Nov 2011 14:06:14 +0900
-
-libslp-utilx (0.1.5-4) unstable; urgency=low
-
- * Add utilx_s[g]et_window_cardinal_property.
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.5-4
-
- -- Boram Park <boram1288.park@samsung.com> Fri, 21 Oct 2011 16:49:40 +0900
-
-libslp-utilx (0.1.5-3) unstable; urgency=low
-
- * FIX : screen_capture should work even if root_window doesn't have _CB_SCREEN_CAPTURE_DISABLE.
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.5-3
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 20 Oct 2011 16:30:06 +0900
-
-libslp-utilx (0.1.5-2) unstable; urgency=low
-
- * Add utilx_s[g]et_screen_capture.
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.5-2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 20 Oct 2011 16:05:36 +0900
-
-libslp-utilx (0.1.5-1) unstable; urgency=low
-
- * Changed the boilerplate of sources
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.5-1
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Thu, 20 Oct 2011 15:36:18 +0900
-
-libslp-utilx (0.1.5-0) unstable; urgency=low
-
- * Bug fix in utilx_grab_key() for OR_EXCLUSIVE_GRAB mode
- * Add an API:utilx_get_key_status()
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.5-0
-
- -- Sung-Jin Park <sj76.park@samsung.com> Thu, 13 Oct 2011 16:01:50 +0900
-
-libslp-utilx (0.1.4-1) unstable; urgency=low
-
- * Add key symbol strings for Earjack/BT Headset/Multimedia keys
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.4-1
-
- -- Sung-Jin Park <sj76.park@samsung.com> Tue, 11 Oct 2011 09:53:48 +0900
-
-libslp-utilx (0.1.4-0) unstable; urgency=low
-
- * Add a API - utilx_get_system_notification_level
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.4-0
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 04 Oct 2011 12:37:05 +0900
-
-libslp-utilx (0.1.3-1) unstable; urgency=low
-
- * Add overrridable EXCLUSIVE_GRAB mode (OR_EXCLUSIVE_GRAB) in utilx_grab_key()/utilx_ungrab_key()
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.3-1
-
- -- Sung-Jin Park <sj76.park@samsung.com> Wed, 21 Sep 2011 15:26:16 +0900
-
-libslp-utilx (0.1.3-0) unstable; urgency=low
-
- * Add a API - utilx_set_window_opaque_state
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.3-0
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 20 Sep 2011 11:21:57 +0900
-
-libslp-utilx (0.1.2-0) unstable; urgency=low
-
- * Restore a API (utilx_enable_indicator)
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.2-0
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 26 Jul 2011 01:01:25 +0900
-
-libslp-utilx (0.1.1-23) unstable; urgency=low
-
- * Removed unused APIs
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-23
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Mon, 25 Jul 2011 11:21:07 +0900
-
-libslp-utilx (0.1.1-22) unstable; urgency=low
-
- * Fixes build warning (by Hyunsuk Oh)
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-22
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 29 Mar 2011 10:45:00 +0900
-
-libslp-utilx (0.1.1-21) unstable; urgency=low
-
- * [COMP] Disable Demo Feature : Live Magazine & Menu-Screen Demo Animation
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-21
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Mon, 14 Feb 2011 14:59:00 +0900
-
-libslp-utilx (0.1.1-20) unstable; urgency=low
-
- * [COMP] Add Demo Feature : Live Magazine & Menu-Screen Demo Animation
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-20
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Tue, 08 Feb 2011 14:34:06 +0900
-
-libslp-utilx (0.1.1-19) unstable; urgency=low
-
- * Add UTILX_SS_SLOT_ID_NONE enumeration.
- * Remove Warning messages
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-19
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Sun, 16 Jan 2011 19:02:12 +0900
-
-libslp-utilx (0.1.1-18) unstable; urgency=low
-
- * [COMP] change effect type, effect style's enum string more clearly.
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-18
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Mon, 27 Dec 2010 17:21:23 +0900
-
-libslp-utilx (0.1.1-17) unstable; urgency=low
-
- * [COMP] add custom effect related api
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-17
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Wed, 22 Dec 2010 18:25:17 +0900
-
-libslp-utilx (0.1.1-16) unstable; urgency=low
-
- * Disable debug mode
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-16
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Wed, 22 Dec 2010 10:34:51 +0900
-
-libslp-utilx (0.1.1-15) unstable; urgency=low
-
- * Modify not to call retvm_if() and DBG
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-15
-
- -- Sung-Jin Park <sj76.park@samsung.com> Wed, 15 Dec 2010 16:08:50 +0900
-
-libslp-utilx (0.1.1-14) unstable; urgency=low
-
- * Remove a dependency on libslp-applog-dev
- * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
- * Tag: libslp-utilx_0.1.1-14
-
- -- Sung-Jin Park <sj76.park@samsung.com> Wed, 15 Dec 2010 14:39:37 +0900
-
-libslp-utilx (0.1.1-13) unstable; urgency=low
-
- * Add KEY_CANCEL into utilX.h
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-13
-
- -- Sung-Jin Park <sj76.park@samsung.com> Fri, 03 Dec 2010 16:19:58 +0900
-
-libslp-utilx (0.1.1-12) unstable; urgency=low
-
- * Update Documentation
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-12
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Thu, 11 Nov 2010 09:57:39 +0900
-
-libslp-utilx (0.1.1-11) unstable; urgency=low
-
- * Add APIs for activating with group
- * Modify utilx_set_window_rotation_angle function to set old and new angle values
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-11
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Mon, 08 Nov 2010 11:37:59 +0900
-
-libslp-utilx (0.1.1-10) unstable; urgency=low
-
- * Add macros related the length of string corresponds to each hard key
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-10
-
- -- Sung-Jin Park <sj76.park@samsung.com> Fri, 29 Oct 2010 17:20:31 +0900
-
-libslp-utilx (0.1.1-9) unstable; urgency=low
-
- * [COMP] change window effect related name
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-9
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Sun, 24 Oct 2010 15:25:03 +0900
-
-libslp-utilx (0.1.1-8) unstable; urgency=low
-
- * 1. Update documentation
- 2. Add boilerplate in source files
- 3. Add COPYING,AUTHORS files
- 4. Remedy debian/copyright file
- 5. Remove test directory
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-8
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Fri, 22 Oct 2010 14:25:35 +0900
-
-libslp-utilx (0.1.1-7) unstable; urgency=low
-
- * Update documentation about Window Effect for doxygen
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-7
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Fri, 01 Oct 2010 17:19:22 +0900
-
-libslp-utilx (0.1.1-6) unstable; urgency=low
-
- * [COMP] add XSync when effect property is changed.
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-6
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Mon, 20 Sep 2010 21:25:09 +0900
-
-libslp-utilx (0.1.1-5) unstable; urgency=low
-
- * Change documentation about key grab/ungrab for doxygen
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-5
-
- -- Sung-Jin Park <sj76.park@samsung.com> Tue, 07 Sep 2010 18:50:26 +0900
-
-libslp-utilx (0.1.1-4) unstable; urgency=low
-
- * [COMP] Add Feature : set/get window effect state and set fake launch effect
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-4
-
- -- Gwangyeong Mun <kk.moon@samsung.com> Tue, 07 Sep 2010 16:49:12 +0900
-
-libslp-utilx (0.1.1-3) unstable; urgency=low
-
- * Disable debugging log.
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-3
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 31 Aug 2010 16:31:35 +0900
-
-libslp-utilx (0.1.1-2) unstable; urgency=low
-
- * Remove deprecated APIs and remove dependency with sysman and heynoti libraries.
- * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
- * Tag: libslp-utilx_0.1.1-2
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Mon, 19 Jul 2010 15:34:50 +0900
-
-libslp-utilx (0.1.1-1) unstable; urgency=low
-
- * Change doxygen documentation.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.1-1
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 13 Jul 2010 15:48:51 +0900
-
-libslp-utilx (0.1.1-0) unstable; urgency=low
-
- * Change/Add APIs.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.1-0
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Thu, 24 Jun 2010 11:20:53 +0900
-
-libslp-utilx (0.1.0-24) unstable; urgency=low
-
- * Remove postinst file for DAC.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-24
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Thu, 03 Jun 2010 13:30:31 +0900
-
-libslp-utilx (0.1.0-23) unstable; urgency=low
-
- * Change code according to changing of heynoti APIs.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-23
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 01 Jun 2010 11:26:52 +0900
-
-libslp-utilx (0.1.0-22) unstable; urgency=low
-
- * Remove libslp-util dependency.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-22
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Sun, 30 May 2010 13:51:09 +0900
-
-libslp-utilx (0.1.0-21) unstable; urgency=low
-
- * Modify utilX.pc file to link sysman and heynoti library.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-21
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Fri, 28 May 2010 09:58:17 +0900
-
-libslp-utilx (0.1.0-20) unstable; urgency=low
-
- * Replace deprecated core_util_xxx APIs to another APIs.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-20
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Thu, 27 May 2010 16:07:30 +0900
-
-libslp-utilx (0.1.0-19) unstable; urgency=low
-
- * Change debian control file to include libslp-utilx-dev from the SDK.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-19
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Tue, 25 May 2010 22:30:42 +0900
-
-libslp-utilx (0.1.0-18) unstable; urgency=low
-
- * Change debian control file to exclude from the SDK.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-18
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Mon, 03 May 2010 12:01:16 +0900
-
-libslp-utilx (0.1.0-17) unstable; urgency=low
-
- * Add postinst file.
- * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-utilx-0
- * Tag: libslp-utilx_0.1.0-17
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Wed, 21 Apr 2010 13:39:01 +0900
-
-libslp-utilx (0.1.0-16) unstable; urgency=low
-
- * Repackaging (Modify x11.c not to change focus window if lower window is not current focus window.)
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Wed, 31 Mar 2010 15:53:46 +0900
-
-libslp-utilx (0.1.0-15) unstable; urgency=low
-
- * Modify x11.c not to change focus window if lower window is not current focus window.
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Wed, 31 Mar 2010 14:27:35 +0900
-
-libslp-utilx (0.1.0-14) unstable; urgency=low
-
- * Update revision for ToolChain upgrage
-
- -- Sung-Jin Park <sj76.park@samsung.com> Fri, 26 Mar 2010 13:37:37 +0900
-
-libslp-utilx (0.1.0-13) unstable; urgency=low
-
- * Add code for sending "_NET_ACTIVE_WINDOW" client message to raised window.
-
- -- Doyoun Kang <doyoun.kang@samsung.com> Mon, 01 Mar 2010 17:06:23 +0900
-
-libslp-utilx (0.1.0-12) unstable; urgency=low
-
- * Remove applog.h from package
- Modify debian/control to add a dependency with libslp-applog-dev package
-
- -- Sung-Jin Park <sj76.park@samsung.com> Thu, 25 Feb 2010 15:56:59 +0900
-
-libslp-utilx (0.1.0-11) unstable; urgency=low
-
- * Add exception routines
-
- -- Sung-Jin Park <sj76.park@samsung.com> Tue, 23 Feb 2010 23:43:40 +0900
-
-libslp-utilx (0.1.0-10) unstable; urgency=low
-
- * Fix x11.c not to process events when error occurs
-
- -- Sung-Jin Park <sj76.park@samsung.com> Tue, 23 Feb 2010 19:42:07 +0900
-
-libslp-utilx (0.1.0-9) unstable; urgency=low
-
- * Remove __FILENAME__ macro
-
- -- Sung-Jin Park <sj76.park@samsung.com> Thu, 18 Feb 2010 21:04:16 +0900
-
-libslp-utilx (0.1.0-8) unstable; urgency=low
-
- * Fix Exclusive mode error
-
- -- Sung-Jin Park <sj76.park@samsung.com> Fri, 12 Feb 2010 19:13:43 +0900
-
-libslp-utilx (0.1.0-7) unstable; urgency=low
-
- * Fix exclusive mode grab functions
-
- -- Sung-Jin Park <sj76.park@samsung.com> Thu, 11 Feb 2010 22:21:50 +0900
-
-libslp-utilx (0.1.0-6) unstable; urgency=low
-
- * Fix function names with changed external function names
-
- -- Sung-Jin Park <sj76.park@samsung.com> Wed, 27 Jan 2010 10:06:14 +0900
-
-libslp-utilx (0.1.0-5) unstable; urgency=low
-
- * Change all things start with SLP_, SLP- and SLP
-
- -- Sung-Jin Park <sj76.park@samsung.com> Tue, 26 Jan 2010 18:40:28 +0900
-
-libslp-utilx (0.1.0-4) unstable; urgency=low
-
- * Modify utilX.h file (add #include <X11/Xlib.h>)
-
- -- Sung-Jin Park <sj76.park@samsung.com> Fri, 22 Jan 2010 22:18:11 +0900
-
-libslp-utilx (0.1.0-3) unstable; urgency=low
-
- * Change APIs related to key grab
- 2 newly-added APIs, 3 deprecated APIs and 2 removed APIs
-
- -- Sung-Jin Park <sj76.park@samsung.com> Fri, 22 Jan 2010 19:07:59 +0900
-
-libslp-utilx (0.1.0-2) unstable; urgency=low
-
- * Add to the isntall list
-
- -- wonguk.jeong <wonguk.jeong@samsung.com> Mon, 30 Nov 2009 09:32:01 +0000
-
-libslp-utilx (0.1.0-1) unstable; urgency=low
-
- * Initial Release.
-
- -- wonguk.jeong <wonguk.jeong@samsung.com> Fri, 13 Nov 2009 20:11:57 +0900
+++ /dev/null
-Source: libslp-utilx
-Section: libs
-Priority: extra
-Maintainer: Doyoun Kang <doyoun.kang@samsung.com>, Sung-Jin Park <sj76.park@samsung.com>, Gwangyeong Mun <kk.moon@samsung.com>, SooChan Lim <sc1.lim@samsung.com>
-Build-Depends: debhelper (>= 5), autotools-dev, libx11-dev
-Standards-Version: 3.7.2
-
-Package: libslp-utilx-dev
-Section: libs
-Architecture: any
-Depends: libslp-utilx-0 (= ${Source-Version}), libx11-dev
-Description: Utilities of Xwindow (development files)
- Utility functions for the XWindow
-
-Package: libslp-utilx-0
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libx11-6
-Description: Utilities of Xwindow (shared object files)
- Utility functions for the XWindow
+++ /dev/null
-Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License version 2.1.
-
-The full text of the LGPL 2.1 can be found in
-/usr/share/common-licenses
+++ /dev/null
-usr/bin
-usr/sbin
+++ /dev/null
-CMakeLists.txt
+++ /dev/null
-@PREFIX@/lib/*.so*
+++ /dev/null
-@PREFIX@/include/*
-@PREFIX@/lib/pkgconfig/*.pc
+++ /dev/null
-@PREFIX@/lib/*.so*
+++ /dev/null
-@PREFIX@/include/*
-@PREFIX@/lib/pkgconfig/*.pc
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-CFLAGS ?= -Wall -g
-LDFLAGS ?=
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- # Add here commands to configure the package.
- CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX)
-
- touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
-
- # Add here commands to compile the package.
- $(MAKE)
- #docbook-to-man debian/wavplayer.sgml > wavplayer.1
-
- for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
- cat $$f > $${f%.in}; \
- sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
- sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
- done
-
-
- touch $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
-
- # Add here commands to clean up after the build process.
- -$(MAKE) clean
- rm -rf CMakeCache.txt
- rm -rf CMakeFiles
- rm -rf cmake_install.cmake
- rm -rf Makefile
- rm -rf install_manifest.txt
- rm -rf *.so
-
- for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
- rm -f $${f%.in}; \
- done
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/wavplayer.
- $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_install --sourcedir=debian/tmp
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_python
-# dh_installinit
-# dh_installcron
-# dh_installinfo
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
-# dh_perl
- dh_makeshlibs -plibslp-utilx-0
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
--- /dev/null
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __TIZEN_UI_UTILX_DOC_H__
+#define __TIZEN_UI_UTILX_DOC_H__
+
+/**
+ * @internal
+ * @defgroup CAPI_UI_UTILX_MODULE utilX
+ * @brief The utilX API contains Tizen Linux platform X11 utilties.
+ * @ingroup CAPI_UI_FRAMEWORK
+ *
+ * @section CAPI_UI_UTILX_MODULE_HEADER Required Header
+ * \#include <utilX.h>
+ *
+ * @section CAPI_UI_UTILX_MODULE_OVERVIEW Overview
+ * The utilX is a common X11 utility.
+ * It provides functions used by x clients, mainly to get or set the state of X11 resources's information.
+ *
+ */
+
+#endif /* __TIZEN_UI_UTILX_DOC_H__ */
#sbs-git:slp/pkgs/l/libslp-utilx libslp-utilx 0.1.7 5957503c84e65113399e346c7d5618e73957d6ff
Name: libslp-utilx
-Summary: utilX
-Version: 0.1.7
-Release: 1.1
+Summary: utilX
+Version: 0.4.5
+Release: 1
Group: System/Libraries
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xv)
BuildRequires: pkgconfig(xdamage)
+BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(libdrm)
-BuildRequires: pkgconfig(libdrm_slp)
+BuildRequires: pkgconfig(libtbm)
%description
Utility functions for the XWindow
Summary: utilX
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+Requires: pkgconfig(xproto)
+Requires: pkgconfig(x11)
%description devel
Utility functions for the XWindow (developement files)
rm -rf %{buildroot}
%make_install
+# for license notification
+mkdir -p %{buildroot}/usr/share/license
+cp %{_builddir}/%{buildsubdir}/LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
%post -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
/usr/lib/libutilX.so.*
-
+/usr/share/license/%{name}
%files devel
%defattr(-,root,root,-)
-/usr/include/utilX.h
+/usr/include/*
/usr/lib/libutilX.so
/usr/lib/pkgconfig/utilX.pc
*
*/
-#ifndef __SAMSUNG_LINUX_UTIL_X11_H__
-#define __SAMSUNG_LINUX_UTIL_X11_H__
+#ifndef __TIZEN_LINUX_UTIL_X11_H__
+#define __TIZEN_LINUX_UTIL_X11_H__
#ifdef __GNUC__
#define DEPRECATED __attribute__((deprecated))
#endif
/**
- * @defgroup utilX X11 utilities
- * @ingroup lib
- * @brief Samsung Linux platform X11 utilties
- *
- * Common X11 utilities
- * You can use this API with #include <utilX.h>
- */
-
-/**
- * @addtogroup utilX
- * @{
- */
+* @internal
+* @addtogroup CAPI_UI_UTILX_MODULE
+* @{
+*/
#include <sys/types.h>
#include <X11/X.h>
extern "C" {
#endif
+/**
+* @internal
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Volume Up' key.
+ */
+#define KEY_VOLUMEUP "XF86AudioRaiseVolume"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Volume Down' key.
+ */
+#define KEY_VOLUMEDOWN "XF86AudioLowerVolume"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Half-Press of Camera' key.
+ */
+#define KEY_CAMERA "XF86WebCam"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Full-Press of Camera' key.
+ */
+#define KEY_CONFIG "XF86Pictures"
-#define KEY_VOLUMEUP "XF86AudioRaiseVolume" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Up' key */
-#define KEY_VOLUMEDOWN "XF86AudioLowerVolume" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Down' key */
-
-#define KEY_CAMERA "XF86WebCam" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Half-Press of Camera' key */
-#define KEY_CONFIG "XF86Pictures" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Full-Press of Camera' key */
-
-#define KEY_POWER "XF86PowerOff" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Power' key */
-#define KEY_PAUSE "XF86Standby" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause' key */
-#define KEY_CANCEL "Cancel" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Cancel' key */
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Power' key.
+ */
+#define KEY_POWER "XF86PowerOff"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Pause' key.
+ */
+#define KEY_PAUSE "XF86Standby"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Cancel' key.
+ */
+#define KEY_CANCEL "Cancel"
// Earjack/BT Headset/Multimedia keys
-#define KEY_PLAYCD "XF86AudioPlay" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Play Audio' key */
-#define KEY_STOPCD "XF86AudioStop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Stop Audio' key */
-#define KEY_PAUSECD "XF86AudioPause" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause Audio' key */
-#define KEY_NEXTSONG "XF86AudioNext" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Next Song' key */
-#define KEY_PREVIOUSSONG "XF86AudioPrev" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Previous Song' key */
-#define KEY_REWIND "XF86AudioRewind" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Rewind Song' key */
-#define KEY_FASTFORWARD "XF86AudioForward" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Forward Song' key */
-#define KEY_MEDIA "XF86AudioMedia" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Media' key */
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Play Audio' key.
+ */
+#define KEY_PLAYCD "XF86AudioPlay"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Stop Audio' key.
+ */
+#define KEY_STOPCD "XF86AudioStop"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Pause Audio' key.
+ */
+#define KEY_PAUSECD "XF86AudioPause"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Next Song' key.
+ */
+#define KEY_NEXTSONG "XF86AudioNext"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Previous Song' key.
+ */
+#define KEY_PREVIOUSSONG "XF86AudioPrev"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Rewind Song' key.
+ */
+#define KEY_REWIND "XF86AudioRewind"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Forward Song' key.
+ */
+#define KEY_FASTFORWARD "XF86AudioForward"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Media' key.
+ */
+#define KEY_MEDIA "XF86AudioMedia"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'PlayPause' key.
+ */
+#define KEY_PLAYPAUSE "XF86AudioPlayPause"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Mute' key.
+ */
+#define KEY_MUTE "XF86AudioMute"
// 3-Touch key
-#define KEY_SEND "XF86Send" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
-#define KEY_SELECT "XF86Phone" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
-#define KEY_END "XF86Stop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Send' key.
+ */
+#define KEY_SEND "XF86Send"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Home' key.
+ */
+#define KEY_SELECT "XF86Phone"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'End' key.
+ */
+#define KEY_END "XF86Stop"
// Renamed 3-Touch key
-#define KEY_MENU "XF86Send" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
-#define KEY_HOME "XF86Phone" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
-#define KEY_BACK "XF86Stop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Send' key.
+ */
+#define KEY_MENU "XF86Send"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Home' key.
+ */
+#define KEY_HOME "XF86Phone"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'End' key.
+ */
+#define KEY_BACK "XF86Stop"
-#define LEN_KEY_VOLUMEUP 20 /**< this macro is the length of string corresponds to 'Volume Up' key */
-#define LEN_KEY_VOLUMEDOWN 20 /**< this macro is the length of string corresponds to 'Volume Down' key */
+//Other functions keys
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'HomePage' key.
+ */
+#define KEY_HOMEPAGE "XF86HomePage"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'WWW' key.
+ */
+#define KEY_WEBPAGE "XF86WWW"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Mail' key.
+ */
+#define KEY_MAIL "XF86Mail"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'ScreenSaver' key.
+ */
+#define KEY_SCREENSAVER "XF86ScreenSaver"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'BrightnessUp' key.
+ */
+#define KEY_BRIGHTNESSUP "XF86MonBrightnessUp"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'BrightnessDown' key.
+ */
+#define KEY_BRIGHTNESSDOWN "XF86MonBrightnessDown"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Soft keyboard(toggle)' key.
+ */
+#define KEY_SOFTKBD "XF86MenuKB"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Quick panel(toggle)' key.
+ */
+#define KEY_QUICKPANEL "XF86Tools"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Task switcher(toggle)' key.
+ */
+#define KEY_TASKSWITCH "XF86TaskPane"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Apptray(toggle)' key.
+ */
+#define KEY_APPS "XF86Launch0"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Search(toggle)' key.
+ */
+#define KEY_SEARCH "XF86Search"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Voice(toggle)' key.
+ */
+#define KEY_VOICE "XF86Launch2"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Language(toggle)' key.
+ */
+#define KEY_LANGUAGE "Hangul"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Call(toggle)' key.
+ */
+#define KEY_CONNECT "XF86Go"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Play(toggle)' key.
+ */
+#define KEY_GAMEPLAY "XF86Game"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Voice Wakeup LPSD' key.
+ */
+#define KEY_VOICEWAKEUP_LPSD "XF86Launch3"
+/**
+ * @brief Definition for XKeySym (XServer Key Symbol) corresponding to the 'Voice Wakeup' key.
+ */
+#define KEY_VOICEWAKEUP "XF86Launch4"
-#define LEN_KEY_CAMERA 10 /**< this macro is the length of string corresponds to 'Half-Press of Camera' key */
-#define LEN_KEY_CONFIG 12 /**< this macro is the length of string corresponds to 'Full-Press of Camera' key */
+/**
+ * @brief Definition for the length of a string corresponding to the 'Volume Up' key.
+ */
+#define LEN_KEY_VOLUMEUP 20
+/**
+ * @brief Definition for the length of a string corresponding to the 'Volume Down' key.
+ */
+#define LEN_KEY_VOLUMEDOWN 20
-#define LEN_KEY_POWER 12 /**< this macro is the length of string corresponds to 'Power' key */
-#define LEN_KEY_PAUSE 11 /**< this macro is the length of string corresponds to 'Pause' key */
+/**
+ * @brief Definition for the length of a string corresponding to the 'Half-Press of Camera' key.
+ */
+#define LEN_KEY_CAMERA 10
+/**
+ * @brief Definition for the length of a string corresponding to the 'Full-Press of Camera' key.
+ */
+#define LEN_KEY_CONFIG 12
+
+/**
+ * @brief Definition for the length of a string corresponding to the 'Power' key.
+ */
+#define LEN_KEY_POWER 12
+/**
+ * @brief Definition for the length of a string corresponding to the 'Pause' key.
+ */
+#define LEN_KEY_PAUSE 11
// Earjack/BT Headset/Multimedia keys
-#define LEN_KEY_PLAYCD 13/**< this macro is the length of string corresponds to 'Play Audio' key */
-#define LEN_KEY_STOPCD 13/**< this macro is the length of string corresponds to 'Stop Audio' key */
-#define LEN_KEY_PAUSECD 14/**< this macro is the length of string corresponds to 'Pause Audio' key */
-#define LEN_KEY_NEXTSONG 13/**< this macro is the length of string corresponds to 'Next Song' key */
-#define LEN_KEY_PREVIOUSSONG 13/**< this macro is the length of string corresponds to 'Previous Song' key */
-#define LEN_KEY_REWIND 15/**< this macro is the length of string corresponds to 'Rewind Song' key */
-#define LEN_KEY_FASTFORWARD 16/**< this macro is the length of string corresponds to 'Forwand Song' key */
-#define LEN_KEY_MEDIA 14/**< this macro is the length of string corresponds to 'Media' key */
+/**
+ * @brief Definition for the length of a string corresponding to the 'Play Audio' key.
+ */
+#define LEN_KEY_PLAYCD 13
+/**
+ * @brief Definition for the length of a string corresponding to the 'Stop Audio' key.
+ */
+#define LEN_KEY_STOPCD 13
+/**
+ * @brief Definition for the length of a string corresponding to the 'Pause Audio' key.
+ */
+#define LEN_KEY_PAUSECD 14
+/**
+ * @brief Definition for the length of a string corresponding to the 'Next Song' key.
+ */
+#define LEN_KEY_NEXTSONG 13
+/**
+ * @brief Definition for the length of a string corresponding to the 'Previous Song' key.
+ */
+#define LEN_KEY_PREVIOUSSONG 13
+/**
+ * @brief Definition for the length of a string corresponding to the 'Rewind Song' key.
+ */
+#define LEN_KEY_REWIND 15
+/**
+ * @brief Definition for the length of a string corresponding to the 'Forwand Song' key.
+ */
+#define LEN_KEY_FASTFORWARD 16
+/**
+ * @brief Definition for the length of a string corresponding to the 'Media' key.
+ */
+#define LEN_KEY_MEDIA 14
+/**
+ * @brief Definition for the length of a string corresponding to the 'PlayPause' key.
+ */
+#define LEN_KEY_PLAYPAUSE 13
+/**
+ * @brief Definition for the length of a string corresponding to the 'Mute' key.
+ */
+#define LEN_KEY_MUTE 13
// 3-Touch key
-#define LEN_KEY_SEND 8 /**< this macro is the length of string corresponds to 'Send' key */
-#define LEN_KEY_SELECT 9 /**< this macro is the length of string corresponds to 'Home' key */
-#define LEN_KEY_END 8 /**< this macro is the length of string corresponds to 'End' key */
+/**
+ * @brief Definition for the length of a string corresponding to the 'Send' key.
+ */
+#define LEN_KEY_SEND 8
+/**
+ * @brief Definition for the length of a string corresponding to the 'Home' key.
+ */
+#define LEN_KEY_SELECT 9
+/**
+ * @brief Definition for the length of a string corresponding to the 'End' key.
+ */
+#define LEN_KEY_END 8
// Renamed 3-Touch key
-#define LEN_KEY_MENU 8 /**< this macro is the length of string corresponds to 'Send' key */
-#define LEN_KEY_HOME 9 /**< this macro is the length of string corresponds to 'Home' key */
-#define LEN_KEY_BACK 8 /**< this macro is the length of string corresponds to 'End' key */
-
-#define OR_EXCLUSIVE_GRAB 0xf00000 /**< this means that the client window will always get the grabbed-key exclusively regardless of the position on the window stack but the grab is overridable by the other client window */
-#define EXCLUSIVE_GRAB 0x0f0000 /**< this means that the client window will always get the grabbed-key exclusively regardless of the position on the window stack */
-#define TOP_POSITION_GRAB 0x00f000 /**< this means that the client window will get the grabbed-key only when on the top of the grabbing-window stack */
-#define SHARED_GRAB 0x000f00 /**< this means that the client window will get the grabbed-key together with the other client window(s) */
-#define GRAB_MODE_MASK 0xffff00 /**< this mask will be used for getting the key-grab mode of a client window */
-
-#define EXCLUSIVE_GRABBED_ALREADY 1 /**< this means that the client window is grabbing the key already in EXCLUSIVE mode */
-
-#define STR_ATOM_GRAB_KEY "_GRAB_KEY" /**< this is an XATOM for getting/setting the property for grabbing a key for a window */
-#define STR_ATOM_GRAB_EXCL_WIN "_GRAB_EXCL_WIN_KEYCODE" /**< this means that the key was grabbed by a client window in EXCLUSIVE mod */
-#define STR_ATOM_GRAB_OR_EXCL_WIN "_GRAB_OR_EXCL_WIN_KEYCODE" /**< this means that the key was grabbed by a client window in OR_EXCLUSIVE mod */
-
-#define STR_ATOM_SCRNCONF_STATUS "_SCRNCONF_STATUS" /**< this is an XATOM for getting the status of the screen configuration through the client message */
-
/**
- * @brief Enumeration of screen configuration status
+ * @brief Definition for the length of a string corresponding to the 'Send' key.
*/
-typedef enum _Utilx_Scrnconf_Status
-{
- UTILX_SCRNCONF_STATUS_NULL, /**< screen configuration status is null */
- UTILX_SCRNCONF_STATUS_CONNECT, /**< screen configuration status is connect */
- UTILX_SCRNCONF_STATUS_ACTIVE /**< screen configuration status is active */
-} Utilx_Scrnconf_Status;
-
+#define LEN_KEY_MENU 8
/**
- * @brief Enumeration of screen configuration display mode
+ * @brief Definition for the length of a string corresponding to the 'Home' key.
*/
-typedef enum _Utilx_Scrnconf_Dispmode
-{
- UTILX_SCRNCONF_DISPMODE_NULL, /**< display mode of screen configuration is null */
- UTILX_SCRNCONF_DISPMODE_CLONE, /**< display mode of screen configuration is clone */
- UTILX_SCRNCONF_DISPMODE_EXTENDED /**< display mode of screen configuration is extended */
-} Utilx_Scrnconf_Dispmode;
-
-
+#define LEN_KEY_HOME 9
/**
- * @brief Enumeration of key status
+ * @brief Definition for the length of a string corresponding to the 'End' key.
*/
-typedef enum _Utilx_Key_Status
-{
- UTILX_KEY_STATUS_PRESSED, /**< key status is pressed */
- UTILX_KEY_STATUS_RELEASED, /**< key status is released */
- UTILX_KEY_STATUS_UNKNOWN /** < key status is unknown or error happened */
-} Utilx_Key_Status;
+#define LEN_KEY_BACK 8
+//Other functions keys
/**
- * @brief Enumeration of notification window's priority level
+ * @brief Definition for the length of a string corresponding to the 'HomePage' key.
*/
-typedef enum _Utilx_Notification_Level
-{
- UTILX_NOTIFICATION_LEVEL_LOW, /**< low level notification */
- UTILX_NOTIFICATION_LEVEL_NORMAL, /**< normal level notification*/
- UTILX_NOTIFICATION_LEVEL_HIGH /**< high level notification */
-} Utilx_Notification_Level;
-
+#define LEN_KEY_HOMEPAGE 12
/**
- * @brief Enumeration of Compositing Window Manager's Effect Type
+ * @brief Definition for the length of a string corresponding to the 'WWW' key.
*/
-typedef enum _Utilx_Effect_Type
-{
- UTILX_EFFECT_TYPE_MAP, /**< Effect for Window's Map Notify Event */
- UTILX_EFFECT_TYPE_UNMAP, /**< Effect for Window's UnMap Notify Event */
- UTILX_EFFECT_TYPE_RAISEABOVE, /**< Effect for Window's Configure Notify ( RaiseAbove case ) Event */
- UTILX_EFFECT_TYPE_ROTATION, /**< Effect for Window's Rotation Property Change Notify Event ( X Property: ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE ) */
- UTILX_EFFECT_TYPE_FOCUSIN, /**< Effect for Window's FocusIn Event ( E17's Event: E_EVENT_BORDER_FOCUS_IN ) */
- UTILX_EFFECT_TYPE_FOCUSOUT /**< Effect for Window's FocusOut Event ( E17's Event : E_EVENT_BORDER_FOCUS_OUT ) */
-} Utilx_Effect_Type;
-
+#define LEN_KEY_WEBPAGE 7
/**
- * @brief Enumeration of Compositing Window Manager's Effect Style
+ * @brief Definition for the length of a string corresponding to the 'Mail' key.
*/
-typedef enum _Utilx_Effect_Style
-{
- UTILX_EFFECT_STYLE_DEFAULT, /**< Default Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_NONE, /**< None of Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM0, /**< Custom0 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM1, /**< Custom1 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM2, /**< Custom2 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM3, /**< Custom3 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM4, /**< Custom4 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM5, /**< Custom5 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM6, /**< Custom6 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM7, /**< Custom7 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM8, /**< Custom8 Effect Style for Effect Type */
- UTILX_EFFECT_STYLE_CUSTOM9 /**< Custom9 Effect Style for Effect Type */
-} Utilx_Effect_Style;
-
-/**
- * @brief Enumeration of opaque state
+#define LEN_KEY_MAIL 8
+/**
+ * @brief Definition for the length of a string corresponding to the 'ScreenSaver' key.
*/
-typedef enum _Utilx_Opaque_State
-{
- UTILX_OPAQUE_STATE_OFF = 0, /**< Transparent state */
- UTILX_OPAQUE_STATE_ON = 1, /**< Opaque state */
-} Utilx_Opaque_State;
-
+#define LEN_KEY_SCREENSAVER 15
/**
- * @brief Structure of screen configuration information
+ * @brief Definition for the length of a string corresponding to the 'BrightnessUp' key.
*/
-typedef struct _UtilxScrnConf
-{
- char *str_output; /**< string value for the connector type */
- Utilx_Scrnconf_Status status; /**< status of screen configurtaion */
- char *str_resolution; /**< string value for the resolution to be active status */
- Utilx_Scrnconf_Dispmode dispmode; /**< display mode of screen configuration to be active status */
-} UtilxScrnConf;
-
+#define LEN_KEY_BRIGHTNESSUP 19
/**
- * @fn ScrnConf *utilx_scrnconf_allocate(void)
- * @brief allocate the UtilxScrnConf structure
- *
- * This function allocate the UtilxScrnConf structure.\n
- *
- * @remark This is used only application which want to know the screen configuration info.
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_scrnconf_allocate
- * @par Example
- @code
- #include <utilX.h>
- ...
-
- UtilxScrnConf *scrnconf = NULL;
-
- // Allocate the UtilxScrnConf structure
- scrnconf = utilx_scrnconf_allocate();
- ...
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'BrightnessDown' key.
*/
-UtilxScrnConf *utilx_scrnconf_allocate (void);
-
+#define LEN_KEY_BRIGHTNESSDOWN 21
/**
- * @fn void utilx_scrnconf_free (UtilxScrnConf *scrnconf)
- * @brief free the UtilxScrnConf structure
- *
- * This function free the UtilxScrnConf structure.\n
- *
- * @param[in] scrnconf Specifies the UtilxScrnConf structure
- * @return instance of the UtilxScrnConf structure
- * @remark This is used only application which want to know the screen configuration info.
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_scrnconf_free
- * @par Example
- @code
- #include <utilX.h>
- ...
-
- UtilxScrnConf *scrnconf = NULL;
-
- // Allocate the UtilxScrnConf structure
- scrnconf = utilx_scrnconf_allocate();
- ...
-
- // Free the UtilxScrnConf structure
- utilx_scrnconf_free(scrnconf);
- ...
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'Soft keyboard(toggle)' key.
*/
-void utilx_scrnconf_free (UtilxScrnConf *scrnconf);
-
+#define LEN_KEY_SOFTKBD 10
/**
- * @fn void utilx_scrnconf_get_info (Display *dpy, UtilxScrnConf *scrnconf)
- * @brief get the information of the screen configuration
- *
- * This function get the information of the screen configuration.\n
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] scrnconf Specifies the information structure of the screen configuration
- * @remark This is used only application which want to know the screen configuration info.
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_scrnconf_get_info
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
- ...
-
- Display* dpy;
- UtilxScrnConf *scrnconf = NULL;
-
- dpy = XOpenDisplay (NULL);
-
- // Allocate the UtilxScrnConf structure
- scrnconf = utilx_scrnconf_allocate();
- ...
-
- // Set the display mode for the screen configuration
- utilx_scrnconf_get_info (dpy, scrnconf);
- ...
-
- // Free the UtilxScrnConf structure
- utilx_scrnconf_free(scrnconf);
- ...
-
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'Quick panel(toggle)' key.
*/
-void utilx_scrnconf_get_info (Display *dpy, UtilxScrnConf *scrnconf);
-
-
+#define LEN_KEY_QUICKPANEL 9
/**
- * @fn void utilx_scrnconf_set_dispmode (Display *dpy, Utilx_Scrnconf_Dispmode dispmode)
- * @brief set the display mode for the screen configuration
- *
- * This function set the display mode for the screen configuration.\n
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] dipmode Specifies the display mode of the screen configuration
- * @return 1 if setting the dispmode is succeeded, 0 if setting the dispmode is failed.
- * @remark This is used only application which want to set the display mode of the screen configuration.
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_scrnconf_set_dispmode
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
- ...
-
- Display* dpy;
-
- dpy = XOpenDisplay (NULL);
-
- // Set the display mode for the screen configuration
- utilx_scrnconf_set_dispmode (dpy, UTILX_SCRNCONF_DISPMODE_CLONE);
- ...
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'Task switcher(toggle)' key.
*/
-int utilx_scrnconf_set_dispmode (Display *dpy, Utilx_Scrnconf_Dispmode dispmode);
-
-
+#define LEN_KEY_TASKSWITCH 12
/**
- * @fn void utilx_set_system_notification_level (Display* dpy, Window win, Utilx_Notification_Level level)
- * @brief Sets the priority level for the specified notification window
- *
- * This function sets the priority level of the notification windows.\n
- * Every notification window has a base priority level by the notification window's priority value. (Default priority is UTILX_NOTIFICATION_LEVEL_LOW)
- *
- * The priority is used for ordering of notification windows.\n
- * The notification window which is set UTILX_NOTIFICATION_LEVEL_HIGH priority will be placed to the top of notification windows.\n
- * If there are notification windows that have same priorities, the latest created notification window is placed on the other window.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window to be set
- * @param[in] level Specifies the level (UTILX_NOTIFICATION_LEVEL_LOW, UTILX_NOTIFICATION_LEVEL_NORMAL, UTILX_NOTIFICATION_LEVEL_HIGH)
- * @remark This is used only notification window.
- * @pre The win should be notification type window
- * @post None
- * @see utilx_get_system_notification_level
- * @par Example
- @code
- #include <utilX.h>
-
- ...
-
- Evas_Object *win;
- Ecore_X_Window xwin;
-
- win = create_mwnd();
- xwin = elm_win_xwindow_get(win);
-
- // Set Notification type
- ecore_x_netwm_window_type_set (xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
-
- // Set Notification's priority
- utilx_set_system_notification_level (ecore_x_display_get(), xwin, UTILX_NOTIFICATION_LEVEL_HIGH);
-
- ...
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'Apptray(toggle)' key.
*/
-void utilx_set_system_notification_level (Display* dpy, Window win, Utilx_Notification_Level level);
-
+#define LEN_KEY_APPS 11
/**
- * @fn Utilx_Notification_Level utilx_get_system_notification_level (Display* dpy, Window win)
- * @brief Gets the priority level for the specified notification window
- *
- * This function returns the priority level of the notification windows.\n
- * If a user didn't set the notification's priority level, this function returns default value (UTILX_NOTIFICATION_LEVEL_LOW).
- *
- * This function is a synchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window to be get
- * @return current notication level (UTILX_NOTIFICATION_LEVEL_LOW, UTILX_NOTIFICATION_LEVEL_NORMAL, UTILX_NOTIFICATION_LEVEL_HIGH)
- * @remark This is used only notification window.
- * @pre The win should be notification type window
- * @post None
- * @see utilx_set_system_notification_level
- * @par Example
- @code
- #include <utilX.h>
-
- ...
-
- Evas_Object *win;
- Ecore_X_Window xwin;
- Utilx_Notification_Level level;
-
- win = elm_win_add (NULL, "test", ELM_WIN_NOTIFICATION);
- xwin = elm_win_xwindow_get(win);
-
- level = utilx_get_system_notification_level (ecore_x_display_get(), xwin);
-
- ...
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'Search(toggle)' key.
*/
-Utilx_Notification_Level utilx_get_system_notification_level (Display* dpy, Window win);
-
+#define LEN_KEY_SEARCH 10
/**
- * @fn void utilx_enable_indicator (Display* dpy, Window win, int enable)
- * @brief Sets the window to show/hide the indicator
- *
- * This function enables or disables the indicator.
- *
- * If an application wants to show the window with the indicator, the application must call this function with 1 as the enable parameter.\n
- * Otherwise, the application must call this function with 0 as the enable parameter.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window to use indicator
- * @param[in] enable Specifies whether the window use indicator or not
- * @remark None
- * @pre None
- * @post If the enable is 1, then the indicator window should be shown on the screen. Otherwise, the indicator window should be hidden from the screen.
- * @see elm_win_indicator_state_set, utilx_get_indicator_state
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
-
- ...
-
- Display* dpy;
- Window root, win;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
-
- win = XCreateSimpleWindow (dpy, root, 0, 0, 480, 800, 2, BlackPixel (dpy,0), WhitePixel(dpy,0));
- XMapWindow (dpy, win);
-
- // If the win want to show indicator, enables indicator.
- utilx_enable_indicator (dpy, win, 1);
- XFlush (d);
-
- // If the win want to hide indicator, disables indicator.
- utilx_enable_indicator (dpy, win, 0);
- XFlush (d);
-
- ...
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'Voice(toggle)' key.
*/
-void utilx_enable_indicator (Display* dpy, Window win, int enable);
-
+#define LEN_KEY_VOICE 11
/**
- * @fn int utilx_get_indicator_state (Display* dpy, Window win)
- * @brief Gets the indicator's state of the specified window
- *
- * This function gets the indicator's state of the specified window.
- *
- * An application can set the indicator's state using utilx_enable_indicator or elm_win_indicator_state_set.
- * If an application sets enables the indicator, this returns 1.\n
- * If an application disables the indicator, this returns 0.\n
- * If an application doesn't set the indicator's state, in other words,
- * an application doesn't call utilx_enable_indicator or elm_win_indicator_state_set,
- * this returns -1.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window to get the indicator's state
- * @return 1 if the indicator is enabled, 0 if the indicator is disabled, otherwise -1
- * @remark None
- * @pre None
- * @post None
- * @see elm_win_indicator_state_set, utilx_enable_indicator
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
-
- ...
-
- Display* dpy;
- Window root, win;
- int state;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
-
- win = XCreateSimpleWindow (dpy, root, 0, 0, 480, 800, 2, BlackPixel (dpy,0), WhitePixel(dpy,0));
- XMapWindow (dpy, win);
-
- state = utilx_get_indicator_state (dpy, win)
- // state is -1 (unknown)
-
- // If the win want to show indicator, enables indicator.
- utilx_enable_indicator (dpy, win, 1);
- XFlush (d);
-
- state = utilx_get_indicator_state (dpy, win)
- // state is 1 (enabled)
-
- // If the win want to hide indicator, disables indicator.
- utilx_enable_indicator (dpy, win, 0);
- XFlush (d);
-
- state = utilx_get_indicator_state (dpy, win)
- // state is 0 (disabled)
-
- ...
- @endcode
+ * @brief Definition for the length of a string corresponding to the 'Language(toggle)' key.
*/
-int utilx_get_indicator_state (Display* dpy, Window win);
-
-
+#define LEN_KEY_LANGUAGE 6
/**
- * @fn int utilx_grab_key (Display* dpy, Window win, const char* key_name, int grab_mode)
- * @brief Grabs a key specfied by key_name for win in grab_mode
- *
- * This function establishs a grab of the specified key for the specified window.\n
- * Once a key was grabbed, all events originated from the key will only be reported to the specfied window.\n
- * The grab of the key will be released by calling utilx_ungrab_key.
- *
- * This function is synchronous.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window to grab a key
- * @param[in] key_name Name of a key in string (ex> KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_SEND and so on)
- * @param[in] grab_mode Grab mode (such as EXCLUSIVE_GRAB, TOP_POSITION_GRAB and SHARED_GRAB)
- * @return 0 on Success, otherwise Fail
- * @remark If utilx_grab_key() returns 0, the specified window will get the events of the specified key.\n
- However, delivery of a key can always be changed by other applications grabbing the key with higher priority.\n
- It can also be changed by the changes of window stacks.\n
- Trial for choosing a proper grab mode will be needed.
- * @pre This API must be called after the window 'win' has been mapped
- * @post This API adds/changes the window property related to grabbed key
- * @see utilx_ungrab_key
- * @par Example (using X11 APIs)
- @code
-
- // EXCLUSIVE_GRAB //
-
- #include <X11/Xlib.h>
- #include <utilX.h>
-
- int main()
- {
- Display *disp = XOpenDisplay(NULL);
- XEvent e;
- int grab_result;
- Window w = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 5,5, 470, 780, 2, BlackPixel(d,0), WhitePixel(d,0));
- XSelectInput(disp, w, StructureNotifyMask | KeyPressMask | KeyReleaseMask);
- XMapWindow(disp, w);
-
- while(1)
- {
- XNextEvent(disp, &e);
- switch(e.type)
- {
- case MapNotify:
- grab_result = utilx_grab_key(disp, w, KEY_POWER, EXCLUSIVE_GRAB);
- if( EXCLUSIVE_GRABBED_ALREADY == grab_result )
- return -1;
- break;
- }
- ...
- }
- ...
-
- utilx_ungrab_key(disp, win, KEY_POWER);
- return 0;
- }
-
- // TOP_POSITION_GRAB //
-
- #include <X11/Xlib.h>
- #include <utilX.h>
-
- int main()
- {
- Display *disp = XOpenDisplay(NULL);
- XEvent e;
- Window w = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 5,5, 470, 780, 2, BlackPixel(d,0), WhitePixel(d,0));
- XSelectInput(disp, w, StructureNotifyMask | KeyPressMask | KeyReleaseMask);
- XMapWindow(disp, w);
-
- while(1)
- {
- XNextEvent(disp, &e);
- switch(e.type)
- {
- case MapNotify:
- utilx_grab_key(disp, w, KEY_POWER, TOP_POSITION_GRAB);
- break;
- }
- ...
- }
- ...
-
- utilx_ungrab_key(disp, win, KEY_POWER);
- return 0;
- }
-
- // SHARED_GRAB //
-
- #include <X11/Xlib.h>
- #include <utilX.h>
-
- int main()
- {
- Display *disp = XOpenDisplay(NULL);
- XEvent e;
- Window w = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 5,5, 470, 780, 2, BlackPixel(d,0), WhitePixel(d,0));
- XSelectInput(disp, w, StructureNotifyMask | KeyPressMask | KeyReleaseMask);
- XMapWindow(disp, w);
-
- while(1)
- {
- XNextEvent(disp, &e);
- switch(e.type)
- {
- case MapNotify:
- utilx_grab_key(disp, w, KEY_POWER, SHARED_GRAB);
- break;
- }
- ...
- }
- ...
-
- utilx_ungrab_key(disp, win, KEY_POWER);
- return 0;
- }
-
- @endcode
- * @par Example (using EFL APIs)
- @code
-
- // EXCLUSIVE_GRAB //
-
- #include <utilX.h>
- #include <Ecore_Evas.h>
- #include <Ecore_X.h>
-
- int main()
- {
- ...
+ * @brief Definition for the length of a string corresponding to the 'Call(toggle)' key.
+ */
+#define LEN_KEY_CONNECT 6
+/**
+ * @brief Definition for the length of a string corresponding to the 'Play(toggle)' key.
+ */
+#define LEN_KEY_GAMEPLAY 8
+/**
+ * @brief Definition for the length of a string corresponding to the 'Voice Wakeup LPSD' key.
+ */
+#define LEN_KEY_VOICEWAKEUP_LPSD 11
+/**
+ * @brief Definition for the length of a string corresponding to the 'Voice Wakeup' key.
+ */
+#define LEN_KEY_VOICEWAKEUP 11
- Ecore_X_Display* disp = ecore_x_display_get();
- Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
+/**
+ * @brief Definition for getting the grabbed-key exclusively regardless of its position on the window stack with the possibility of overriding the grab by the other client window mode.
+ */
+#define OR_EXCLUSIVE_GRAB 0xf00000
+/**
+ * @brief Definition for getting the grabbed-key exclusively regardless of its position on the window stack mode.
+ */
+#define EXCLUSIVE_GRAB 0x0f0000
+/**
+ * @brief Definition for getting the grabbed-key only when on the top of the grabbing-window stack mode.
+ */
+#define TOP_POSITION_GRAB 0x00f000
+/**
+ * @brief Definition for getting the grabbed-key together with the other client window(s) mode.
+ */
+#define SHARED_GRAB 0x000f00
+/**
+ * @brief Definition for getting the key-grab mode of a client window.
+ */
+#define GRAB_MODE_MASK 0xffff00
- int grab_result = utilx_grab_key(disp, win, KEY_POWER, EXCLUSIVE_GRAB);
- if( EXCLUSIVE_GRABBED_ALREADY == grab_result )
- return -1;
+/**
+ * @brief Definition for the client window grabbing the key which is already in the EXCLUSIVE mode.
+ */
+#define EXCLUSIVE_GRABBED_ALREADY 1
- ...
+/**
+ * @brief Definition for getting/setting the property while grabbing a key for a window.
+ */
+#define STR_ATOM_GRAB_KEY "_GRAB_KEY"
+/**
+ * @brief Definition for the key grabbed by a client window in the EXCLUSIVE mode.
+ */
+#define STR_ATOM_GRAB_EXCL_WIN "_GRAB_EXCL_WIN_KEYCODE"
+/**
+ * @brief Definition for the key grabbed by a client window in the OR_EXCLUSIVE mode.
+ */
+#define STR_ATOM_GRAB_OR_EXCL_WIN "_GRAB_OR_EXCL_WIN_KEYCODE"
- utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever you want to ¡¦
- return 0;
- }
+/**
+ * @brief Enumeration for notification window's priority level.
+ */
+typedef enum _Utilx_Notification_Level
+{
+ UTILX_NOTIFICATION_LEVEL_LOW, /**< Low level notification */
+ UTILX_NOTIFICATION_LEVEL_NORMAL, /**< Normal level notification*/
+ UTILX_NOTIFICATION_LEVEL_HIGH /**< High level notification */
+} Utilx_Notification_Level;
- // TOP_POSITION_GRAB //
+/**
+ * @brief Enumeration for the opaque state.
+ */
+typedef enum _Utilx_Opaque_State
+{
+ UTILX_OPAQUE_STATE_OFF = 0, /**< Transparent state */
+ UTILX_OPAQUE_STATE_ON = 1, /**< Opaque state */
+} Utilx_Opaque_State;
+/**
+ * @brief Sets the priority level for the specified notification window, asynchronously.
+ *
+ * @details This function sets the priority level of notification windows.\n
+ * Every notification window has a base priority level by the notification window's priority value (default priority is #UTILX_NOTIFICATION_LEVEL_LOW).
+ *
+ * The priority is used for ordering of notification windows.\n
+ * The notification window with the priority set to #UTILX_NOTIFICATION_LEVEL_HIGH will be placed at the top of the notification windows.\n
+ * If there are notification windows which have same priorities, the last created notification window will be placed on the other window.
+ *
+ * @since_tizen 2.3
+ * @remarks This is used only for notification windows.
+ * @param[in] dpy The connection to the X server
+ * @param[in] win The window to set
+ * @param[in] level The level (#UTILX_NOTIFICATION_LEVEL_LOW, #UTILX_NOTIFICATION_LEVEL_NORMAL, #UTILX_NOTIFICATION_LEVEL_HIGH)
+ * @pre The window should be a notification type window.
+ * @see #Utilx_Notification_Level
+ * @see utilx_get_system_notification_level()
+ * @par Example
+ @code
#include <utilX.h>
- #include <Ecore_Evas.h>
- #include <Ecore_X.h>
- int main()
- {
- ...
+ ...
- Ecore_X_Display* disp = ecore_x_display_get();
- Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
+ Evas_Object *win;
+ Ecore_X_Window xwin;
- utilx_grab_key(disp, win, KEY_POWER, TOP_POSITION_GRAB);
+ win = create_mwnd();
+ xwin = elm_win_xwindow_get(win);
- ...
+ // Set Notification type
+ ecore_x_netwm_window_type_set (xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
- utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever you want to ¡¦
- return 0;
- }
+ // Set Notification's priority
+ utilx_set_system_notification_level (ecore_x_display_get(), xwin, UTILX_NOTIFICATION_LEVEL_HIGH);
- // SHARED_GRAB //
+ ...
+ @endcode
+ */
+void utilx_set_system_notification_level (Display* dpy, Window win, Utilx_Notification_Level level);
+/**
+ * @brief Gets the priority level for the specified notification window.
+ *
+ * @details This function returns the priority level of notification windows.\n
+ * If a user didn't set the notification's priority level, this function returns the default value (#UTILX_NOTIFICATION_LEVEL_LOW).
+ *
+ * This function is a synchronous call.
+ *
+ * @since_tizen 2.3
+ * @remarks This is used only for notification windows.
+ * @param[in] dpy The connection to the X server
+ * @param[in] win The window to get
+ * @return The current notification level (#UTILX_NOTIFICATION_LEVEL_LOW, #UTILX_NOTIFICATION_LEVEL_NORMAL, #UTILX_NOTIFICATION_LEVEL_HIGH)
+ * @pre The window should be a notification type window.
+ * @see utilx_set_system_notification_level()
+ * @par Example
+ @code
#include <utilX.h>
- #include <Ecore_Evas.h>
- #include <Ecore_X.h>
- int main()
- {
- ...
+ ...
- Ecore_X_Display* disp = ecore_x_display_get();
- Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
+ Evas_Object *win;
+ Ecore_X_Window xwin;
+ Utilx_Notification_Level level;
- utilx_grab_key(disp, win, KEY_POWER, SHARED_GRAB);
+ win = elm_win_add (NULL, "test", ELM_WIN_NOTIFICATION);
+ xwin = elm_win_xwindow_get(win);
- ...
+ level = utilx_get_system_notification_level (ecore_x_display_get(), xwin);
- utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever you want to ¡¦
- return 0;
- }
+ ...
@endcode
*/
-int utilx_grab_key (Display* dpy, Window win, const char* key_name, int grab_mode);
+Utilx_Notification_Level utilx_get_system_notification_level (Display* dpy, Window win);
/**
- * @fn int utilx_ungrab_key (Display* dpy, Window win, const char* key_name)
- * @brief Ungrabs a key specfied by key_name for win
- *
- * This function releases the already established grab of the specfied key for the specified window.\n
- * Once the grab of the key was released, delivery of the key events for the specfied window is going to be stopped.
- *
- * This function is synchronous.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window to grab a key
- * @param[in] key_name Name of a key in string (ex> KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_SEND and so on)
- * @return 0 on Success, otherwise Fail
- * @remark No additional information
- * @pre This API must be called after the window 'win' has been mapped
- * @post This API changes/removes the window property related to grabbed key
- * @see utilx_grab_key
+ * @brief Grabs the key specfied by @a key_name for a window in the @a grab_mode.
+ *
+ * @details This function establishes a grab of the specified key for the specified window.\n
+ * Once a key is grabbed, all events originating from the key will only be reported to the specfied window.\n
+ * The grab of the key can be released by calling utilx_ungrab_key().
+ *
+ * This function is synchronous.
+ *
+ * @since_tizen 2.3
+ * @remarks If utilx_grab_key() returns @c 0, the specified window will get the events of the specified key.\n
+ * However, delivery of a key can always be changed by other applications grabbing the key with higher priority.\n
+ * It can also be changed by the changes of window stacks.\n
+ * A trial for choosing a proper grab mode will be needed.
+ * @param[in] dpy The connection to the X server
+ * @param[in] win The window to grab a key
+ * @param[in] key_name The name of a key in the string (ex> #KEY_VOLUMEUP, #KEY_VOLUMEDOWN, #KEY_SEND, and so on)
+ * @param[in] grab_mode The grab mode (such as #EXCLUSIVE_GRAB, #TOP_POSITION_GRAB, and #SHARED_GRAB)
+ * @return @c 0 on success,
+ * otherwise failure
+ * @pre This API must be called after the window 'win' has been mapped.
+ * @post This API adds/changes the window property related to the grabbed key.
+ * @see utilx_ungrab_key()
* @par Example (using X11 APIs)
@code
int grab_result = utilx_grab_key(disp, win, KEY_POWER, EXCLUSIVE_GRAB);
if( EXCLUSIVE_GRABBED_ALREADY == grab_result )
return -1;
- ...
-
- utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever you want to ¡¦
- return 0;
- }
-
- // TOP_POSITION_GRAB //
-
- #include <utilX.h>
- #include <Ecore_Evas.h>
- #include <Ecore_X.h>
-
- int main()
- {
- ...
-
- Ecore_X_Display* disp = ecore_x_display_get();
- Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
-
- utilx_grab_key(disp, win, KEY_POWER, TOP_POSITION_GRAB);
-
- ...
-
- utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever you want to ¡¦
-
- return 0;
- }
-
- // SHARED_GRAB //
-
- #include <utilX.h>
- #include <Ecore_Evas.h>
- #include <Ecore_X.h>
-
- int main()
- {
- ...
-
- Ecore_X_Display* disp = ecore_x_display_get();
- Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
-
- utilx_grab_key(disp, win, KEY_POWER, SHARED_GRAB);
...
- utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever you want to ¡¦
- return 0;
- }
- @endcode
- */
-int utilx_ungrab_key (Display* dpy, Window win, const char* key_name);
-
-/**
- * @fn int utilx_get_key_status(Display* dpy, char *key_name)
- * @brief Gets a status of a key specified by key_name
- *
- * This function gets a status of a key.\n
- * ex>UTILX_KEY_STATUS_PRESSED, UTILX_KEY_STATUS_RELEASED and UTILX_KEY_STATUS_UNKNOWN
- *
- * This function is synchronous.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] key_name Name of a key in string (ex> KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_SEND and so on)
- * @return 0 on Success, otherwise Fail
- * @remark No additional information
- * @pre This API must be called for H/W keys specified in this header file(utilX.h).
- * @par Example (using X11 APIs)
- @code
-
- #include <X11/Xlib.h>
- #include <utilX.h>
-
- int main()
- {
- Display *disp = XOpenDisplay(NULL);
- Utilx_Key_Status status;
-
- status = utilx_get_key_status(disp, KEY_PLAYCD);
-
- switch( status )
- {
- case UTILX_KEY_STATUS_PRESSED:
- //The key is pressed.
- break;
-
- case UTILX_KEY_STATUS_RELEASED:
- //The key is released.
- break;
-
- case UTILX_KEY_STATUS_UNKNOWN:
- default:
- //The key status is unknown;
- break;
- }
-
+ utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever a user wants to
return 0;
}
- @endcode
- * @par Example (using EFL APIs)
- @code
+ // TOP_POSITION_GRAB //
#include <utilX.h>
#include <Ecore_Evas.h>
int main()
{
- ...
-
- Ecore_X_Display* disp = ecore_x_display_get();
- Utilx_Key_Status status;
-
- status = utilx_get_key_status(disp, KEY_PLAYCD);
-
- switch( status )
- {
- case UTILX_KEY_STATUS_PRESSED:
- //The key is pressed.
- break;
-
- case UTILX_KEY_STATUS_RELEASED:
- //The key is released.
- break;
-
- case UTILX_KEY_STATUS_UNKNOWN:
- default:
- //The key status is unknown;
- break;
- }
- return 0;
- }
- @endcode
- */
-Utilx_Key_Status utilx_get_key_status(Display* dpy, char *key_name);
-
-/* Window Effect APIs */
-/**
- * @fn void utilx_set_window_effect_state(Display* dpy, Window win, int state)
- * @brief Sets a window's effect state ( enable or disable )
- *
- * This function sets window's effect state. if effect is not enabled by composite manager, \n
- * window's effect could not be enabled.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window handle
- * @param[in] state Enables/disables the window effect
- * @remark This is used only client window. ( not root window )
- * @pre This api must be called before fist show ( XMapWindow Event ).
- * @post This changes Client Window's Effect related property.
- * @see utilx_get_window_effect_state
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
- ...
-
- Display* dpy;
- Window root, win;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
-
- win = XCreateSimpleWindow (dpy, root, 0, 0, 480, 800, 2, BlackPixel (dpy,0), WhitePixel(dpy,0));
-
- // Sets a window's effect state to enable ( enable : 1, disable 0 )
- utilx_set_window_effect_state(dpy, win, 1);
-
- XMapWindow (dpy, win);
- ...
- @endcode
- */
-void utilx_set_window_effect_state(Display* dpy, Window win, int state);
-
-/**
-* @fn int utilx_get_window_effect_state(Display* dpy, Window win)
-* @brief Gets a window's effect state ( enable or disable )
-*
-* This function returns windows's effect state.\n
-* If effect is not enabled by composite manager, then this return value is unusable or meanless.
-*
-* This function is a asynchronous call.
-*
-* @param[in] dpy Specifies the connection to the X server
-* @param[in] win Specifies the window handle
-* @return Current window effect state
-* @remark This is used only client window. ( not root window )
-* @pre This api does not require any pre-condition.
-* @post This api does not change any condition.
-* @see utilx_set_window_effect_state
-* @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
- ...
-
- Display* dpy;
- Window root, win;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
-
- win = XCreateSimpleWindow (dpy, root, 0, 0, 480, 800, 2, BlackPixel (dpy,0), WhitePixel(dpy,0));
-
- XMapWindow (dpy, win);
-
- // Gets a window's effect state ( enable : 1, disable 0 )
- printf( "current window's effect state = %d\n", utilx_get_window_effect_state(dpy, win) ) ;
- ...
- @endcode
-*/
-int utilx_get_window_effect_state(Display* dpy, Window win);
-
-/**
- * @fn void utilx_show_fake_effect(Display* dpy, Window win, char *fake_image_file)
- * @brief Shows a window's "fake show effect" animation
- *
- * This function show's application fake show image.\n
- * This function is only used by application launching program.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the root window handle
- * @param[in] fake_image_file Specifies the fake window image and file format is png type.
- * @remark This is used only menu-screen window.
- * @pre This api must be called before client's fist show ( XMapWindow Event ). you must call this api then run application.
- * @post This changes root window's fake effect related property.
- * @see utilx_hide_fake_effect
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
- ...
-
- Display* dpy;
- Window root;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
-
- // Shows a window's "fake show effect" animation, and if you want to see animation, /root/fake_window_image.png file must be exited.
- utilx_show_fake_effect( dpy, root, "/root/fake_window_image.png");
- ...
- @endcode
- */
-void utilx_show_fake_effect(Display *dpy, Window win, char *fake_image_file);
-
-/**
- * @fn void utilx_hide_fake_effect(Display* dpy, Window win)
- * @brief Shows a window's "fake hide effect" animation, and this animation uses "fake show effect" 's window image.
- *
- * This function shoes a window's fake hide effect.\n
- * This function is only used by application launching program.\n
- * When application was not executed by any error.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the root window handle
- * @remark This is used only menu-screen window.
- * @pre This api must be called after "utilx_show_fake_effect()".
- * @post This changes root window's fake effect related property.
- * @see utilx_show_fake_effect
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
- ...
-
- Display* dpy;
- Window root;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
-
- // Shows a window's "fake hide effect" animation. and if you wnat to see animation, utilx_show_fake_effect() function must be excuted before utilx_show_fake_effect()
- // and if real window is showed , then fake hide effect could not be showed.
- utilx_hide_fake_effect( dpy, root );
- ...
- @endcode
- */
-void utilx_hide_fake_effect(Display *dpy, Window win);
-
-/**
- * @fn void utilx_set_window_effect_style(Display* dpy, Window win, Utilx_Effect_Type type, Utilx_Effect_Style style)
- * @brief Sets a window's effect style with effect type.
- *
- * This function sets a window's effect style with effect type.\n
- * Default Window Effect is setted by Window Type and Window Class.\n
- * And then, you could change custom effecct.\n
- * Custom Effect is available max 10. ( CUSTOM0 ~ CUSTOM9 )\n
- * If you didn't set custom effect, then compositing window manger provides Default Window Effect.\n
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window handle
- * @param[in] type Specifies the window's effect type ( ex. UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_TYPE_UNMAP, etc )
- * @param[in] style Specifies the window's effect style ( ex. UTILX_EFFECT_STYLE_DEFAULT, UTILX_EFFECT_STYLE_NONE, UTILX_EFFECT_STYLE_CUSTOM0, etc )
- * @remark This is used only client window. ( not root window )
- * @pre This api does not require any pre-condition.
- * @post This changes window's effect type related property ( _NET_CM_WINDOW_EFFECT_TYPE ).
- * @see utilx_get_window_effect_style
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <utilX.h>
- ...
-
- Display *dpy ;
- Window win, root ;
- unsigned long black, white;
-
- dpy = XOpenDisplay(NULL) ;
-
- black = BlackPixel(dpy, 0);
- white = WhitePixel(dpy, 0);
-
- root = XDefaultRootWindow (dpy);
- win = XCreateSimpleWindow ( dpy, root, 0, 0, 100, 100, 2, BlackPixel (d,0), WhitePixel(d,0) );
-
- utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_STYLE_CUSTOM0); // window's show effet type change to UTILX_EFFECT_STYLE_CUSTOM0
-
- XMapWindow(dpy, win);
+ ...
- ...
+ Ecore_X_Display* disp = ecore_x_display_get();
+ Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
- utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_UNMAP, UTILX_EFFECT_STYLE_CUSTOM0); // window's hide effet type change to UTILX_EFFECT_STYLE_CUSTOM0
+ utilx_grab_key(disp, win, KEY_POWER, TOP_POSITION_GRAB);
- XUnmapWindow (dpy, win);
+ ...
- utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_STYLE_DEFAULT); // window's show effet type change to UTILX_EFFECT_STYLE_DEFAULT
- XMapWindow (dpy, win);
+ utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever a user wants to
+ return 0;
+ }
- ...
+ // SHARED_GRAB //
- utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_UNMAP, UTILX_EFFECT_STYLE_DEFAULT); // window's hide effet type change to UTILX_EFFECT_STYLE_DEFAULT
- XUnmapWindow (dpy, win);
+ #include <utilX.h>
+ #include <Ecore_Evas.h>
+ #include <Ecore_X.h>
- ...
+ int main()
+ {
+ ...
- utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_STYLE_NONE); // window's show effet type change to UTILX_EFFECT_STYLE_NONE
- XMapWindow (dpy, win);
+ Ecore_X_Display* disp = ecore_x_display_get();
+ Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
- ...
+ utilx_grab_key(disp, win, KEY_POWER, SHARED_GRAB);
- utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_UNMAP, UTILX_EFFECT_STYLE_NONE); // window's hide effet type change to UTILX_EFFECT_STYLE_NONE
- XUnmapWindow (dpy, win);
+ ...
- ...
+ utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever a user wants to
+ return 0;
+ }
@endcode
*/
-void utilx_set_window_effect_style(Display* dpy, Window win, Utilx_Effect_Type type, Utilx_Effect_Style style);
+int utilx_grab_key (Display* dpy, Window win, const char* key_name, int grab_mode);
/**
- * @fn Utilx_Effect_Style utilx_get_window_effect_style(Display* dpy, Window win, Utilx_Effect_Type type)
- * @brief Gets a window's effect style with effect type.
- *
- * This function gets a window's effect style with effect type.\n
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window handle
- * @param[in] type Specifies the window's effect type ( ex. UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_TYPE_UNMAP, etc )
- * @return Current window's effect style ( ex. UTILX_EFFECT_STYLE_DEFAULT, UTILX_EFFECT_STYLE_NONE, UTILX_EFFECT_STYLE_CUSTOM0, etc )
- * @remark This is used only client window. ( not root window )
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_set_window_effect_style
- * @par Example
+ * @brief Ungrabs the key specfied by @a key_name for a window.
+ *
+ * @details This function releases the already established grab of the specfied key for the specified window.\n
+ * Once the grab of the key is released, delivery of the key events for the specfied window is going to be stopped.
+ *
+ * This function is synchronous.
+ *
+ * @since_tizen 2.3
+ * @param[in] dpy The connection to the X server
+ * @param[in] win The window to grab a key
+ * @param[in] key_name The name of a key in the string (ex> #KEY_VOLUMEUP, #KEY_VOLUMEDOWN, #KEY_SEND, and so on)
+ * @return @c 0 on success,
+ * otherwise failure
+ * @pre This API must be called after the window 'win' is mapped.
+ * @post This API changes/removes the window property related to the grabbed key.
+ * @see utilx_grab_key()
+ * @par Example (using X11 APIs)
@code
+
+ // EXCLUSIVE_GRAB //
+
#include <X11/Xlib.h>
- #include <X11/Xutil.h>
#include <utilX.h>
- ...
- Display *dpy ;
- Window win, root ;
- unsigned long black, white;
- Utilx_Effect_Style style;
+ int main()
+ {
+ Display *disp = XOpenDisplay(NULL);
+ XEvent e;
+ int grab_result;
+ Window w = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 5,5, 470, 780, 2, BlackPixel(d,0), WhitePixel(d,0));
+ XSelectInput(disp, w, StructureNotifyMask | KeyPressMask | KeyReleaseMask);
+ XMapWindow(disp, w);
- dpy = XOpenDisplay(NULL) ;
+ while(1)
+ {
+ XNextEvent(disp, &e);
+ switch(e.type)
+ {
+ case MapNotify:
+ grab_result = utilx_grab_key(disp, w, KEY_POWER, EXCLUSIVE_GRAB);
+ if( EXCLUSIVE_GRABBED_ALREADY == grab_result )
+ return -1;
+ break;
+ }
+ ...
+ }
+ ...
- black = BlackPixel(dpy, 0);
- white = WhitePixel(dpy, 0);
+ utilx_ungrab_key(disp, win, KEY_POWER);
+ return 0;
+ }
- root = XDefaultRootWindow (dpy);
- win = XCreateSimpleWindow ( dpy, root, 0, 0, 100, 100, 2, BlackPixel (d,0), WhitePixel(d,0) );
+ // TOP_POSITION_GRAB //
- style = utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_MAP); // get effect style with window's show effet type
+ #include <X11/Xlib.h>
+ #include <utilX.h>
- ...
+ int main()
+ {
+ Display *disp = XOpenDisplay(NULL);
+ XEvent e;
+ Window w = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 5,5, 470, 780, 2, BlackPixel(d,0), WhitePixel(d,0));
+ XSelectInput(disp, w, StructureNotifyMask | KeyPressMask | KeyReleaseMask);
+ XMapWindow(disp, w);
- style = utilx_set_window_effect_style(dpy, win, UTILX_EFFECT_TYPE_UNMAP); // get effect style with window's show effet type
+ while(1)
+ {
+ XNextEvent(disp, &e);
+ switch(e.type)
+ {
+ case MapNotify:
+ utilx_grab_key(disp, w, KEY_POWER, TOP_POSITION_GRAB);
+ break;
+ }
+ ...
+ }
+ ...
- ...
- @endcode
- */
-Utilx_Effect_Style utilx_get_window_effect_style(Display* dpy, Window win, Utilx_Effect_Type type);
+ utilx_ungrab_key(disp, win, KEY_POWER);
+ return 0;
+ }
+
+ // SHARED_GRAB //
-/**
- * @fn void utilx_set_window_opaque_state (Display* dpy, Window win, int opaque)
- * @brief Sets the window's opaque state
- *
- * This function sets window's visibility to opaque even if the window is an alpha window.
- * This function is available only alpha window.
- * An alpha window's default opaque state is UTILX_OPAQUE_STATE_OFF.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window handle
- * @param[in] state Specifies whether the window set a visible state to opaque(UTILX_OPAQUE_STATE_ON) or not(UTILX_OPAQUE_STATE_OFF)
- * @return 1 on Success, otherwise Fail
- * @remark This is used only alpha window.
- * @pre None
- * @post
- * @see
- * @par Example
- @code
#include <X11/Xlib.h>
#include <utilX.h>
- ...
-
- Display* dpy;
- Window root, win;
- int ret;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
+ int main()
+ {
+ Display *disp = XOpenDisplay(NULL);
+ XEvent e;
+ Window w = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 5,5, 470, 780, 2, BlackPixel(d,0), WhitePixel(d,0));
+ XSelectInput(disp, w, StructureNotifyMask | KeyPressMask | KeyReleaseMask);
+ XMapWindow(disp, w);
- win = XCreateSimpleWindow (dpy, root, 0, 0, 480, 800, 2, BlackPixel (dpy,0), WhitePixel(dpy,0));
- XMapWindow (dpy, win);
+ while(1)
+ {
+ XNextEvent(disp, &e);
+ switch(e.type)
+ {
+ case MapNotify:
+ utilx_grab_key(disp, w, KEY_POWER, SHARED_GRAB);
+ break;
+ }
+ ...
+ }
+ ...
- ret = utilx_set_window_opaque_state (dpy, win, UTILX_OPAQUE_STATE_ON);
- if (!ret)
- {
- printf ("Error! Failed to set opaque state.\n");
+ utilx_ungrab_key(disp, win, KEY_POWER);
+ return 0;
}
- XFlush (dpy);
-
- ...
@endcode
- */
-int utilx_set_window_opaque_state (Display* dpy, Window win, Utilx_Opaque_State state);
-
-/**
- * @fn int utilx_set_screen_capture(Display* dpy, int enable)
- * @brief Specifies whether the screen capture functionality is enable or not.
- *
- * This function makes the screen capture functionality of CBHM enable or disable.
- * CBHM = Clipboard History Manager.
- *
- * This function is synchronous.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] enable Specifies the window handle. (1:Enable, 0:Disable)
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_get_screen_capture
- * @par Example
+ * @par Example (using EFL APIs)
@code
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
+
+ // EXCLUSIVE_GRAB //
+
#include <utilX.h>
- ...
+ #include <Ecore_Evas.h>
+ #include <Ecore_X.h>
+
+ int main()
+ {
+ ...
- Display *dpy ;
+ Ecore_X_Display* disp = ecore_x_display_get();
+ Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
- dpy = XOpenDisplay(NULL) ;
+ int grab_result = utilx_grab_key(disp, win, KEY_POWER, EXCLUSIVE_GRAB);
+ if( EXCLUSIVE_GRABBED_ALREADY == grab_result )
+ return -1;
+ ...
- utilx_set_screen_capture (dpy, 1);
+ utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever a user wants to
+ return 0;
+ }
- ...
- @endcode
- */
-int utilx_set_screen_capture(Display* dpy, int enable);
+ // TOP_POSITION_GRAB //
-/**
- * @fn int utilx_get_screen_capture(Display* dpy, int enable)
- * @brief Gets whether the screen capture functionality is enable or not.
- *
- * This function gets whether the screen capture functionality of CBHM is enable or not.
- * CBHM = Clipboard History Manager.
- *
- * This function is synchronous.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_set_screen_capture
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
#include <utilX.h>
- ...
+ #include <Ecore_Evas.h>
+ #include <Ecore_X.h>
- Display *dpy ;
- int enable;
+ int main()
+ {
+ ...
- dpy = XOpenDisplay(NULL) ;
+ Ecore_X_Display* disp = ecore_x_display_get();
+ Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
- enable = utilx_set_screen_capture (dpy);
+ utilx_grab_key(disp, win, KEY_POWER, TOP_POSITION_GRAB);
- ...
- @endcode
- */
-int utilx_get_screen_capture(Display* dpy);
+ ...
+
+ utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever a user wants to
+
+ return 0;
+ }
+
+ // SHARED_GRAB //
-/**
- * @fn void utilx_set_window_cardinal_property(Display* dpy, Window win, Atom atom, unsigned int *value)
- * @brief Sets the cardinal property to Window
- *
- * This function Sets the cardinal property to Window.
- *
- * This function is synchronous.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window handle
- * @param[in] atom Specifies the atom of cardinal property
- * @param[in] value the value of cardinal property to set.
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_get_window_cardinal_property
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
#include <utilX.h>
- ...
+ #include <Ecore_Evas.h>
+ #include <Ecore_X.h>
- Display *dpy ;
- Window root;
- Atom atom = None;
- int value = 1;
+ int main()
+ {
+ ...
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
+ Ecore_X_Display* disp = ecore_x_display_get();
+ Ecore_X_Window win = ecore_evas_software_x11_window_get(ee);
- atom = XInternAtom(dpy, "TEST_ATOM", False);
+ utilx_grab_key(disp, win, KEY_POWER, SHARED_GRAB);
- utilx_set_window_cardinal_property (dpy, root, atom, (unsigned int*)&value);
+ ...
- ...
+ utilx_ungrab_key(disp, win, KEY_POWER);//Ungrab whenever a user wants to
+ return 0;
+ }
@endcode
*/
-void utilx_set_window_cardinal_property(Display* dpy, Window win, Atom atom, unsigned int *value);
+int utilx_ungrab_key (Display* dpy, Window win, const char* key_name);
/**
- * @fn int utilx_get_window_cardinal_property(Display* dpy, Window win, Atom atom, unsigned int *value)
- * @brief Gets the value of cardinal property.
+ * @brief Sets the window's opaque state.
*
- * This function gets the value of cardinal property.
+ * @details This function sets the window's visibility to opaque even if the window is an alpha window.
+ * This function is available only for an alpha window.
+ * An alpha window's default opaque state is #UTILX_OPAQUE_STATE_OFF.
*
- * This function is synchronous.
+ * This function is an asynchronous call.
*
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the window handle
- * @param[in] atom Specifies the atom of cardinal property
- * @param[out] value the value of cardinal property to get.
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_set_window_cardinal_property
+ * @since_tizen 2.3
+ * @remarks This is used only for alpha windows.
+ * @param[in] dpy The connection to the X server
+ * @param[in] win The window handle
+ * @param[in] state The value that indicates whether the window has set a visible state to opaque(#UTILX_OPAQUE_STATE_ON) or not(#UTILX_OPAQUE_STATE_OFF)
+ * @return @c 1 on success,
+ otherwise failure
* @par Example
@code
#include <X11/Xlib.h>
- #include <X11/Xutil.h>
#include <utilX.h>
+
...
- Display *dpy ;
- Window root;
- Atom atom = None;
- int value;
+ Display* dpy;
+ Window root, win;
+ int ret;
dpy = XOpenDisplay (NULL);
root = XDefaultRootWindow (dpy);
- atom = XInternAtom(dpy, "TEST_ATOM", False);
+ win = XCreateSimpleWindow (dpy, root, 0, 0, 480, 800, 2, BlackPixel (dpy,0), WhitePixel(dpy,0));
+ XMapWindow (dpy, win);
- if (utilx_set_window_cardinal_property (dpy, root, atom, (unsigned int*)&value) > 0)
+ ret = utilx_set_window_opaque_state (dpy, win, UTILX_OPAQUE_STATE_ON);
+ if (!ret)
{
- success;
+ printf ("Error! Failed to set opaque state.\n");
}
- ...
- @endcode
- */
-int utilx_get_window_cardinal_property(Display* dpy, Window win, Atom atom, unsigned int *value);
+ XFlush (dpy);
-/**
- * @fn void utilx_show_capture_effect(Display *dpy, Window win )
- * @brief Shows a capture effect animation
- *
- * This function show capture effect animation.\n
- * This function is only used by Screen Capture Application.
- *
- * This function is a asynchronous call.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] win Specifies the root window handle
- * @remark This is used only screen capture application.
- * @pre This api does not require any pre-condition.
- * @post This api does not change any condition.
- * @see utilx_set_screen_capture
- * @par Example
- @code
- #include <X11/Xlib.h>
- #include <utilX.h>
...
-
- Display* dpy;
- Window root;
-
- dpy = XOpenDisplay (NULL);
- root = XDefaultRootWindow (dpy);
-
- // Shows a Shows a capture effect animation
- utilx_show_capture_effect( dpy, root);
- ...
@endcode
*/
-void utilx_show_capture_effect(Display *dpy, Window win );
+int utilx_set_window_opaque_state (Display* dpy, Window win, Utilx_Opaque_State state);
/**
- * @fn void* utilx_create_screen_shot (Display* dpy, int width, int height)
- * @brief Create a screenshot image.
- *
- * This function create a screenshot image.\n
- * To use this function, you should get the permission first. After finishing,
- * utilx_release_screen_shot should be called.
- *
- * @param[in] dpy Specifies the connection to the X server
- * @param[in] width Specifies the root window handle
- * @param[in] height Specifies the root window handle
- * @remark You should get the permission to use.
- * @post This api does not change any condition.
- * @see utilx_release_screen_shot
+ * @brief Creates a screenshot image.
+ *
+ * @details This function creates a screenshot image of the display.\n
+ * To use this function, you should get the permission first.\n
+ * In addition, device LCD must be turned on; otherwise, this function fails.\n
+ * Once this functions is called, utilx_release_screen_shot() should be called after it.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/screenshot
+ * @remarks You should get the permission to use. Device LCD must be on.
+ * @param[in] dpy The connection to the X server
+ * @param[in] width The root window handle
+ * @param[in] height The root window handle
+ * @see utilx_release_screen_shot()
* @par Example
@code
Display* dpy;
{
// do_something (dump);
}
+ else
+ {
+ // utilx_create_screen_shot can return NULL in some cases.
+ // Even if it returns NULL, utilx_release_screen_shot should be called.
+ }
utilx_release_screen_shot ();
@endcode
void* utilx_create_screen_shot (Display* dpy, int width, int height);
/**
- * @fn void utilx_release_screen_shot (void)
- * @brief Release screenshot resources.
+ * @brief Releases screenshot resources.
*
- * This function release screenshot resources.\n
- * utilx_release_screen_shot should be called after finsining screenshot.
+ * @details This function releases resources associated with screenshot
+ * image of the display. utilx_release_screen_shot() should be called once
+ * utilx_create_screen_shot() is called.
*
- * @see utilx_create_screen_shot
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/screenshot
+ * @see utilx_create_screen_shot()
* @par Example
@code
Display* dpy;
{
// do_something (dump);
}
+ else
+ {
+ // utilx_create_screen_shot can return NULL in some cases.
+ // Even if it returns NULL, utilx_release_screen_shot should be called.
+ }
utilx_release_screen_shot ();
@endcode
}
#endif
-
/**
- * @}
- */
+*@}
+*/
-#endif /* __SAMSUNG_LINUX_UTIL_X11_H__ */
+#endif /* __TIZEN_LINUX_UTIL_X11_H__ */
Name: libSLP-utilX
Description: SAMSUNG Linux platform X11 utilities library
Version: 1.1.0
+Requires: xproto x11
Libs: -L${libdir} -lutilX
Cflags: -I${includedir}
Name: libSLP-utilX
Description: SAMSUNG Linux platform X11 utilities library
Version: @VERSION@
+Requires: xproto x11
Libs: -L${libdir} -lutilX
Cflags: -I${includedir}
--- /dev/null
+/*
+ * libslp-utilx
+ *
+ Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+ 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.
+ *
+ */
+
+#ifndef __SAMSUNG_LINUX_UTIL_X11_EXT_H__
+#define __SAMSUNG_LINUX_UTIL_X11_EXT_H__
+
+#include <sys/types.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define STR_ATOM_SCRNCONF_STATUS "_SCRNCONF_STATUS"
+
+typedef enum _Utilx_Scrnconf_Status
+{
+ UTILX_SCRNCONF_STATUS_NULL,
+ UTILX_SCRNCONF_STATUS_CONNECT,
+ UTILX_SCRNCONF_STATUS_ACTIVE
+} Utilx_Scrnconf_Status;
+
+typedef enum _Utilx_Scrnconf_Dispmode
+{
+ UTILX_SCRNCONF_DISPMODE_NULL,
+ UTILX_SCRNCONF_DISPMODE_CLONE,
+ UTILX_SCRNCONF_DISPMODE_EXTENDED
+} Utilx_Scrnconf_Dispmode;
+
+typedef enum _Utilx_Fb_Type
+{
+ UTILX_FB_TYPE_NONE,
+ UTILX_FB_TYPE_UI,
+ UTILX_FB_TYPE_OVERLAY,
+} Utilx_Fb_Type;
+
+typedef struct _UtilxScrnConf
+{
+ char *str_output;
+ Utilx_Scrnconf_Status status;
+ char *str_resolution;
+ Utilx_Scrnconf_Dispmode dispmode;
+} UtilxScrnConf;
+
+UtilxScrnConf *utilx_scrnconf_allocate (void);
+void utilx_scrnconf_free (UtilxScrnConf *scrnconf);
+int utilx_scrnconf_get_info (Display *dpy, UtilxScrnConf *scrnconf);
+int utilx_scrnconf_set_dispmode (Display *dpy, Utilx_Scrnconf_Dispmode dispmode);
+
+void* utilx_create_video_screen_shot (Display* dpy, Window win, int width, int height);
+void utilx_set_fb_visible (Display* dpy, Utilx_Fb_Type fb_type, Bool visible);
+Bool utilx_get_fb_visible (Display* dpy, Utilx_Fb_Type fb_type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SAMSUNG_LINUX_UTIL_X11_EXT_H__ */
+
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <sys/shm.h>
+#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
+#include <X11/extensions/Xrandr.h>
#include "utilX.h"
+#include "utilX_ext.h"
#include "util_x11.h"
#include <fcntl.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/Xvproto.h>
#include <X11/extensions/Xdamage.h>
+#include <X11/extensions/XShm.h>
+#include <xf86drm.h>
+#include <tbm_bufmgr.h>
#include <dri2.h>
-#include <drm_slp_bufmgr.h>
#define UTILX_DEBUG 0
static Atom _atom_grab_or_excl_win = None;
static Atom _atom_notification_level = None;
-static Atom _atom_indicator_visible_state = None;
-static Atom _atom_indicator_visible_state_on = None;
-static Atom _atom_indicator_visible_state_off = None;
-static Atom _atom_comp_effect_state = None;
-static Atom _atom_comp_fake_launch = None;
static Atom _atom_comp_fake_launch_image = None;
-static Atom _atom_comp_window_effect_type = None;
-static Atom _atom_comp_effect_default = None;
-static Atom _atom_comp_effect_none = None;
-static Atom _atom_comp_effect_custom0 = None;
-static Atom _atom_comp_effect_custom1 = None;
-static Atom _atom_comp_effect_custom2 = None;
-static Atom _atom_comp_effect_custom3 = None;
-static Atom _atom_comp_effect_custom4 = None;
-static Atom _atom_comp_effect_custom5 = None;
-static Atom _atom_comp_effect_custom6 = None;
-static Atom _atom_comp_effect_custom7 = None;
-static Atom _atom_comp_effect_custom8 = None;
-static Atom _atom_comp_effect_custom9 = None;
-
static Atom _atom_window_opaque = None;
-static Atom _atom_screen_capture_disable = None;
-
-static Atom _atom_comp_capture_effect = None;
+static Atom _atom_window_pixman = None;
const unsigned long maxlen = 1024l;
static void _utilx_set_window_property (Display* dpy, Window win, Atom atom, Atom type, unsigned int *val, unsigned int num);
static int _utilx_get_window_property (Display* dpy, Window win, Atom atom, Atom type, unsigned int *val, unsigned int len);
-static void _utilx_effect_atom_check( Display* dpy );
-static Atom _utilx_convert_style_to_atom( Display* dpy, Utilx_Effect_Style style );
-static Utilx_Effect_Style _utilx_convert_atom_to_style( Display* dpy, Atom style );
-
-static int _utilx_get_indicator_atoms(Display *dpy);
API void utilx_set_system_notification_level (Display* dpy, Window win, Utilx_Notification_Level level)
{
return noti_level;
}
-static int _utilx_get_indicator_atoms(Display *dpy)
-{
- if (!_atom_indicator_visible_state)
- {
- _atom_indicator_visible_state = XInternAtom (dpy, "_E_ILLUME_INDICATOR_STATE", False);
- if (!_atom_indicator_visible_state)
- {
- fprintf (stderr, "[UTILX] Error.. Cannot create _E_ILLUME_INDICATOR_STATE atom.. %s (%d)\n", __func__, __LINE__);
- return 0;
- }
- }
-
- if (!_atom_indicator_visible_state_on)
- {
- _atom_indicator_visible_state_on = XInternAtom (dpy, "_E_ILLUME_INDICATOR_ON", False);
- if (!_atom_indicator_visible_state_on)
- {
- fprintf (stderr, "[UTILX] Error.. Cannot create _E_ILLUME_INDICATOR_ON atom.. %s (%d)\n", __func__, __LINE__);
- return 0;
- }
- }
-
- if (!_atom_indicator_visible_state_off)
- {
- _atom_indicator_visible_state_off = XInternAtom (dpy, "_E_ILLUME_INDICATOR_OFF", False);
- if (!_atom_indicator_visible_state_off)
- {
- fprintf (stderr, "[UTILX] Error.. Cannot create _E_ILLUME_INDICATOR_OFF atom.. %s (%d)\n", __func__, __LINE__);
- return 0;
- }
- }
-
- return 1;
-}
-
-API void utilx_enable_indicator (Display* dpy, Window win, int enable)
-{
- UTILX_TRACE ("[UTILX] utilx_indicator_set_visible_state... win = %x, show_state = %d\n", win, enable);
-
- if (dpy == NULL)
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return;
- }
-
- if (!_utilx_get_indicator_atoms(dpy))
- {
- fprintf (stderr, "[UTILX] Error.. Cannot create atoms.. %s (%d)\n", __func__, __LINE__);
- return;
- }
-
- if (enable == 1)
- {
- _utilx_set_window_property (dpy, win, _atom_indicator_visible_state, XA_ATOM,
- (unsigned int *)&_atom_indicator_visible_state_on, 1);
- }
- else
- {
- _utilx_set_window_property (dpy, win, _atom_indicator_visible_state, XA_ATOM,
- (unsigned int *)&_atom_indicator_visible_state_off, 1);
- }
-}
-
-
-API int utilx_get_indicator_state (Display* dpy, Window win)
-{
- UTILX_TRACE ("[UTILX] utilx_indicator_set_visible_state... win = %x, show_state = %d\n", win, enable);
-
- int ret;
- Atom state;
-
- if (dpy == NULL)
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return -1;
- }
-
- if (!_utilx_get_indicator_atoms(dpy))
- {
- fprintf (stderr, "[UTILX] Error.. Cannot create atoms.. %s (%d)\n", __func__, __LINE__);
- return;
- }
-
- ret = _utilx_get_window_property (dpy, win, _atom_indicator_visible_state, XA_ATOM,
- (unsigned int *)&state, 1);
-
- if (ret > 0)
- {
- if (state == _atom_indicator_visible_state_on)
- return 1;
- else if (state == _atom_indicator_visible_state_off)
- return 0;
- else
- return -1;
- }
- else
- return -1;
-}
-
static void
_utilx_set_window_property (Display* dpy, Window win, Atom atom, Atom type, unsigned int *val, unsigned int num)
{
goto out;
}
-#ifdef __DEBUG__
- printf("[%s] keycode = %d\n", __FUNCTION__, keycode);
-#endif
-
for( i=0 ; i < nr_item ; i++ )
{
if( key_list && (key_list[i] == keycode) )
XSync(disp, False);
out:
+ _free_list_of_grabbed_key(key_list);
return;
}
if (nr_item == 0)
{
- fprintf(stderr, "\e[32m[utilX][%s] keycode = %d\e[0m\n", __FUNCTION__, keycode);
goto out;
}
cnt++;
}
-#ifdef __DEBUG__
- fprintf(stderr, "[utilX][%s] cnt = %d, nr_item = %d\n", __FUNCTION__, cnt, nr_item);
-#endif
-
if( 0 < cnt )
{
new_key_list = malloc(sizeof(int)*cnt);
new_key_list[cnt++] = key_list[i];
}
- if (new_key_list) {
- XChangeProperty(disp, DefaultRootWindow(disp), ex_grabwin, XA_CARDINAL, 32,
- PropModeReplace, (unsigned char *)new_key_list, cnt);
- }
- else {
- XDeleteProperty(disp, DefaultRootWindow(disp), ex_grabwin);
- }
+ XChangeProperty(disp, DefaultRootWindow(disp), ex_grabwin, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *)new_key_list, cnt);
+
XSync(disp, False);
- if(new_key_list)
- free(new_key_list);
+ _free_new_list_of_grabbed_key(new_key_list);
out:
+ _free_list_of_grabbed_key(key_list);
return;
}
for( i=0 ; i < nr_item ; i++ )
{
if( key_list[i] == keycode )
+ {
+ _free_list_of_grabbed_key(key_list);
return EXCLUSIVE_GRABBED_ALREADY;
+ }
}
out:
+ _free_list_of_grabbed_key(key_list);
return result;
}
{
unsigned long cnt;
int *key_list = NULL;
- int i, result = 0;
+ int i, result=0, ret = 0;
int keycode = 0;
KeySym keysym;
errno = EINVAL;
//Window grabWin;
result = _is_grabbed_key_exclusively(disp, keycode, grab_mode);
-#ifdef __DEBUG__
- printf("[%s] _is_grabbed_key_exclusively returns result = %d\n", __FUNCTION__, result);
-#endif
-
if( result )
{
- fprintf(stderr, "[%s] keycode(%d) was already grabbed exclusively (grab_mode=0x%X) !\n", __FUNCTION__, keycode, grab_mode);
goto out;
}
}
- else if( grab_mode == OR_EXCLUSIVE_GRAB )
- {
- result = _is_grabbed_key_exclusively(disp, keycode, grab_mode);
-
- if( result )
- {
- fprintf(stderr, "[%s] Keycode(%d) was already grabbed with overridable exclusive mode (grab_mode=0x%x)\n", __FUNCTION__, keycode, grab_mode);
- fprintf(stderr, "[%s] Now it will be overridden by a new window(0x%x) !\n", __FUNCTION__, win);
- utilx_ungrab_key(disp, win, key);
- }
- }
keycode |= grab_mode;
i = _search_grabbed_key(key_list, keycode, cnt);
_free_list_of_grabbed_key(key_list);
if ( i != -1 ) {
- if( grab_mode == OR_EXCLUSIVE_GRAB )
- {
- utilx_ungrab_key(disp, win, key);
- }
- else
- {
fprintf(stderr, "Key is already grabbed\n");
goto out;
- }
}
}
cnt ? PropModeAppend : PropModeReplace, (unsigned char *)&keycode, 1);
XSync(disp, False);
keycode = keycode & (~GRAB_MODE_MASK);
-#ifdef __DEBUG__
- printf("[%s] keycode = %d\n", __FUNCTION__, keycode);
-#endif
- if( EXCLUSIVE_GRAB == grab_mode || OR_EXCLUSIVE_GRAB == grab_mode )
+ if( EXCLUSIVE_GRAB == grab_mode )
_set_exclusive_grab_info_to_root(disp, keycode, win, grab_mode);
+ if( OR_EXCLUSIVE_GRAB == grab_mode )
+ {
+ ret = _is_grabbed_key_exclusively(disp, keycode, grab_mode);
+
+ if( !ret )
+ {
+ _set_exclusive_grab_info_to_root(disp, keycode, win, grab_mode);
+ }
+ }
errno = 0;
}
}
}
- else
- {
- _unset_exclusive_grab_info_to_root(disp, keycode, OR_EXCLUSIVE_GRAB);
- }
}
else
{
return ret;
}
-API Utilx_Key_Status utilx_get_key_status(Display* dpy, char *key_name)
-{
- unsigned char keymap[32];
- static unsigned int masktable[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
- Utilx_Key_Status status = UTILX_KEY_STATUS_UNKNOWN;
-
- if( !strncmp(key_name, KEY_VOLUMEDOWN, LEN_KEY_VOLUMEDOWN) ||
- !strncmp(key_name, KEY_VOLUMEUP, LEN_KEY_VOLUMEUP) ||
- !strncmp(key_name, KEY_PAUSE, LEN_KEY_PAUSE) ||
- !strncmp(key_name, KEY_SEND, LEN_KEY_SEND) ||
- !strncmp(key_name, KEY_SELECT, LEN_KEY_VOLUMEDOWN) ||
- !strncmp(key_name, KEY_END, LEN_KEY_END) ||
- !strncmp(key_name, KEY_POWER, LEN_KEY_POWER) ||
- !strncmp(key_name, KEY_CAMERA, LEN_KEY_CAMERA) ||
- !strncmp(key_name, KEY_CONFIG, LEN_KEY_CONFIG) ||
- !strncmp(key_name, KEY_PLAYCD, LEN_KEY_PLAYCD) ||
- !strncmp(key_name, KEY_STOPCD, LEN_KEY_STOPCD) ||
- !strncmp(key_name, KEY_PAUSECD, LEN_KEY_PAUSECD) ||
- !strncmp(key_name, KEY_NEXTSONG, LEN_KEY_NEXTSONG) ||
- !strncmp(key_name, KEY_PREVIOUSSONG, LEN_KEY_PREVIOUSSONG) ||
- !strncmp(key_name, KEY_REWIND, LEN_KEY_REWIND) ||
- !strncmp(key_name, KEY_FASTFORWARD, LEN_KEY_FASTFORWARD) ||
- !strncmp(key_name, KEY_MEDIA, LEN_KEY_MEDIA) )
- {
- KeySym ks = XStringToKeysym(key_name);
- KeyCode kc = XKeysymToKeycode(dpy, ks);
-
- if( kc )
- {
- XQueryKeymap(dpy, (char *)keymap);
- if( keymap[kc >> 3] & masktable[kc & 7] )
- status = UTILX_KEY_STATUS_PRESSED;
- else
- status = UTILX_KEY_STATUS_RELEASED;
- }
- }
-
- return status;
-}
-
-API void utilx_set_window_effect_state(Display* dpy, Window win, int state)
-{
- if ( dpy == NULL )
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return;
- }
- if( !_atom_comp_effect_state)
- _atom_comp_effect_state = XInternAtom(dpy, "_NET_CM_WINDOW_EFFECT_ENABLE",False);
-
- _utilx_set_window_property(dpy, win, _atom_comp_effect_state, XA_CARDINAL, (unsigned int *)&state, 1);
-
- XSync(dpy, 0 );
-}
-
-API int utilx_get_window_effect_state(Display* dpy, Window win)
-{
- int state = 0;
- if( !_atom_comp_effect_state)
- _atom_comp_effect_state = XInternAtom(dpy, "_NET_CM_WINDOW_EFFECT_ENABLE",False);
- _utilx_get_window_property(dpy, win, _atom_comp_effect_state, XA_CARDINAL, (unsigned int *)&state, 1);
- return state;
-}
-
static void
_utilx_string_set_window_property( Display *dpy, Window win, Atom atom, char *val, unsigned int num)
{
_utilx_string_set_window_property(dpy, win, _atom_comp_fake_launch_image, file_name, 1);
}
-API void utilx_show_fake_effect( Display *dpy, Window win, char *fake_image_file )
-{
- XEvent xev;
-
- _atom_comp_fake_launch = XInternAtom( dpy, "_E_COMP_FAKE_LAUNCH", False );
-
- if( !_atom_comp_fake_launch )
- {
- fprintf( stderr, "XInternAtom(_E_COMP_FAKE_LAUNCH) failed.\n" );
- return;
- }
-
- utilx_set_fake_launch_img(dpy, win, fake_image_file);
-
- XSync(dpy, 0 );
-
- // send fake client message
- xev.xclient.type = ClientMessage;
- xev.xclient.display = dpy;
- xev.xclient.window = win;
- xev.xclient.message_type = _atom_comp_fake_launch;
- xev.xclient.format = 32;
- xev.xclient.data.l[0] = 1; // 1 : start effect , 0 : end effect
- xev.xclient.data.l[1] = 0;
- xev.xclient.data.l[2] = 0;
- xev.xclient.data.l[3] = 0;
- xev.xclient.data.l[4] = 0;
-
- XSendEvent( dpy, win, False,
- SubstructureRedirectMask | SubstructureNotifyMask,
- &xev );
- XSync(dpy, 0 );
-
-}
-
-
-API void utilx_hide_fake_effect( Display *dpy, Window win)
-{
- XEvent xev;
-
- _atom_comp_fake_launch = XInternAtom( dpy, "_E_COMP_FAKE_LAUNCH", False );
- if( !_atom_comp_fake_launch )
- {
- fprintf( stderr, "XInternAtom(_E_COMP_FAKE_LAUNCH) failed.\n" );
- return;
- }
-
- // send fake client message
- xev.xclient.type = ClientMessage;
- xev.xclient.display = dpy;
- xev.xclient.window = win;
- xev.xclient.message_type = _atom_comp_fake_launch;
- xev.xclient.format = 32;
- xev.xclient.data.l[0] = 0; // 1 : start effect , 0 : end effect
- xev.xclient.data.l[1] = 0;
- xev.xclient.data.l[2] = 0;
- xev.xclient.data.l[3] = 0;
- xev.xclient.data.l[4] = 0;
-
- XSendEvent( dpy, win, False,
- SubstructureRedirectMask | SubstructureNotifyMask,
- &xev );
- XSync(dpy, 0 );
-}
-
-static void _utilx_effect_atom_check( Display* dpy )
-{
- if ( dpy == NULL )
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return;
- }
-
- if( !_atom_comp_window_effect_type)
- _atom_comp_window_effect_type = XInternAtom(dpy, "_NET_CM_WINDOW_EFFECT_TYPE",False);
- if( !_atom_comp_effect_default )
- _atom_comp_effect_default = XInternAtom(dpy, "_NET_CM_EFFECT_DEFAULT",False);
- if( !_atom_comp_effect_none )
- _atom_comp_effect_none = XInternAtom(dpy, "_NET_CM_EFFECT_NONE",False);
- if( !_atom_comp_effect_custom0 )
- _atom_comp_effect_custom0 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM0",False);
- if( !_atom_comp_effect_custom1 )
- _atom_comp_effect_custom1 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM1",False);
- if( !_atom_comp_effect_custom2 )
- _atom_comp_effect_custom2 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM2",False);
- if( !_atom_comp_effect_custom3 )
- _atom_comp_effect_custom3 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM3",False);
- if( !_atom_comp_effect_custom4 )
- _atom_comp_effect_custom4 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM4",False);
- if( !_atom_comp_effect_custom5 )
- _atom_comp_effect_custom5 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM5",False);
- if( !_atom_comp_effect_custom6 )
- _atom_comp_effect_custom6 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM6",False);
- if( !_atom_comp_effect_custom7 )
- _atom_comp_effect_custom7 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM7",False);
- if( !_atom_comp_effect_custom8 )
- _atom_comp_effect_custom8 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM8",False);
- if( !_atom_comp_effect_custom9 )
- _atom_comp_effect_custom9 = XInternAtom(dpy, "_NET_CM_EFFECT_CUSTOM9",False);
-}
-
-static Atom _utilx_convert_style_to_atom( Display* dpy, Utilx_Effect_Style style )
-{
- if ( dpy == NULL )
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return _atom_comp_effect_none;
- }
- _utilx_effect_atom_check(dpy);
-
- if ( style == UTILX_EFFECT_STYLE_DEFAULT ) return _atom_comp_effect_default;
- else if ( style == UTILX_EFFECT_STYLE_NONE ) return _atom_comp_effect_none;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM0 ) return _atom_comp_effect_custom0;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM1 ) return _atom_comp_effect_custom1;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM2 ) return _atom_comp_effect_custom2;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM3 ) return _atom_comp_effect_custom3;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM4 ) return _atom_comp_effect_custom4;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM5 ) return _atom_comp_effect_custom5;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM6 ) return _atom_comp_effect_custom6;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM7 ) return _atom_comp_effect_custom7;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM8 ) return _atom_comp_effect_custom8;
- else if ( style == UTILX_EFFECT_STYLE_CUSTOM9 ) return _atom_comp_effect_custom9;
- else return _atom_comp_effect_none;
-
-}
-
-static Utilx_Effect_Style _utilx_convert_atom_to_style( Display* dpy, Atom style )
-{
- if ( dpy == NULL )
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return UTILX_EFFECT_STYLE_NONE;
- }
- _utilx_effect_atom_check(dpy);
-
- if ( style == _atom_comp_effect_default ) return UTILX_EFFECT_STYLE_DEFAULT;
- else if ( style == _atom_comp_effect_none ) return UTILX_EFFECT_STYLE_NONE;
- else if ( style == _atom_comp_effect_custom0 ) return UTILX_EFFECT_STYLE_CUSTOM0;
- else if ( style == _atom_comp_effect_custom1 ) return UTILX_EFFECT_STYLE_CUSTOM1;
- else if ( style == _atom_comp_effect_custom2 ) return UTILX_EFFECT_STYLE_CUSTOM2;
- else if ( style == _atom_comp_effect_custom3 ) return UTILX_EFFECT_STYLE_CUSTOM3;
- else if ( style == _atom_comp_effect_custom4 ) return UTILX_EFFECT_STYLE_CUSTOM4;
- else if ( style == _atom_comp_effect_custom5 ) return UTILX_EFFECT_STYLE_CUSTOM5;
- else if ( style == _atom_comp_effect_custom6 ) return UTILX_EFFECT_STYLE_CUSTOM6;
- else if ( style == _atom_comp_effect_custom7 ) return UTILX_EFFECT_STYLE_CUSTOM7;
- else if ( style == _atom_comp_effect_custom8 ) return UTILX_EFFECT_STYLE_CUSTOM8;
- else if ( style == _atom_comp_effect_custom9 ) return UTILX_EFFECT_STYLE_CUSTOM9;
- else return UTILX_EFFECT_STYLE_DEFAULT;
-}
-
-API void utilx_set_window_effect_style(Display* dpy, Window win, Utilx_Effect_Type type, Utilx_Effect_Style style)
-{
- Atom *window_effect_type_list = NULL;
- if ( dpy == NULL )
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return;
- }
- _utilx_effect_atom_check(dpy);
-
- window_effect_type_list = (Atom *)malloc(sizeof(Atom) * 6);
-
- if ( !window_effect_type_list )
- {
- fprintf (stderr, "[UTILX] Error.. malloc().. %s (%d)\n", __func__, __LINE__);
- return;
- }
-
- window_effect_type_list[0] = _atom_comp_effect_default;
- window_effect_type_list[1] = _atom_comp_effect_default;
- window_effect_type_list[2] = _atom_comp_effect_default;
- window_effect_type_list[3] = _atom_comp_effect_default;
- window_effect_type_list[4] = _atom_comp_effect_default;
- window_effect_type_list[5] = _atom_comp_effect_default;
-
- _utilx_get_window_property(dpy, win, _atom_comp_window_effect_type, XA_ATOM, (unsigned int *)window_effect_type_list, 6);
-
- if ( type == UTILX_EFFECT_TYPE_MAP ) window_effect_type_list[0] = _utilx_convert_style_to_atom(dpy, style);
- else if ( type == UTILX_EFFECT_TYPE_UNMAP ) window_effect_type_list[1] = _utilx_convert_style_to_atom(dpy, style);
- else if ( type == UTILX_EFFECT_TYPE_RAISEABOVE ) window_effect_type_list[2] = _utilx_convert_style_to_atom(dpy, style);
- else if ( type == UTILX_EFFECT_TYPE_ROTATION ) window_effect_type_list[3] = _utilx_convert_style_to_atom(dpy, style);
- else if ( type == UTILX_EFFECT_TYPE_FOCUSIN ) window_effect_type_list[4] = _utilx_convert_style_to_atom(dpy, style);
- else if ( type == UTILX_EFFECT_TYPE_FOCUSOUT ) window_effect_type_list[5] = _utilx_convert_style_to_atom(dpy, style);
-
- _utilx_set_window_property(dpy, win, _atom_comp_window_effect_type, XA_ATOM, (unsigned int *)window_effect_type_list, 6);
-
- XSync(dpy, 0 );
- free(window_effect_type_list);
-}
-
-API Utilx_Effect_Style utilx_get_window_effect_style(Display* dpy, Window win, Utilx_Effect_Type type)
-{
- Atom *window_effect_type_list = NULL;
- Utilx_Effect_Style style = UTILX_EFFECT_STYLE_DEFAULT;
-
- if ( dpy == NULL )
- {
- fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
- return UTILX_EFFECT_STYLE_NONE;
- }
- _utilx_effect_atom_check(dpy);
-
- window_effect_type_list = (Atom *)malloc(sizeof(Atom) * 6);
-
- if ( !window_effect_type_list )
- {
- fprintf (stderr, "[UTILX] Error.. malloc().. %s (%d)\n", __func__, __LINE__);
- return UTILX_EFFECT_STYLE_NONE;
- }
-
- if ( _utilx_get_window_property(dpy, win, _atom_comp_window_effect_type, XA_ATOM, (unsigned int *)window_effect_type_list, 6) != 6 )
- {
- fprintf (stderr, "[UTILX] Error.. get property failed!.. %s (%d)\n", __func__, __LINE__);
- free(window_effect_type_list);
- return UTILX_EFFECT_STYLE_NONE;
- }
-
- if ( type == UTILX_EFFECT_TYPE_MAP ) style = _utilx_convert_atom_to_style(dpy, window_effect_type_list[0]);
- else if ( type == UTILX_EFFECT_TYPE_UNMAP ) style = _utilx_convert_atom_to_style(dpy, window_effect_type_list[1]);
- else if ( type == UTILX_EFFECT_TYPE_RAISEABOVE ) style = _utilx_convert_atom_to_style(dpy, window_effect_type_list[2]);
- else if ( type == UTILX_EFFECT_TYPE_ROTATION ) style = _utilx_convert_atom_to_style(dpy, window_effect_type_list[3]);
- else if ( type == UTILX_EFFECT_TYPE_FOCUSIN ) style = _utilx_convert_atom_to_style(dpy, window_effect_type_list[4]);
- else if ( type == UTILX_EFFECT_TYPE_FOCUSOUT ) style = _utilx_convert_atom_to_style(dpy, window_effect_type_list[5]);
-
- XSync(dpy, 0 );
- free(window_effect_type_list);
- return style;
-}
-
API int utilx_set_window_opaque_state (Display* dpy, Window win, Utilx_Opaque_State state)
{
UTILX_TRACE ("[UTILX] utilx_set_window_opaque_state... win = %x, show_state = %d\n", win, state);
return 1;
}
-static void
-_utilx_screen_capture_atom_ensure (Display* dpy)
+API UtilxScrnConf *utilx_scrnconf_allocate (void)
{
- if (_atom_screen_capture_disable)
- return;
-
- _atom_screen_capture_disable = XInternAtom (dpy, "_CB_SCREEN_CAPTURE_DISABLE", False);
- if (_atom_screen_capture_disable)
- return;
+ UtilxScrnConf *scrnconf = calloc (1, sizeof(UtilxScrnConf));
+ if (!scrnconf)
+ {
+ fprintf (stderr, "fail to allocate UtilxScrnConf\n");
+ return NULL;
+ }
- fprintf (stderr, "[UTILX] Error.. Cannot create _CB_SCREEN_CAPTURE_DISABLE atom.. %s (%d)\n", __func__, __LINE__);
+ return scrnconf;
}
-API int
-utilx_set_screen_capture(Display* dpy, int enable)
+API void utilx_scrnconf_free (UtilxScrnConf *scrnconf)
{
- Window root;
- int disable;
-
- if (!dpy)
- {
- fprintf (stderr, "[UTILX] Error.. dpy is NULL %s (%d)\n", __func__, __LINE__);
- return 0;
- }
-
- root = RootWindow (dpy, DefaultScreen(dpy));
- disable = (enable) ? 0 : 1;
+ if (!scrnconf)
+ return;
- _utilx_screen_capture_atom_ensure (dpy);
+ if (scrnconf->str_output)
+ free (scrnconf->str_output);
- _utilx_set_window_property (dpy, root, _atom_screen_capture_disable, XA_CARDINAL, (unsigned int *)&disable, 1);
+ if (scrnconf->str_resolution)
+ free (scrnconf->str_resolution);
- return 1;
+ free(scrnconf);
+ scrnconf = NULL;
}
-API int
-utilx_get_screen_capture(Display* dpy)
+API int utilx_scrnconf_get_info (Display *dpy, UtilxScrnConf *scrnconf)
{
- Window root;
- int disable = 0;
-
- if (!dpy)
- {
- fprintf (stderr, "[UTILX] Error.. dpy is NULL %s (%d)\n", __func__, __LINE__);
- return 0;
- }
-
- root = RootWindow (dpy, DefaultScreen(dpy));
-
- _utilx_screen_capture_atom_ensure (dpy);
-
- _utilx_get_window_property(dpy, root, _atom_screen_capture_disable, XA_CARDINAL,
- (unsigned int *)&disable, 1);
-
- return (disable) ? 0 : 1;
-}
-
-API void utilx_set_window_cardinal_property(Display* dpy, Window win, Atom atom, unsigned int *value)
-{
- _utilx_set_window_property(dpy, win, atom, XA_CARDINAL, value, 1);
-}
-
-API int utilx_get_window_cardinal_property (Display* dpy, Window win, Atom atom, unsigned int *value)
-{
- return _utilx_get_window_property(dpy, win, atom, XA_CARDINAL, value, 1);
-}
-
-API void utilx_show_capture_effect( Display *dpy, Window win)
-{
- XEvent xev;
-
- _atom_comp_capture_effect = XInternAtom( dpy, "_E_COMP_CAPTURE_EFFECT", False );
- if( !_atom_comp_capture_effect )
- {
- fprintf( stderr, "XInternAtom(_E_COMP_CAPTURE_EFFECT) failed.\n" );
- return;
- }
-
- // send capture effect client message
- xev.xclient.type = ClientMessage;
- xev.xclient.display = dpy;
- xev.xclient.window = win;
- xev.xclient.message_type = _atom_comp_capture_effect;
- xev.xclient.format = 32;
- xev.xclient.data.l[0] = 0;
- xev.xclient.data.l[1] = 0;
- xev.xclient.data.l[2] = 0;
- xev.xclient.data.l[3] = 0;
- xev.xclient.data.l[4] = 0;
-
- XSendEvent( dpy, win, False,
- SubstructureRedirectMask | SubstructureNotifyMask,
- &xev );
- XSync(dpy, 0 );
-}
-
-API UtilxScrnConf *utilx_scrnconf_allocate (void)
-{
- UtilxScrnConf *scrnconf = calloc (1, sizeof(UtilxScrnConf));
- if (!scrnconf)
- {
- fprintf (stderr, "fail to allocate UtilxScrnConf\n");
- return NULL;
- }
-
- return scrnconf;
-}
-
-API void utilx_scrnconf_free (UtilxScrnConf *scrnconf)
-{
- if (!scrnconf)
- return;
-
- if (scrnconf->str_output)
- free (scrnconf->str_output);
-
- if (scrnconf->str_resolution)
- free (scrnconf->str_resolution);
-
- free(scrnconf);
- scrnconf = NULL;
-}
-
-API void utilx_scrnconf_get_info (Display *dpy, UtilxScrnConf *scrnconf)
-{
- Window win = DefaultRootWindow(dpy);
- Atom scrnconf_atom = None;
+ Window win;
+ Atom scrnconf_atom = None;
XTextProperty xtp;
char *str = NULL;
char *ptr = NULL;
int i = 0;
int s;
+ if (!dpy)
+ goto fail;
+
+ if (!scrnconf)
+ goto fail;
+
+ win = DefaultRootWindow(dpy);
+
scrnconf_atom = XInternAtom (dpy, "_SCRNCONF_INFO", False);
/* get property */
{
if (i == 0)
{
- scrnconf->str_output = calloc (1, strlen(ptr));
+ scrnconf->str_output = calloc (1, strlen(ptr)+1);
if (!scrnconf->str_output)
goto fail;
}
else if (i == 2)
{
- scrnconf->str_resolution = calloc (1, strlen(ptr));
+ if (scrnconf->str_resolution) free(scrnconf->str_resolution);
+ scrnconf->str_resolution = calloc (1, strlen(ptr)+1);
if (!scrnconf->str_resolution)
goto fail;
free (str);
- return;
+ return 1;
fail:
if (str)
free (str);
- if (scrnconf->str_output)
- free (scrnconf->str_output);
- if (scrnconf->str_resolution)
- free (scrnconf->str_resolution);
- if (scrnconf)
- {
- free (scrnconf);
- scrnconf = NULL;
- }
- return;
+ return 0;
}
API int utilx_scrnconf_set_dispmode (Display *dpy, Utilx_Scrnconf_Dispmode dispmode)
if (!scrnconf)
return 0;
- utilx_scrnconf_get_info (dpy, scrnconf);
+ if (!utilx_scrnconf_get_info (dpy, scrnconf))
+ {
+ utilx_scrnconf_free (scrnconf);
+ return 0;
+ }
if (scrnconf->status == UTILX_SCRNCONF_STATUS_NULL)
{
fprintf (stderr, "[utilx_scrnconf]: the status of screen configuration is null\n");
+ utilx_scrnconf_free (scrnconf);
return 0;
}
if (scrnconf->dispmode == dispmode)
{
fprintf (stderr, "[utilx_scrnconf]: dispmode (%d) already set\n", dispmode);
- return 0;
+ utilx_scrnconf_free (scrnconf);
+ return 1;
}
utilx_scrnconf_free (scrnconf);
{
Display *dpy;
+ /* PutImage */
int port;
unsigned int width;
unsigned int height;
Pixmap pixmap;
GC gc;
- int drm_fd;
- drm_slp_bufmgr bufmgr;
- void *virtual;
-
- DRI2Buffer* dri2_buffers;
- drm_slp_bo bo;
-
+ /* Damage */
Damage damage;
int damage_base;
+
+ void *virtual;
+
+ /* XShm */
+ XImage *image;
+ XShmSegmentInfo shminfo;
} ShotInfo;
#define FOURCC(a,b,c,d) (((unsigned)d&0xff)<<24 | ((unsigned)c&0xff)<<16 | ((unsigned)b&0xff)<<8 | ((unsigned)a&0xff))
#define FOURCC_RGB32 FOURCC('R','G','B','4')
+#define TIMEOUT_CAPTURE 3
+
+ /* x error handling */
+static Bool x_error_caught;
static ShotInfo *shot_info;
static int
-_get_port (Display *dpy, unsigned int id)
+_get_port (Display *dpy, unsigned int id, Window win)
{
unsigned int ver, rev, req_base, evt_base, err_base;
unsigned int adaptors;
int i, j, p;
if (XvQueryExtension (dpy, &ver, &rev, &req_base, &evt_base, &err_base) != Success)
+ {
+ fprintf (stderr, "[UTILX] no XV extension. \n");
return -1;
+ }
- if (XvQueryAdaptors (dpy, DefaultRootWindow (dpy), &adaptors, &ai) != Success)
+ if (XvQueryAdaptors (dpy, win, &adaptors, &ai) != Success)
+ {
+ fprintf (stderr, "[UTILX] fail : query adaptors. \n");
return -1;
+ }
if (!ai)
+ {
+ fprintf (stderr, "[UTILX] fail : get adaptor info. \n");
return -1;
+ }
for (i = 0; i < adaptors; i++)
{
int support_format = False;
- if (!(ai[i].type & XvStillMask))
+ if (!(ai[i].type & XvInputMask) ||
+ !(ai[i].type & XvStillMask))
continue;
p = ai[i].base_id;
if (!support_format)
continue;
- if (XvGrabPort (dpy, p, 0) == Success)
+ for (; p < ai[i].base_id + ai[i].num_ports; p++)
{
- XvFreeAdaptorInfo (ai);
- return p;
+ if (XvGrabPort (dpy, p, 0) == Success)
+ {
+ XvFreeAdaptorInfo (ai);
+ return p;
+ }
}
fprintf (stderr, "[UTILX] fail : grab port. \n");
static void
_deinit_screen_shot (ShotInfo *info)
{
- Atom atom_stream_off;
-
if (!info)
return;
- atom_stream_off = XInternAtom (info->dpy, "_USER_WM_PORT_ATTRIBUTE_STREAM_OFF", False);
- if (atom_stream_off > 0)
- XvSetPortAttribute (info->dpy, info->port, atom_stream_off, 1);
+ if (info->port > 0 && info->pixmap > 0)
+ XvStopVideo (info->dpy, info->port, info->pixmap);
+
+ if (info->image)
+ XDestroyImage (info->image);
+ if (info->shminfo.shmid != -1)
+ {
+ XShmDetach (info->dpy, &info->shminfo);
+ shmdt (info->shminfo.shmaddr);
+ shmctl (info->shminfo.shmid, IPC_RMID, 0);
+ }
+
+ if (info->damage)
+ XDamageDestroy (info->dpy, info->damage);
- if (info->dri2_buffers)
- free(info->dri2_buffers);
- if (info->bo)
- drm_slp_bo_unref(info->bo);
- if (info->bufmgr)
- drm_slp_bufmgr_destroy (info->bufmgr);
if (info->gc)
XFreeGC (info->dpy, info->gc);
if (info->pixmap > 0)
XFreePixmap (info->dpy, info->pixmap);
if (info->port > 0)
XvUngrabPort (info->dpy, info->port, 0);
- if (info->dpy)
- XCloseDisplay (info->dpy);
+
+ XSync (info->dpy, False);
free (info);
shot_info = NULL;
}
+static int
+_screen_shot_x_error_handle (Display *dpy, XErrorEvent *ev)
+{
+ if (!shot_info || (dpy != shot_info->dpy))
+ return 0;
+
+ x_error_caught = True;
+
+ return 0;
+}
+
+static Bool
+_init_screen_shot_damage (ShotInfo *info)
+{
+ int damage_err_base = 0;
+
+ if (!XDamageQueryExtension(info->dpy, &info->damage_base, &damage_err_base))
+ {
+ fprintf (stderr, "[UTILX] no X Damage extension. \n");
+ return False;
+ }
+
+ info->damage = XDamageCreate (info->dpy, info->pixmap, XDamageReportNonEmpty);
+ if (info->damage <= 0)
+ {
+ fprintf (stderr, "[UTILX] fail : create damage \n");
+ return False;
+ }
+
+ return True;
+}
+
+static Bool
+_init_screen_shot_shm (ShotInfo *info)
+{
+ if (!XShmQueryExtension (info->dpy))
+ {
+ fprintf (stderr, "[UTILX] no XShm extension. !!\n");
+ return False;
+ }
+
+ info->image = XShmCreateImage (info->dpy,
+ DefaultVisual (info->dpy, DefaultScreen (info->dpy)),
+ DefaultDepth (info->dpy, DefaultScreen (info->dpy)),
+ ZPixmap,
+ NULL,
+ &info->shminfo,
+ info->width,
+ info->height);
+ if (!info->image)
+ {
+ fprintf (stderr, "[UTILX] fail : XShmCreateImage \n");
+ return False;
+ }
+
+ info->shminfo.shmid = shmget (IPC_PRIVATE, info->image->bytes_per_line * info->height, IPC_CREAT | 0777);
+ if (info->shminfo.shmid == -1)
+ {
+ XDestroyImage (info->image);
+ fprintf (stderr, "[UTILX] fail : shmget\n");
+ return False;
+ }
+
+ info->shminfo.shmaddr = shmat (info->shminfo.shmid, 0, 0);
+ if (info->shminfo.shmaddr == (void *) -1)
+ {
+ XDestroyImage (info->image);
+ shmctl (info->shminfo.shmid, IPC_RMID, 0);
+ info->shminfo.shmid = -1;
+ fprintf (stderr, "[UTILX] fail : shmat\n");
+ return False;
+ }
+
+ info->shminfo.readOnly = False;
+
+ if (!XShmAttach (info->dpy, &info->shminfo))
+ {
+ XDestroyImage (info->image);
+ shmdt (info->shminfo.shmaddr);
+ shmctl (info->shminfo.shmid, IPC_RMID, 0);
+ info->shminfo.shmid = -1;
+ fprintf (stderr, "[UTILX] fail : XShmAttach\n");
+ return False;
+ }
+
+ info->image->data = info->shminfo.shmaddr;
+ info->virtual = info->shminfo.shmaddr;
+
+ return True;
+}
+
static ShotInfo*
_init_screen_shot (Display* dpy, unsigned int width, unsigned int height)
{
ShotInfo *info = NULL;
- int screen;
- int dri2_base = 0;
- int dri2_err_base = 0;
- int damage_err_base = 0;
- int dri2Major, dri2Minor;
- char *driverName = NULL, *deviceName = NULL;
- Atom atom_capture;
- unsigned int attachments[1];
- int dri2_count, dri2_out_count;
- int dri2_width, dri2_height, dri2_stride;
- drm_magic_t magic;
+ static Atom atom_capture = None;
+ XErrorHandler old_handler = NULL;
if (shot_info)
{
shot_info = info;
/* dpy */
-#if 0
- info->dpy = XOpenDisplay (NULL);
-#else
info->dpy = dpy;
-#endif
+ info->shminfo.shmid = -1;
+ info->shminfo.shmaddr = (void*)-1;
/* port */
- info->port = _get_port (info->dpy, FOURCC_RGB32);
+ info->port = _get_port (info->dpy, FOURCC_RGB32, DefaultRootWindow (dpy));
if (info->port <= 0)
goto fail_init;
/* width, height */
- atom_capture = XInternAtom (info->dpy, "_USER_WM_PORT_ATTRIBUTE_CAPTURE", False);
+ if (atom_capture == None)
+ atom_capture = XInternAtom (info->dpy, "_USER_WM_PORT_ATTRIBUTE_CAPTURE", False);
+
+ XSync (info->dpy, 0);
+ x_error_caught = False;
+ old_handler = XSetErrorHandler (_screen_shot_x_error_handle);
+
XvSetPortAttribute (info->dpy, info->port, atom_capture, 1);
+
+ XSync (info->dpy, 0);
+
+ x_error_caught = False;
+ XSetErrorHandler (old_handler);
+
XvQueryBestSize (info->dpy, info->port, 0, 0, 0, width, height, &width, &height);
if (width <= 0 || height <= 0)
goto fail_init;
width, height,
DefaultDepth (info->dpy, DefaultScreen (info->dpy)));
if (info->pixmap <= 0)
+ {
+ fprintf (stderr, "[UTILX] fail : create pixmap. \n");
goto fail_init;
+ }
/* gc */
info->gc = XCreateGC (info->dpy, info->pixmap, 0, 0);
- if (info->gc <= 0)
+ if (info->gc == NULL)
+ {
+ fprintf (stderr, "[UTILX] fail : create gc. \n");
goto fail_init;
+ }
XSetForeground (info->dpy, info->gc, 0xFF000000);
XFillRectangle (info->dpy, info->pixmap, info->gc, 0, 0, width, height);
- screen = DefaultScreen(info->dpy);
- if (!DRI2QueryExtension (info->dpy, &dri2_base, &dri2_err_base))
+ if (!_init_screen_shot_damage (info))
+ goto fail_init;
+
+ if (!_init_screen_shot_shm (info))
+ goto fail_init;
+ else
+ fprintf (stderr, "[UTILX] XShm success. !!\n");
+
+ if (!info->virtual)
{
- fprintf (stderr, "[UTILX] fail : DRI2QueryExtension !!\n");
+ fprintf (stderr, "[UTILX] fail : get virtual \n");
goto fail_init;
}
- if (!DRI2QueryVersion (info->dpy, &dri2Major, &dri2Minor))
+ XFlush (info->dpy);
+
+ return info;
+
+fail_init:
+ _deinit_screen_shot (info);
+ return NULL;
+}
+
+API void*
+utilx_create_screen_shot (Display* dpy, int width, int height)
+{
+ ShotInfo *info;
+ XEvent ev = {0,};
+ XErrorHandler old_handler = NULL;
+
+ if (dpy == NULL)
{
- fprintf (stderr, "[UTILX] fail : DRI2QueryVersion !!\n");
- goto fail_init;
+ fprintf (stderr, "[UTILX] invalid display(%p) \n", dpy);
+ return NULL;
}
- if (!DRI2Connect (info->dpy, RootWindow(info->dpy, screen), &driverName, &deviceName))
+ if (width <= 0 || height <= 0)
{
- fprintf (stderr, "[UTILX] fail : DRI2Connect !!\n");
- goto fail_init;
+ fprintf (stderr, "[UTILX] invalid size(%dx%d) \n", width, height);
+ return NULL;
}
- /* drm_fd */
- info->drm_fd = open (deviceName, O_RDWR);
- if (info->drm_fd < 0)
+ XSync (dpy, 0);
+
+ info = _init_screen_shot (dpy, width, height);
+
+ if (!info)
{
- fprintf (stderr, "[UTILX] fail : open drm device (%s)\n", deviceName);
- goto fail_init;
+ fprintf (stderr, "[UTILX] fail : initialize screenshot. \n");
+ return NULL;
}
- /* get the drm magic */
- drmGetMagic(info->drm_fd, &magic);
- if (!DRI2Authenticate(info->dpy, RootWindow(info->dpy, screen), magic))
+ XSync (dpy, 0);
+
+ x_error_caught = False;
+ old_handler = XSetErrorHandler (_screen_shot_x_error_handle);
+
+ XvPutStill (info->dpy, info->port, info->pixmap, info->gc,
+ 0, 0, info->width, info->height,
+ 0, 0, info->width, info->height);
+
+ XSync (dpy, 0);
+
+ if (x_error_caught)
{
- fprintf (stderr, "[UTILX] fail : DRI2Authenticate (%d)\n", magic);
- goto fail_init;
+ x_error_caught = False;
+ XSetErrorHandler (old_handler);
+ return NULL;
}
- /* bufmgr */
- info->bufmgr = drm_slp_bufmgr_init (info->drm_fd, NULL);
- if (!info->bufmgr)
+ x_error_caught = False;
+ XSetErrorHandler (old_handler);
+
+ if (XPending (info->dpy))
+ XNextEvent (info->dpy, &ev);
+ else
{
- fprintf (stderr, "[UTILX] fail : init buffer manager \n");
- goto fail_init;
+ int fd = ConnectionNumber (info->dpy);
+ fd_set mask;
+ struct timeval tv;
+ int ret;
+
+ FD_ZERO (&mask);
+ FD_SET (fd, &mask);
+
+ tv.tv_usec = 0;
+ tv.tv_sec = TIMEOUT_CAPTURE;
+
+ ret = select (fd + 1, &mask, 0, 0, &tv);
+ if (ret < 0)
+ fprintf (stderr, "[UTILX] fail: select.\n");
+ else if (ret == 0)
+ fprintf (stderr, "[UTILX] timeout(%d sec)!\n", TIMEOUT_CAPTURE);
+ else if (XPending (info->dpy))
+ XNextEvent (info->dpy, &ev);
+ else
+ fprintf (stderr, "[UTILX] fail: not passed a event!\n");
+ }
+
+ if (ev.type == (info->damage_base + XDamageNotify))
+ {
+ XDamageNotifyEvent *damage_ev = (XDamageNotifyEvent *)&ev;
+ if (damage_ev->drawable == info->pixmap)
+ {
+ XShmGetImage (info->dpy, info->pixmap, info->image, 0, 0, AllPlanes);
+ XDamageSubtract (info->dpy, info->damage, None, None );
+ return info->virtual;
+ }
+
+ XDamageSubtract (info->dpy, info->damage, None, None );
}
- DRI2CreateDrawable (info->dpy, info->pixmap);
+ utilx_release_screen_shot ();
- attachments[0] = DRI2BufferFrontLeft;
- dri2_count = 1;
- info->dri2_buffers = DRI2GetBuffers (info->dpy, info->pixmap, &dri2_width, &dri2_height,
- attachments, dri2_count, &dri2_out_count);
+ return NULL;
+}
- if (!info->dri2_buffers)
+static ShotInfo*
+_init_video_screen_shot (Display* dpy, unsigned int width, unsigned int height, Window win)
+{
+ ShotInfo *info = NULL;
+ static Atom atom_capture = None;
+ static Atom atom_capture_on_win = None;
+ XErrorHandler old_handler = NULL;
+
+ if (shot_info)
{
- fprintf (stderr, "[UTILX] fail : get buffers\n");
- goto fail_init;
+ if (shot_info->width == width && shot_info->height == height)
+ return shot_info;
+
+ _deinit_screen_shot (shot_info);
}
- if (!info->dri2_buffers[0].name)
+ info = calloc (1, sizeof (ShotInfo));
+ if (!info)
+ goto fail_init;
+
+ shot_info = info;
+
+ /* dpy */
+ info->dpy = dpy;
+ info->shminfo.shmid = -1;
+ info->shminfo.shmaddr = (void*)-1;
+
+ /* port */
+ info->port = _get_port (info->dpy, FOURCC_RGB32, win);
+ if (info->port <= 0)
+ goto fail_init;
+
+ /* width, height */
+ if (atom_capture == None)
+ atom_capture = XInternAtom (info->dpy, "_USER_WM_PORT_ATTRIBUTE_CAPTURE", False);
+
+ if (atom_capture_on_win == None)
+ atom_capture_on_win = XInternAtom (info->dpy, "_USER_WM_PORT_ATTRIBUTE_CAPTURE_ON_WINDOW", False);
+
+ XSync (info->dpy, 0);
+ x_error_caught = False;
+ old_handler = XSetErrorHandler (_screen_shot_x_error_handle);
+
+ XvSetPortAttribute (info->dpy, info->port, atom_capture, 3);
+ XvSetPortAttribute (info->dpy, info->port, atom_capture_on_win, 1);
+
+ XSync (info->dpy, 0);
+
+ x_error_caught = False;
+ XSetErrorHandler (old_handler);
+
+ XvQueryBestSize (info->dpy, info->port, 0, 0, 0, width, height, &width, &height);
+ if (width <= 0 || height <= 0)
+ goto fail_init;
+ info->width = width;
+ info->height = height;
+
+ /* pixmap */
+ info->pixmap = XCreatePixmap (info->dpy,
+ win,
+ width, height,
+ DefaultDepth (info->dpy, DefaultScreen (info->dpy)));
+ if (info->pixmap <= 0)
{
- fprintf (stderr, "[UTILX] fail : a handle of the dri2 buffer is null \n ");
+ fprintf (stderr, "[UTILX] fail : create pixmap. \n");
goto fail_init;
}
- info->bo = drm_slp_bo_import (info->bufmgr, info->dri2_buffers[0].name);
- if (!info->bo)
+ /* gc */
+ info->gc = XCreateGC (info->dpy, info->pixmap, 0, 0);
+ if (info->gc == NULL)
{
- fprintf (stderr, "[UTILX] fail : import bo (key:%d)\n", info->dri2_buffers[0].name);
+ fprintf (stderr, "[UTILX] fail : create gc. \n");
goto fail_init;
}
- dri2_stride = info->dri2_buffers[0].pitch;
+ XSetForeground (info->dpy, info->gc, 0xFF000000);
+ XFillRectangle (info->dpy, info->pixmap, info->gc, 0, 0, width, height);
- /* virtual */
- info->virtual = (void*)drm_slp_bo_get_handle (info->bo, DRM_SLP_DEVICE_CPU);
- if (!info->virtual)
- {
- fprintf (stderr, "[UTILX] fail : map \n");
+ if (!_init_screen_shot_damage (info))
goto fail_init;
- }
- if (!XDamageQueryExtension(info->dpy, &info->damage_base, &damage_err_base))
+ if (!_init_screen_shot_shm (info))
goto fail_init;
+ else
+ fprintf (stderr, "[UTILX] XShm success. !!\n");
- info->damage = XDamageCreate (info->dpy, info->pixmap, XDamageReportNonEmpty);
- if (info->damage <= 0)
+ if (!info->virtual)
{
- fprintf (stderr, "[UTILX] fail : create damage \n");
+ fprintf (stderr, "[UTILX] fail : get virtual \n");
goto fail_init;
}
return NULL;
}
+Bool
+predicate_proc(Display *dpy, XEvent *event, char *arg)
+{
+ ShotInfo *info = (ShotInfo *)arg;
+
+ if(event->type == (info->damage_base + XDamageNotify))
+ return True;
+ else
+ return False;
+}
API void*
-utilx_create_screen_shot (Display* dpy, int width, int height)
+utilx_create_video_screen_shot (Display* dpy, Window win, int width, int height)
{
ShotInfo *info;
- XEvent ev;
+ XEvent ev = {0,};
+ XErrorHandler old_handler = NULL;
+ unsigned int pixmap = 0;
- if (dpy <= 0)
+ if (dpy == NULL)
{
fprintf (stderr, "[UTILX] invalid display(%p) \n", dpy);
return NULL;
return NULL;
}
- info = _init_screen_shot (dpy, width, height);
+ XSync (dpy, 0);
+
+ info = _init_video_screen_shot (dpy, width, height, win);
+
if (!info)
{
fprintf (stderr, "[UTILX] fail : initialize screenshot. \n");
return NULL;
}
- XSync (info->dpy, 0);
+ if (!_atom_window_pixman)
+ {
+ _atom_window_pixman = XInternAtom (dpy, "_UTIL_WINDOW_PIXMAP_HANDLE", False);
+ if (!_atom_window_pixman)
+ {
+ fprintf (stderr, "[UTILX] Error.. Cannot create _UTIL_WINDOW_PIXMAP_HANDLE atom.. %s (%d)\n", __func__, __LINE__);
+ return 0;
+ }
+ }
+
+ x_error_caught = False;
+ old_handler = XSetErrorHandler (_screen_shot_x_error_handle);
+
+ pixmap = (unsigned int)info->pixmap;
+ XChangeProperty (dpy, win, _atom_window_pixman, XA_PIXMAP, 32, PropModeReplace, (unsigned char *)((unsigned int *)&pixmap), 1);
+ XSync (dpy, 0);
+
+ if (x_error_caught)
+ {
+ x_error_caught = False;
+ XSetErrorHandler (old_handler);
+ return NULL;
+ }
- XvGetStill (info->dpy, info->port, info->pixmap, info->gc,
+ XvPutStill (info->dpy, info->port, info->pixmap, info->gc,
0, 0, info->width, info->height,
0, 0, info->width, info->height);
+ XSync (dpy, 0);
- XSync (info->dpy, 0);
+ if (x_error_caught)
+ {
+ x_error_caught = False;
+ XSetErrorHandler (old_handler);
+ return NULL;
+ }
- XNextEvent (info->dpy, &ev); /* wating for x event */
+ XDeleteProperty(info->dpy, win, _atom_window_pixman);
+ _atom_window_pixman = None;
+ XSync (dpy, 0);
+ x_error_caught = False;
+ XSetErrorHandler (old_handler);
+
+ XIfEvent(info->dpy, &ev, predicate_proc, info);
if (ev.type == (info->damage_base + XDamageNotify))
{
XDamageNotifyEvent *damage_ev = (XDamageNotifyEvent *)&ev;
if (damage_ev->drawable == info->pixmap)
{
+ XShmGetImage (info->dpy, info->pixmap, info->image, 0, 0, AllPlanes);
XDamageSubtract (info->dpy, info->damage, None, None );
return info->virtual;
}
{
_deinit_screen_shot (shot_info);
}
+
+#define XRR_PROPERTY_FB_VISIBLE "XRR_PROPERTY_FB_VISIBLE"
+#define XRR_PROPERTY_VIDEO_OFFSET "XRR_PROPERTY_VIDEO_OFFSET"
+
+static Bool
+_utilx_xrr_set_property (Display* dpy, Atom atom, unsigned char *buf, int buf_len, unsigned char **get)
+{
+ Window root = None;
+ XRRScreenResources *res = NULL;
+ RROutput rr_output = None;
+ int i;
+
+ root = XRootWindow (dpy, 0);
+ if (root == None)
+ {
+ fprintf (stderr, "[UTILX] Warning : Root window is None.. %s (%d)\n", __func__, __LINE__);
+ return False;
+ }
+
+ res = XRRGetScreenResources (dpy, root);
+ if (res == NULL || res->noutput == 0)
+ {
+ fprintf (stderr, "[UTILX] Warning : ScreenResources is None.. %s (%d)\n", __func__, __LINE__);
+ return False;
+ }
+
+ for (i = 0; i < res->noutput; i++)
+ {
+ XRROutputInfo *output_info = XRRGetOutputInfo (dpy, res, res->outputs[i]);
+ if (output_info)
+ {
+ if (!strcmp (output_info->name, "LVDS1"))
+ {
+ rr_output = res->outputs[i];
+ XRRFreeOutputInfo(output_info);
+ break;
+ }
+ XRRFreeOutputInfo(output_info);
+ }
+ }
+
+ if (rr_output == None)
+ {
+ fprintf (stderr, "[UTILX] Warning : output is None.. %s (%d)\n", __func__, __LINE__);
+ XRRFreeScreenResources (res);
+ return False;
+ }
+
+ XRRChangeOutputProperty (dpy, rr_output, atom,
+ XA_CARDINAL, 8, PropModeReplace, buf, buf_len);
+
+ if (get)
+ {
+ Atom actual_type;
+ int actual_format;
+ unsigned long nitems, bytes_after;
+
+ XRRGetOutputProperty (dpy, rr_output, atom,
+ 0, 1024L,
+ True, False, XA_CARDINAL,
+ &actual_type, &actual_format,
+ &nitems, &bytes_after,
+ get);
+ }
+
+ XSync (dpy, 0);
+
+ XRRFreeScreenResources (res);
+
+ return True;
+}
+
+API void
+utilx_set_fb_visible (Display* dpy, Utilx_Fb_Type fb, Bool visible)
+{
+ static Atom property = None;
+ char buf[8192] = {0,};
+ char *p = buf;
+ int buf_len = 0;
+
+ if (!dpy)
+ {
+ fprintf (stderr, "[UTILX] invalid display(%p).. %s (%d)\n", dpy, __func__, __LINE__);
+ return;
+ }
+
+ if (fb <= UTILX_FB_TYPE_NONE || fb > UTILX_FB_TYPE_OVERLAY)
+ {
+ fprintf (stderr, "[UTILX] Error.. Invald fb(%d).. %s (%d)\n", fb, __func__, __LINE__);
+ return;
+ }
+
+ p += sprintf (p, "%d:", 0);
+ p += sprintf (p, "%d", fb + 2);
+ p += sprintf (p, ":%d", (visible > 0)? 1 : 0);
+
+ *p = '\0';
+ p++;
+
+ buf_len = p - buf;
+
+ if (property == None)
+ property = XInternAtom (dpy, XRR_PROPERTY_FB_VISIBLE, False);
+
+ if (property == None)
+ {
+ fprintf (stderr, "[UTILX] Warning : FB_VISIBLE property is None.. %s (%d)\n", __func__, __LINE__);
+ return;
+ }
+
+ if (!_utilx_xrr_set_property (dpy, property, (unsigned char*)buf, buf_len, NULL))
+ {
+ fprintf (stderr, "[UTILX] Warning : set_property failed.. %s (%d)\n", __func__, __LINE__);
+ return;
+ }
+}
+
+API Bool
+utilx_get_fb_visible (Display* dpy, Utilx_Fb_Type fb)
+{
+ static Atom property = None;
+ char buf[32] = {0,};
+ char *p = buf;
+ int buf_len = 0;
+ unsigned char *prop = NULL;
+ Bool visible = False;
+
+ if (!dpy)
+ {
+ fprintf (stderr, "[UTILX] invalid display(%p).. %s (%d)\n", dpy, __func__, __LINE__);
+ return False;
+ }
+
+ if (fb <= UTILX_FB_TYPE_NONE || fb > UTILX_FB_TYPE_OVERLAY)
+ {
+ fprintf (stderr, "[UTILX] Error.. Invald fb(%d).. %s (%d)\n", fb, __func__, __LINE__);
+ return False;
+ }
+
+ p += sprintf (p, "%d:", 0);
+ p += sprintf (p, "%d", fb + 2);
+
+ *p = '\0';
+ p++;
+
+ buf_len = p - buf;
+
+ if (property == None)
+ property = XInternAtom (dpy, XRR_PROPERTY_FB_VISIBLE, False);
+
+ if (property == None)
+ {
+ fprintf (stderr, "[UTILX] Warning : FB_VISIBLE property is None.. %s (%d)\n", __func__, __LINE__);
+ return False;
+ }
+
+ if (!_utilx_xrr_set_property (dpy, property, (unsigned char*)buf, buf_len, &prop))
+ {
+ fprintf (stderr, "[UTILX] Warning : set_property failed.. %s (%d)\n", __func__, __LINE__);
+ return False;
+ }
+
+ if (prop)
+ visible = atoi((char*)prop);
+
+ return visible;
+}