Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        ecore-e16.c ecore-e16.h ewmh.c 


Log Message:
Track ecore_x changes.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecore-e16.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -3 -r1.1.2.4 -r1.1.2.5
--- ecore-e16.c 27 Oct 2004 23:32:52 -0000      1.1.2.4
+++ ecore-e16.c 29 Nov 2004 23:29:29 -0000      1.1.2.5
@@ -70,6 +70,9 @@
  * General stuff
  */
 
+/*
+ * Send client message (format 32)
+ */
 int
 ecore_x_client_message32_send(Window win, Atom type, long d0, long d1,
                              long d2, long d3, long d4)
@@ -90,6 +93,48 @@
 }
 
 /*
+ * Set UTF-8 string property
+ */
+static void
+_ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom,
+                                    const char *str)
+{
+   _ATOM_SET_UTF8_STRING(win, atom, str);
+}
+
+/*
+ * Get UTF-8 string property
+ */
+static char        *
+_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
+{
+   char               *str;
+   unsigned char      *prop_return;
+   Atom                type_ret;
+   unsigned long       bytes_after, num_ret;
+   int                 format_ret;
+
+   str = NULL;
+   prop_return = NULL;
+   XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
+                     _ecore_x_atom_utf8_string, &type_ret,
+                     &format_ret, &num_ret, &bytes_after, &prop_return);
+   if (prop_return && num_ret > 0 && format_ret == 8)
+     {
+       str = malloc(num_ret + 1);
+       if (str)
+         {
+            memcpy(str, prop_return, num_ret);
+            str[num_ret] = '\0';
+         }
+     }
+   if (prop_return)
+      XFree(prop_return);
+
+   return str;
+}
+
+/*
  * ICCCM stuff
  */
 Atom                _ecore_x_atom_wm_state = 0;
@@ -197,6 +242,9 @@
 Atom                _ecore_x_atom_net_active_window;
 
 Atom                _ecore_x_atom_net_wm_name;
+Atom                _ecore_x_atom_net_wm_visible_name;
+Atom                _ecore_x_atom_net_wm_icon_name;
+Atom                _ecore_x_atom_net_wm_visible_icon_name;
 
 void
 ecore_x_netwm_init(void)
@@ -226,11 +274,11 @@
 #endif
 
    _ecore_x_atom_net_wm_name = _ATOM_GET("_NET_WM_NAME");
-#if 0
    _ecore_x_atom_net_wm_visible_name = _ATOM_GET("_NET_WM_VISIBLE_NAME");
    _ecore_x_atom_net_wm_icon_name = _ATOM_GET("_NET_WM_ICON_NAME");
    _ecore_x_atom_net_wm_visible_icon_name =
       _ATOM_GET("_NET_WM_VISIBLE_ICON_NAME");
+#if 0
    _ecore_x_atom_net_wm_desktop = _ATOM_GET("_NET_WM_DESKTOP");
    _ecore_x_atom_net_wm_window_type = _ATOM_GET("_NET_WM_WINDOW_TYPE");
    _ecore_x_atom_net_wm_state = _ATOM_GET("_NET_WM_STATE");
@@ -440,4 +488,62 @@
    _ATOM_SET_WINDOW(_ecore_x_atom_net_active_window, root, &win, 1);
 }
 
+/*
+ * Client window properties
+ */
+
+void
+ecore_x_netwm_name_set(Ecore_X_Window win, const char *name)
+{
+   _ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_name, win, name);
+}
+
+char               *
+ecore_x_netwm_name_get(Ecore_X_Window win)
+{
+   return _ecore_x_window_prop_string_utf8_get(win, _ecore_x_atom_net_wm_name);
+}
+
+void
+ecore_x_netwm_visible_name_set(Ecore_X_Window win, const char *name)
+{
+   _ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_visible_name, win,
+                                       name);
+}
+
+char               *
+ecore_x_netwm_visible_name_get(Ecore_X_Window win)
+{
+   return _ecore_x_window_prop_string_utf8_get(win,
+                                              
_ecore_x_atom_net_wm_visible_name);
+}
+
+void
+ecore_x_netwm_icon_name_set(Ecore_X_Window win, const char *name)
+{
+   _ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_icon_name, win,
+                                       name);
+}
+
+char               *
+ecore_x_netwm_icon_name_get(Ecore_X_Window win)
+{
+   return _ecore_x_window_prop_string_utf8_get(win,
+                                              _ecore_x_atom_net_wm_icon_name);
+}
+
+void
+ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, const char *name)
+{
+   _ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_visible_icon_name,
+                                       win, name);
+}
+
+char               *
+ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win)
+{
+   return _ecore_x_window_prop_string_utf8_get(win,
+                                              
_ecore_x_atom_net_wm_visible_icon_name);
+}
+
 #endif /* USE_ECORE_X */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecore-e16.h,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -3 -r1.1.2.8 -r1.1.2.9
