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.c ecore_x_window_prop.c 


Log Message:
The start of desktop change notification, added the ability to set the command
used to launch a window (set in the defaults).

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- Ecore_X.h   14 Jan 2004 04:43:51 -0000      1.22
+++ Ecore_X.h   14 Jan 2004 23:08:58 -0000      1.23
@@ -120,6 +120,7 @@
 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;
 typedef struct _Ecore_X_Event_Window_Prop_Pid_Change      
Ecore_X_Event_Window_Prop_Pid_Change;
+typedef struct _Ecore_X_Event_Window_Prop_Desktop_Change      
Ecore_X_Event_Window_Prop_Desktop_Change;
      
 struct _Ecore_X_Event_Key_Down
 {
@@ -446,6 +447,13 @@
    Ecore_X_Time    time;
 };
 
+struct _Ecore_X_Event_Window_Prop_Desktop_Change
+{
+   Ecore_X_Window  win;
+   long    desktop;
+   Ecore_X_Time    time;
+};
+
 extern int ECORE_X_EVENT_KEY_DOWN;
 extern int ECORE_X_EVENT_KEY_UP;
 extern int ECORE_X_EVENT_MOUSE_BUTTON_DOWN;
@@ -488,6 +496,7 @@
 extern int ECORE_X_EVENT_WINDOW_PROP_CLIENT_MACHINE_CHANGE;
 extern int ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE;
 extern int ECORE_X_EVENT_WINDOW_PROP_PID_CHANGE;
+extern int ECORE_X_EVENT_WINDOW_PROP_DESKTOP_CHANGE;
    
 extern int ECORE_X_MODIFIER_SHIFT;
 extern int ECORE_X_MODIFIER_CTRL;
@@ -626,6 +635,8 @@
 char            *ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom 
type);
 void             ecore_x_window_prop_title_set(Ecore_X_Window win, const char *t);
 char            *ecore_x_window_prop_title_get(Ecore_X_Window win);
+void             ecore_x_window_prop_command_set(Ecore_X_Window win, int argc, char 
**argv);
+void             ecore_x_window_prop_command_get(Ecore_X_Window win, int *argc, char 
***argv);
 void             ecore_x_window_prop_visible_title_set(Ecore_X_Window win, const char 
*t);
 char            *ecore_x_window_prop_visible_title_get(Ecore_X_Window win);
 void             ecore_x_window_prop_icon_name_set(Ecore_X_Window win, const char *t);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ecore_x.c   6 Jan 2004 03:42:05 -0000       1.20
+++ ecore_x.c   14 Jan 2004 23:08:58 -0000      1.21
@@ -32,6 +32,7 @@
 Atom     _ecore_x_atom_wm_protocols = 0;
 Atom     _ecore_x_atom_wm_class = 0;
 Atom     _ecore_x_atom_wm_name = 0;
+Atom     _ecore_x_atom_wm_command = 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;
@@ -151,6 +152,7 @@
 int ECORE_X_EVENT_WINDOW_PROP_VISIBLE_ICON_NAME_CHANGE = 0;
 int ECORE_X_EVENT_WINDOW_PROP_CLIENT_MACHINE_CHANGE = 0;
 int ECORE_X_EVENT_WINDOW_PROP_PID_CHANGE = 0;
+int ECORE_X_EVENT_WINDOW_PROP_DESKTOP_CHANGE = 0;
 
 int ECORE_X_MODIFIER_SHIFT = 0;
 int ECORE_X_MODIFIER_CTRL = 0;
@@ -274,6 +276,7 @@
        ECORE_X_EVENT_WINDOW_PROP_VISIBLE_ICON_NAME_CHANGE = ecore_event_type_new();
        ECORE_X_EVENT_WINDOW_PROP_CLIENT_MACHINE_CHANGE    = ecore_event_type_new();
        ECORE_X_EVENT_WINDOW_PROP_PID_CHANGE               = ecore_event_type_new();
+       ECORE_X_EVENT_WINDOW_PROP_DESKTOP_CHANGE               = 
ecore_event_type_new();
      }
    
    ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L);
