Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ecore

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


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


Log Message:
API for manipulating the WM_CLIENT_MACHINE string.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- Ecore_X.h   12 Oct 2003 07:12:09 -0000      1.9
+++ Ecore_X.h   12 Oct 2003 17:35:35 -0000      1.10
@@ -104,6 +104,7 @@
 typedef struct _Ecore_X_Event_Window_Prop_Visible_Title_Change     
Ecore_X_Event_Window_Prop_Visible_Title_Change;
 typedef struct _Ecore_X_Event_Window_Prop_Icon_Name_Change         
Ecore_X_Event_Window_Prop_Icon_Name_Change;
 typedef struct _Ecore_X_Event_Window_Prop_Visible_Icon_Name_Change 
Ecore_X_Event_Window_Prop_Visible_Icon_Name_Change;
+typedef struct _Ecore_X_Event_Window_Prop_Client_Machine_Change      
Ecore_X_Event_Window_Prop_Client_Machine_Change;
 typedef struct _Ecore_X_Event_Window_Prop_Name_Class_Change        
Ecore_X_Event_Window_Prop_Name_Class_Change;
      
 struct _Ecore_X_Event_Key_Down
@@ -393,6 +394,13 @@
    Ecore_X_Time    time;
 };
 
+struct _Ecore_X_Event_Window_Prop_Client_Machine_Change
+{
+   Ecore_X_Window  win;
+   char   *name;
+   Ecore_X_Time    time;
+};
+
 struct _Ecore_X_Event_Window_Prop_Name_Class_Change
 {
    Ecore_X_Window  win;
@@ -440,6 +448,7 @@
 extern int ECORE_X_EVENT_WINDOW_PROP_VISIBLE_TITLE_CHANGE;
 extern int ECORE_X_EVENT_WINDOW_PROP_ICON_NAME_CHANGE;
 extern int ECORE_X_EVENT_WINDOW_PROP_VISIBLE_ICON_NAME_CHANGE;
+extern int ECORE_X_EVENT_WINDOW_PROP_CLIENT_MACHINE_CHANGE;
 extern int ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE;
    
 extern int ECORE_X_MODIFIER_SHIFT;
@@ -527,6 +536,8 @@
 char            *ecore_x_window_prop_icon_name_get(Ecore_X_Window win);
 void             ecore_x_window_prop_visible_icon_name_set(Ecore_X_Window win, const 
char *t);
 char            *ecore_x_window_prop_visible_icon_name_get(Ecore_X_Window win);
+void             ecore_x_window_prop_client_machine_set(Ecore_X_Window win, const 
char *t);
+char            *ecore_x_window_prop_client_machine_get(Ecore_X_Window win);
 void             ecore_x_window_prop_name_class_set(Ecore_X_Window win, const char 
*n, const char *c);
 void             ecore_x_window_prop_name_class_get(Ecore_X_Window win, char **n, 
char **c);
 void             ecore_x_window_prop_protocol_set(Ecore_X_Window win, 
Ecore_X_WM_Protocol protocol, int on);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ecore_x.c   12 Oct 2003 07:15:26 -0000      1.11
+++ ecore_x.c   12 Oct 2003 17:35:35 -0000      1.12
@@ -30,6 +30,7 @@
 Atom     _ecore_x_atom_wm_class = 0;
 Atom     _ecore_x_atom_wm_name = 0;
 Atom     _ecore_x_atom_wm_icon_name = 0;
+Atom     _ecore_x_atom_wm_client_machine = 0;
 Atom     _ecore_x_atom_motif_wm_hints = 0;
 Atom     _ecore_x_atom_win_layer = 0;
 Atom     _ecore_x_atom_net_wm_desktop = 0;
@@ -96,6 +97,7 @@
 int ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE = 0;
 int ECORE_X_EVENT_WINDOW_PROP_ICON_NAME_CHANGE = 0;
 int ECORE_X_EVENT_WINDOW_PROP_VISIBLE_ICON_NAME_CHANGE = 0;
+int ECORE_X_EVENT_WINDOW_PROP_CLIENT_MACHINE_CHANGE = 0;
 
 int ECORE_X_MODIFIER_SHIFT = 0;
 int ECORE_X_MODIFIER_CTRL = 0;
@@ -251,6 +253,7 @@
    _ecore_x_atom_wm_class                 = XInternAtom(_ecore_x_disp, "WM_CLASS", 
False);
    _ecore_x_atom_wm_name                  = XInternAtom(_ecore_x_disp, "WM_NAME", 
False);
    _ecore_x_atom_wm_icon_name             = XInternAtom(_ecore_x_disp, 
"WM_ICON_NAME", False);
+   _ecore_x_atom_wm_client_machine        = XInternAtom(_ecore_x_disp, 
"WM_CLIENT_MACHINE", False);
    _ecore_x_atom_motif_wm_hints           = XInternAtom(_ecore_x_disp, 
"_MOTIF_WM_HINTS", False);
    _ecore_x_atom_win_layer                = XInternAtom(_ecore_x_disp, "_WIN_LAYER", 
False);
    _ecore_x_atom_net_current_desktop      = XInternAtom(_ecore_x_disp, 
"_NET_CURRENT_DESKTOP", False);
@@ -396,7 +399,7 @@
       Window parent_r;
       Window *children_r = NULL;
       int num_children = 0;
-      Window root = RootWindow(d->display, i);
+      Window root = RootWindow(_ecore_x_disp, i);
 
       while (XQueryTree(_ecore_x_disp, root, &root_r, &parent_r,
                &children_r, &num_children) && num_children > 0)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ecore_x_events.c    12 Oct 2003 06:55:40 -0000      1.7
+++ ecore_x_events.c    12 Oct 2003 17:35:35 -0000      1.8
@@ -7,6 +7,7 @@
 static void _ecore_x_event_free_window_prop_visible_title_change(void *data, void 
*ev);
 static void _ecore_x_event_free_window_prop_icon_name_change(void *data, void *ev);
 static void _ecore_x_event_free_window_prop_visible_icon_name_change(void *data, void 
*ev);
+static void _ecore_x_event_free_window_prop_client_machine_change(void *data, void 
*ev);
 static void _ecore_x_event_free_key_down(void *data, void *ev);
 static void _ecore_x_event_free_key_up(void *data, void *ev);
 static void _ecore_x_event_free_generic(void *data, void *ev);
@@ -33,33 +34,29 @@
 }
 
 static void
