Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        ecore_x.c ecore_x_private.h ecore_x_window_prop.c 


Log Message:
Follow the netwm spec and use UTF8 string encoding. Avoid non-portable Xlib
functions too.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ecore_x.c   12 Oct 2003 05:01:41 -0000      1.6
+++ ecore_x.c   12 Oct 2003 05:34:47 -0000      1.7
@@ -50,6 +50,8 @@
 Atom     _ecore_x_atom_net_wm_handle_icons = 0;
 Atom     _ecore_x_atom_net_wm_user_time = 0;
 
+Atom     _ecore_x_atom_utf8_string = 0;
+
 Atom     _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM] = {0};
 
 int ECORE_X_EVENT_KEY_DOWN = 0;
@@ -260,6 +262,8 @@
    _ecore_x_atom_net_wm_icon             = XInternAtom(_ecore_x_disp, "_NET_WM_ICON", 
False);
    _ecore_x_atom_net_wm_pid              = XInternAtom(_ecore_x_disp, "_NET_WM_PID", 
False);
    _ecore_x_atom_net_wm_user_time        = XInternAtom(_ecore_x_disp, 
"_NET_WM_USER_TIME", False);
+
+   _ecore_x_atom_utf8_string             = XInternAtom(_ecore_x_disp, "UTF8_STRING", 
False);
 
    _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_DELETE_REQUEST] = 
_ecore_x_atom_wm_delete_window;
    _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_TAKE_FOCUS] = 
_ecore_x_atom_wm_take_focus;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ecore_x_private.h   11 Oct 2003 22:14:22 -0000      1.4
+++ ecore_x_private.h   12 Oct 2003 05:34:47 -0000      1.5
@@ -81,6 +81,8 @@
 
 extern Atom     _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
 
+extern Atom     _ecore_x_atom_utf8_string;
+
 void _ecore_x_error_handler_init(void);
 void _ecore_x_event_handle_key_press(XEvent *xevent);
 void _ecore_x_event_handle_key_release(XEvent *xevent);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ecore_x_window_prop.c       12 Oct 2003 05:01:41 -0000      1.7
+++ ecore_x_window_prop.c       12 Oct 2003 05:34:47 -0000      1.8
@@ -101,7 +101,7 @@
    if (win == 0) win = DefaultRootWindow(_ecore_x_disp);
    xtp.value = str;
    xtp.format = 8;
-   xtp.encoding = XA_STRING;
+   xtp.encoding = _ecore_x_atom_utf8_string;
    xtp.nitems = strlen(str);
    XSetTextProperty(_ecore_x_disp, win, &xtp, type);
 }
@@ -129,7 +129,7 @@
        
        if (xtp.format == 8)
          {
-            s = Xutf8TextPropertyToTextList(_ecore_x_disp, &xtp, &list, &items);
+            s = XmbTextPropertyToTextList(_ecore_x_disp, &xtp, &list, &items);
             if ((s == Success) && (items > 0))
               {
                  str = strdup(*list);
@@ -156,8 +156,8 @@
 void
 ecore_x_window_prop_title_set(Ecore_X_Window win, const char *t)
 {
-   ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_name, t);
-   ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_name, t);
+   ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_name, (char *)t);
+   ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_name, (char *)t);
 }
 
 /**
@@ -189,7 +189,8 @@
 void
 ecore_x_window_prop_visible_title_set(Ecore_X_Window win, const char *t)
 {
-   ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_visible_name, t);
+   ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_visible_name,
+                                 (char *)t);
 }
 
 /**




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to