upload tizen1.0 source
authorKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:01:28 +0000 (17:01 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:01:28 +0000 (17:01 +0900)
COPYING
debian/changelog
packaging/libslp-utilx.spec
utilX.h [changed mode: 0755->0644]
x11.c [changed mode: 0755->0644]

diff --git a/COPYING b/COPYING
index 4ec25ed..4a8b190 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
+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.
index 4bb2ce0..60370e3 100644 (file)
@@ -1,6 +1,14 @@
+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 
+  * Add a key string (KEY_MEDIA) for Earset multimedia key
   * Git: slp/pkgs/l/libslp-utilx
   * Tag: libslp-utilx_0.1.7-2
 
@@ -57,7 +65,7 @@ libslp-utilx (0.1.5-2) unstable; urgency=low
 libslp-utilx (0.1.5-1) unstable; urgency=low
 
   * Changed the boilerplate of sources
-  * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx 
+  * 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
@@ -66,7 +74,7 @@ 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 
+  * 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
@@ -74,24 +82,24 @@ libslp-utilx (0.1.5-0) unstable; urgency=low
 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 
+  * 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 
+  * 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 
+  * 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
 
@@ -154,7 +162,7 @@ libslp-utilx (0.1.1-19) unstable; urgency=low
 
 libslp-utilx (0.1.1-18) unstable; urgency=low
 
-  * [COMP] change effect type, effect style's enum string more clearly. 
+  * [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
 
@@ -162,7 +170,7 @@ libslp-utilx (0.1.1-18) unstable; urgency=low
 
 libslp-utilx (0.1.1-17) unstable; urgency=low
 
-  * [COMP] add custom effect related api 
+  * [COMP] add custom effect related api
   * Git: 165.213.180.234:slp/pkgs/l/libslp-utilx
   * Tag: libslp-utilx_0.1.1-17
 
@@ -227,7 +235,7 @@ libslp-utilx (0.1.1-10) unstable; urgency=low
 
 libslp-utilx (0.1.1-9) unstable; urgency=low
 
-  * [COMP] change window effect related name  
+  * [COMP] change window effect related name
   * Git: 165.213.180.234:/git/slp/pkgs/libslp-utilx
   * Tag: libslp-utilx_0.1.1-9
 
@@ -235,9 +243,9 @@ libslp-utilx (0.1.1-9) unstable; urgency=low
 
 libslp-utilx (0.1.1-8) unstable; urgency=low
 
-  * 1. Update documentation 
+  * 1. Update documentation
     2. Add boilerplate in source files
-    3. Add COPYING,AUTHORS 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
@@ -255,7 +263,7 @@ libslp-utilx (0.1.1-7) unstable; urgency=low
 
 libslp-utilx (0.1.1-6) unstable; urgency=low
 
-  * [COMP] add XSync when effect property is changed. 
+  * [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
 
@@ -271,7 +279,7 @@ libslp-utilx (0.1.1-5) unstable; urgency=low
 
 libslp-utilx (0.1.1-4) unstable; urgency=low
 
-  * [COMP] Add Feature : set/get window effect state and set fake launch effect 
+  * [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
 
index 68eb259..3945544 100644 (file)
@@ -3,7 +3,7 @@ Summary:    utilX
 Version:       0.1.7
 Release:    1.1
 Group:      System/Libraries
-License:    SAMSUNG
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
diff --git a/utilX.h b/utilX.h
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/x11.c b/x11.c
old mode 100755 (executable)
new mode 100644 (file)
index 51659fa..0831cb0
--- a/x11.c
+++ b/x11.c
@@ -1,7 +1,7 @@
 /*
  * libslp-utilx
  *
-   Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
+   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.
@@ -42,6 +42,8 @@ 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;
@@ -76,6 +78,8 @@ 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)
 {
        UTILX_TRACE ("[UTILX] utilx_set_system_notification_level... win = %x, level = %d\n", win, level);
@@ -181,6 +185,40 @@ error:
        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)
 {
@@ -192,18 +230,22 @@ API void utilx_enable_indicator (Display* dpy, Window win, int enable)
                return;
        }
 
-       if (!_atom_indicator_visible_state)
+       if (!_utilx_get_indicator_atoms(dpy))
        {
-               _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;
-               }
+               fprintf (stderr, "[UTILX] Error.. Cannot create atoms.. %s (%d)\n", __func__, __LINE__);
+               return;
        }
 
-       _utilx_set_window_property (dpy, win, _atom_indicator_visible_state, XA_CARDINAL,
-                       (unsigned int *)&enable, 1);
+       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);
+       }
 }
 
 
@@ -212,7 +254,7 @@ 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;
-       int state;
+       Atom state;
 
        if (dpy == NULL)
        {
@@ -220,21 +262,24 @@ API int utilx_get_indicator_state (Display* dpy, Window win)
                return -1;
        }
 
-       if (!_atom_indicator_visible_state)
+       if (!_utilx_get_indicator_atoms(dpy))
        {
-               _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 -1;
-               }
+               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_CARDINAL,
+       ret = _utilx_get_window_property (dpy, win, _atom_indicator_visible_state, XA_ATOM,
                        (unsigned int *)&state, 1);
 
        if (ret > 0)
-               return state;
+       {
+               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;
 }