-_ecore_x_event_free_key_down(void *data, void *ev)
+_ecore_x_event_free_window_prop_visible_title_change(void *data, void *ev)
 {
-   Ecore_X_Event_Key_Down *e;
-
+   Ecore_X_Event_Window_Prop_Visible_Title_Change *e;
+   
    e = ev;
-   if (e->keyname) free(e->keyname);
-   if (e->keysymbol) free(e->keysymbol);
-   if (e->key_compose) free(e->key_compose);
+   if (e->title) free(e->title);
    free(e);
 }
 
 static void
-_ecore_x_event_free_key_up(void *data, void *ev)
+_ecore_x_event_free_window_prop_icon_name_change(void *data, void *ev)
 {
-   Ecore_X_Event_Key_Up *e;
-
+   Ecore_X_Event_Window_Prop_Icon_Name_Change *e;
+   
    e = ev;
-   if (e->keyname) free(e->keyname);
-   if (e->keysymbol) free(e->keysymbol);
-   if (e->key_compose) free(e->key_compose);
+   if (e->name) free(e->name);
    free(e);
 }
 
 static void
-_ecore_x_event_free_window_prop_icon_name_change(void *data, void *ev)
+_ecore_x_event_free_window_prop_visible_icon_name_change(void *data, void *ev)
 {
-   Ecore_X_Event_Window_Prop_Icon_Name_Change *e;
+   Ecore_X_Event_Window_Prop_Visible_Icon_Name_Change *e;
    
    e = ev;
    if (e->name) free(e->name);
@@ -67,9 +64,9 @@
 }
 
 static void