--- ecore-e16.h 27 Oct 2004 23:32:52 -0000      1.1.2.8
+++ ecore-e16.h 29 Nov 2004 23:29:29 -0000      1.1.2.9
@@ -118,6 +118,18 @@
                                                           p_clients);
 void                ecore_x_netwm_client_active_set(Ecore_X_Window root,
                                                    Ecore_X_Window win);
+void                ecore_x_netwm_name_set(Ecore_X_Window win,
+                                          const char *name);
+char               *ecore_x_netwm_name_get(Ecore_X_Window win);
+void                ecore_x_netwm_icon_name_set(Ecore_X_Window win,
+                                               const char *name);
+char               *ecore_x_netwm_icon_name_get(Ecore_X_Window win);
+void                ecore_x_netwm_visible_name_set(Ecore_X_Window win,
+                                                  const char *name);
+char               *ecore_x_netwm_visible_name_get(Ecore_X_Window win);
+void                ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win,
+                                                       const char *name);
+char               *ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win);
 
 #endif
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.55.2.16
retrieving revision 1.55.2.17
diff -u -3 -r1.55.2.16 -r1.55.2.17
--- ewmh.c      21 Nov 2004 22:15:20 -0000      1.55.2.16
+++ ewmh.c      29 Nov 2004 23:29:29 -0000      1.55.2.17
@@ -458,11 +458,9 @@
 {
    const char         *str;
 
-   EDBUG(6, "EWMH_SetWindowName");
    str = EstrInt2Enc(name, 1);
-   _ATOM_SET_UTF8_STRING(_NET_WM_NAME, win, str);
+   ecore_x_netwm_name_set(win, str);
    EstrInt2EncFree(str, 1);
-   EDBUG_RETURN_;
 }
 
 void
@@ -533,46 +531,32 @@
 EWMH_GetWindowName(EWin * ewin)
 {
    char               *val;
-   int                 size;
 
-   EDBUG(6, "EWMH_GetWindowName");
+   _EFREE(ewin->ewmh.wm_name);
 
-   val = AtomGet(ewin->client.win, _NET_WM_NAME, E_XA_UTF8_STRING, &size);
+   val = ecore_x_netwm_name_get(ewin->client.win);
    if (!val)
-      goto done;
-
-   if (ewin->ewmh.wm_name)
-      Efree(ewin->ewmh.wm_name);
-   ewin->ewmh.wm_name = EstrUtf82Int(val, size);
-
+      return;
+   ewin->ewmh.wm_name = EstrUtf82Int(val, 0);
    Efree(val);
-   EwinChange(ewin, EWIN_CHANGE_NAME);
 
- done:
-   EDBUG_RETURN_;
+   EwinChange(ewin, EWIN_CHANGE_NAME);
 }
 
 void
 EWMH_GetWindowIconName(EWin * ewin)
 {
    char               *val;
-   int                 size;
 
-   EDBUG(6, "EWMH_GetWindowIconName");
+   _EFREE(ewin->ewmh.wm_icon_name);
 
-   val = AtomGet(ewin->client.win, _NET_WM_ICON_NAME, E_XA_UTF8_STRING, &size);
+   val = ecore_x_netwm_icon_name_get(ewin->client.win);
    if (!val)
-      goto done;
-
-   if (ewin->ewmh.wm_icon_name)
-      Efree(ewin->ewmh.wm_icon_name);
-   ewin->ewmh.wm_icon_name = EstrUtf82Int(val, size);
-
+      return;
+   ewin->ewmh.wm_icon_name = EstrUtf82Int(val, 0);
    Efree(val);
-   EwinChange(ewin, EWIN_CHANGE_ICON_NAME);
 
- done:
-   EDBUG_RETURN_;
+   EwinChange(ewin, EWIN_CHANGE_ICON_NAME);
 }
 
 void




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to