Enlightenment CVS committal

Author  : kwo
Project : e17
Module  : libs/ecore

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


Modified Files:
        Ecore_X.h ecore_x_netwm.c 


Log Message:
Add a few netwm functions.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- Ecore_X.h   26 Nov 2004 08:27:44 -0000      1.79
+++ Ecore_X.h   29 Nov 2004 23:25:10 -0000      1.80
@@ -800,6 +800,7 @@
 EAPI void             ecore_x_dnd_aware_set(Ecore_X_Window win, int on);
 EAPI int              ecore_x_dnd_version_get(Ecore_X_Window win);
 EAPI int              ecore_x_dnd_begin (Ecore_X_Window source, unsigned char 
*data, int size);
+EAPI void             ecore_x_dnd_send_status(int will_accept, int suppress, 
Ecore_X_Rectangle rectangle, Ecore_X_Atom action);
                  
 EAPI Ecore_X_Window   ecore_x_window_new(Ecore_X_Window parent, int x, int y, 
int w, int h);
 EAPI Ecore_X_Window   ecore_x_window_override_new(Ecore_X_Window parent, int 
x, int y, int w, int h);
@@ -869,6 +870,7 @@
 EAPI Ecore_X_WM_Protocol *ecore_x_window_prop_protocol_list_get(Ecore_X_Window 
win, int *num_ret);
 EAPI void             ecore_x_window_prop_sticky_set(Ecore_X_Window win, int 
on);
 EAPI int              ecore_x_window_prop_input_mode_set(Ecore_X_Window win, 
Ecore_X_Window_Input_Mode mode);
+EAPI int              ecore_x_window_prop_initial_state_set(Ecore_X_Window 
win, Ecore_X_Window_State_Hint state);
 EAPI void             ecore_x_window_prop_min_size_set(Ecore_X_Window win, int 
w, int h);
 EAPI void             ecore_x_window_prop_max_size_set(Ecore_X_Window win, int 
w, int h);
 EAPI void             ecore_x_window_prop_base_size_set(Ecore_X_Window win, 
int w, int h);
@@ -914,20 +916,6 @@
 EAPI int              ecore_x_client_message32_send(Ecore_X_Window win, 
Ecore_X_Atom type, long d0, long d1, long d2, long d3, long d4);
 EAPI int              ecore_x_client_message8_send(Ecore_X_Window win, 
Ecore_X_Atom type, const void *data, int len);
 
-#if 0 /* ??? */
-   EAPI void                ecore_x_netwm_init(void);
-#endif
-   EAPI void                ecore_x_netwm_desk_count_set(Ecore_X_Window root, 
int n_desks);
-   EAPI void                ecore_x_netwm_desk_roots_set(Ecore_X_Window root, 
int n_desks, Ecore_X_Window * vroots);
-   EAPI void                ecore_x_netwm_desk_names_set(Ecore_X_Window root, 
int n_desks, const char **names);
-   EAPI void                ecore_x_netwm_desk_size_set(Ecore_X_Window root, 
int width, int height);
-   EAPI void                ecore_x_netwm_desk_workareas_set(Ecore_X_Window 
root, int n_desks, int *areas);
-   EAPI void                ecore_x_netwm_desk_current_set(Ecore_X_Window 
root, int desk);
-   EAPI void                ecore_x_netwm_desk_viewports_set(Ecore_X_Window 
root, int n_desks, int *origins);
-   EAPI void                ecore_x_netwm_showing_desktop_set(Ecore_X_Window 
root, int on);
-   EAPI void                ecore_x_netwm_client_list_set(Ecore_X_Window root, 
int n_clients, Ecore_X_Window * p_clients);
-   EAPI void                
ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root, int n_clients, 
Ecore_X_Window * p_clients);
-   EAPI void                ecore_x_netwm_client_active_set(Ecore_X_Window 
root, Ecore_X_Window win);
    
    /* FIXME: these funcs need categorising */
    EAPI void            ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int 
*x, int *y, int *w, int *h);
@@ -939,7 +927,7 @@
    EAPI void            ecore_x_window_client_manage(Ecore_X_Window win);
    EAPI void            ecore_x_window_sniff(Ecore_X_Window win);
    EAPI void            ecore_x_window_client_sniff(Ecore_X_Window win);
-   EAPI Ecore_X_Atom    ecore_x_atom_get(char *name);
+   EAPI Ecore_X_Atom    ecore_x_atom_get(const char *name);
 
    EAPI void
      ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint 
state);
@@ -1087,6 +1075,14 @@
    EAPI void                ecore_x_netwm_client_list_set(Ecore_X_Window root, 
int n_clients, Ecore_X_Window * p_clients);
    EAPI void                
ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root, int n_clients, 
Ecore_X_Window * p_clients);
    EAPI void                ecore_x_netwm_client_active_set(Ecore_X_Window 
root, Ecore_X_Window win);
+   EAPI void                ecore_x_netwm_name_set(Ecore_X_Window win, const 
char *name);
+   EAPI char               *ecore_x_netwm_name_get(Ecore_X_Window win);
+   EAPI void                ecore_x_netwm_visible_name_set(Ecore_X_Window win, 
const char *name);
+   EAPI char               *ecore_x_netwm_visible_name_get(Ecore_X_Window win);
+   EAPI void                ecore_x_netwm_icon_name_set(Ecore_X_Window win, 
const char *name);
+   EAPI char               *ecore_x_netwm_icon_name_get(Ecore_X_Window win);
+   EAPI void                ecore_x_netwm_visible_icon_name_set(Ecore_X_Window 
win, const char *name);
+   EAPI char               *ecore_x_netwm_visible_icon_name_get(Ecore_X_Window 
win);
    
    /* FIXME: these funcs need categorising */
    EAPI void            ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int 
*x, int *y, int *w, int *h);
@@ -1098,7 +1094,7 @@
    EAPI void            ecore_x_window_client_manage(Ecore_X_Window win);
    EAPI void            ecore_x_window_sniff(Ecore_X_Window win);
    EAPI void            ecore_x_window_client_sniff(Ecore_X_Window win);
-   EAPI Ecore_X_Atom    ecore_x_atom_get(char *name);
+   EAPI Ecore_X_Atom    ecore_x_atom_get(const char *name);
 
    typedef struct _Ecore_X_Window_Attributes
      {
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_netwm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore_x_netwm.c     27 Oct 2004 21:50:58 -0000      1.2
+++ ecore_x_netwm.c     29 Nov 2004 23:25:12 -0000      1.3
@@ -29,6 +29,52 @@
 
 
 /*
+ * Convenience functions. Should probably go elsewhere.
+ */
+
+/*
+ * 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;
+}
+
+
+/*
  * Root window NetWM hints.
  */
 Atom     _ecore_x_atom_net_supported = 0;
@@ -316,3 +362,51 @@
 {
    _ATOM_SET_WINDOW(_ecore_x_atom_net_active_window, root, &win, 1);
 }
+
+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_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_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_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);
+}       




-------------------------------------------------------
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