-_ecore_x_event_free_window_prop_visible_icon_name_change(void *data, void *ev)
+_ecore_x_event_free_window_prop_client_machine_change(void *data, void *ev)
 {
-   Ecore_X_Event_Window_Prop_Visible_Icon_Name_Change *e;
+   Ecore_X_Event_Window_Prop_Client_Machine_Change *e;
    
    e = ev;
    if (e->name) free(e->name);
@@ -77,12 +74,26 @@
 }
 
 static void
-_ecore_x_event_free_window_prop_visible_title_change(void *data, void *ev)
+_ecore_x_event_free_key_down(void *data, void *ev)
 {
-   Ecore_X_Event_Window_Prop_Visible_Title_Change *e;
-   
+   Ecore_X_Event_Key_Down *e;
+
    e = ev;
-   if (e->title) free(e->title);
+   if (e->keyname) free(e->keyname);
+   if (e->keysymbol) free(e->keysymbol);
+   if (e->key_compose) free(e->key_compose);
+   free(e);
+}
+
+static void
+_ecore_x_event_free_key_up(void *data, void *ev)
+{
+   Ecore_X_Event_Key_Up *e;
+
+   e = ev;
+   if (e->keyname) free(e->keyname);
+   if (e->keysymbol) free(e->keysymbol);
+   if (e->key_compose) free(e->key_compose);
    free(e);
 }
 
@@ -771,6 +782,15 @@
        if (!e) return;
        e->name = ecore_x_window_prop_visible_icon_name_get(xevent->xproperty.window);
        ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_VISIBLE_ICON_NAME_CHANGE, e, 
_ecore_x_event_free_window_prop_visible_icon_name_change, NULL);
+     }
+   else if (xevent->xproperty.atom == _ecore_x_atom_wm_client_machine)
+     {
+       Ecore_X_Event_Window_Prop_Client_Machine_Change *e;
+       
+       e = calloc(1, sizeof(Ecore_X_Event_Window_Prop_Client_Machine_Change));
+       if (!e) return;
+       e->name = ecore_x_window_prop_client_machine_get(xevent->xproperty.window);
+       ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_CLIENT_MACHINE_CHANGE, e, 
_ecore_x_event_free_window_prop_client_machine_change, NULL);
      }
    else 
    {
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ecore_x_private.h   12 Oct 2003 06:55:40 -0000      1.7
+++ ecore_x_private.h   12 Oct 2003 17:35:35 -0000      1.8
@@ -57,6 +57,7 @@
 extern Atom     _ecore_x_atom_wm_class;
 extern Atom     _ecore_x_atom_wm_name;
 extern Atom     _ecore_x_atom_wm_icon_name;
+extern Atom     _ecore_x_atom_wm_client_machine;
 extern Atom     _ecore_x_atom_motif_wm_hints;
 extern Atom     _ecore_x_atom_win_layer;
 extern Atom     _ecore_x_atom_net_wm_desktop;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ecore_x_window_prop.c       12 Oct 2003 06:55:40 -0000      1.10
+++ ecore_x_window_prop.c       12 Oct 2003 17:35:35 -0000      1.11
@@ -277,6 +277,37 @@
 }
 
 /**
+ * Set a window client machine.
+ * @param win The window
+ * @param t The client machine string
+ * 
+ * Set a window client machine string
+ * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ */
+void
+ecore_x_window_prop_client_machine_set(Ecore_X_Window win, const char *t)
+{
+   ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_client_machine, (char *)t);
+}
+
+/**
+ * Get a window client machine string.
+ * @param win The window
+ * @return The windows client machine string
+ * 
+ * Return the client machine of a window. String must be free'd when done with.
+ * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ */
+char *
+ecore_x_window_prop_client_machine_get(Ecore_X_Window win)
+{
+   char *name;
+
+   name = ecore_x_window_prop_string_get(win, _ecore_x_atom_wm_client_machine);
+   return name;
+}
+
+/**
  * Set a window name & class.
  * @param win The window
  * @param n The name string




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