@@ -307,6 +310,7 @@
    _ecore_x_atom_wm_protocols             = XInternAtom(_ecore_x_disp, 
"WM_PROTOCOLS", False);
    _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_command               = XInternAtom(_ecore_x_disp, "WM_COMMAND", 
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);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ecore_x_events.c    14 Jan 2004 05:18:43 -0000      1.15
+++ ecore_x_events.c    14 Jan 2004 23:08:58 -0000      1.16
@@ -10,6 +10,7 @@
 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_window_prop_pid_change(void *data, void *ev);
+static void _ecore_x_event_free_window_prop_desktop_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);
@@ -78,7 +79,16 @@
 static void
 _ecore_x_event_free_window_prop_pid_change(void *data, void *ev)
 {
-   Ecore_X_Event_Window_Prop_Client_Machine_Change *e;
+   Ecore_X_Event_Window_Prop_Pid_Change *e;
+   
+   e = ev;
+   free(e);
+}
+
+static void
+_ecore_x_event_free_window_prop_desktop_change(void *data, void *ev)
+{
+   Ecore_X_Event_Window_Prop_Desktop_Change *e;
    
    e = ev;
    free(e);
@@ -831,6 +841,15 @@
    _ecore_x_event_last_time = e->time;
        ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_PID_CHANGE, e, 
_ecore_x_event_free_window_prop_pid_change, NULL);
      }
+   else if (xevent->xproperty.atom == _ecore_x_atom_net_wm_desktop)
+     {
+       Ecore_X_Event_Window_Prop_Desktop_Change *e;
+       
+       e = calloc(1, sizeof(Ecore_X_Event_Window_Prop_Desktop_Change));
+       if (!e) return;
+       e->desktop = ecore_x_window_prop_desktop_get(xevent->xproperty.window);
+       ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_PID_CHANGE, e, 
_ecore_x_event_free_window_prop_desktop_change, NULL);
+     }
    else 
    {
       Ecore_X_Event_Window_Property *e;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- ecore_x_private.h   10 Jan 2004 21:01:18 -0000      1.14
+++ ecore_x_private.h   14 Jan 2004 23:08:58 -0000      1.15
@@ -72,6 +72,7 @@
 extern Atom     _ecore_x_atom_wm_protocols;
 extern Atom     _ecore_x_atom_wm_class;
 extern Atom     _ecore_x_atom_wm_name;
+extern Atom     _ecore_x_atom_wm_command;
 extern Atom     _ecore_x_atom_wm_icon_name;
 extern Atom     _ecore_x_atom_wm_client_machine;
 extern Atom     _ecore_x_atom_motif_wm_hints;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ecore_x_window.c    14 Oct 2003 21:42:28 -0000      1.8
+++ ecore_x_window.c    14 Jan 2004 23:08:58 -0000      1.9
@@ -180,6 +180,8 @@
 {
    long pid;
    char buf[MAXHOSTNAMELEN];
+   int argc;
+   char **argv;
 
    /*
     * Set WM_CLIENT_MACHINE.
@@ -197,6 +199,9 @@
                                    32, &pid, 1);
 
    ecore_x_window_prop_window_type_normal_set(win);
+
+   ecore_app_args_get(&argc, &argv);
+   ecore_x_window_prop_command_set(win, argc, argv);
 }
 
 /**
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ecore_x_window_prop.c       11 Jan 2004 00:51:15 -0000      1.22
+++ ecore_x_window_prop.c       14 Jan 2004 23:08:58 -0000      1.23
@@ -217,6 +217,36 @@
 }
 
 /**
+ * Set a window command.
+ * @param win The window
+ * @param t The command string
+ * 
+ * Set a window command
+ * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ */
+void
+ecore_x_window_prop_command_set(Ecore_X_Window win, int argc, char **argv)
+{
+   XSetCommand(_ecore_x_disp, win, argv, argc);
+}
+
+/**
+ * Get a window command.
+ * @param win The window
+ * @return The windows command string
+ * 
+ * Return the command 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>
+ */
+void
+ecore_x_window_prop_command_get(Ecore_X_Window win, int *argc, char ***argv)
+{
+   XGetCommand(_ecore_x_disp, win, argv, argc);
+}
+
+
+
+/**
  * Set a window visible title.
  * @param win The window
  * @param t The visible title string




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to