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


Log Message:
Provide an API and events for _NET_WM_VISIBLE_NAME.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- Ecore_X.h   11 Oct 2003 22:14:21 -0000      1.5
+++ Ecore_X.h   12 Oct 2003 05:01:41 -0000      1.6
@@ -99,9 +99,10 @@
 typedef struct _Ecore_X_Event_Client_Message           Ecore_X_Event_Client_Message;
 typedef struct _Ecore_X_Event_Window_Shape             Ecore_X_Event_Window_Shape;
 
-typedef struct _Ecore_X_Event_Window_Delete_Request         
Ecore_X_Event_Window_Delete_Request;
-typedef struct _Ecore_X_Event_Window_Prop_Title_Change      
Ecore_X_Event_Window_Prop_Title_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_Delete_Request            
Ecore_X_Event_Window_Delete_Request;
+typedef struct _Ecore_X_Event_Window_Prop_Title_Change         
Ecore_X_Event_Window_Prop_Title_Change;
+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_Name_Class_Change    
Ecore_X_Event_Window_Prop_Name_Class_Change;
      
 struct _Ecore_X_Event_Key_Down
 {
@@ -369,6 +370,13 @@
    Ecore_X_Time    time;
 };
 
+struct _Ecore_X_Event_Window_Prop_Visible_Title_Change
+{
+   Ecore_X_Window  win;
+   char   *title;
+   Ecore_X_Time    time;
+};
+
 struct _Ecore_X_Event_Window_Prop_Name_Class_Change
 {
    Ecore_X_Window  win;
@@ -413,6 +421,7 @@
 
 extern int ECORE_X_EVENT_WINDOW_DELETE_REQUEST;
 extern int ECORE_X_EVENT_WINDOW_PROP_TITLE_CHANGE;
+extern int ECORE_X_EVENT_WINDOW_PROP_VISIBLE_TITLE_CHANGE;
 extern int ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE;
    
 extern int ECORE_X_MODIFIER_SHIFT;
@@ -493,6 +502,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_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_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.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ecore_x.c   11 Oct 2003 22:14:21 -0000      1.5
+++ ecore_x.c   12 Oct 2003 05:01:41 -0000      1.6
@@ -88,6 +88,7 @@
 
 int ECORE_X_EVENT_WINDOW_DELETE_REQUEST = 0;
 int ECORE_X_EVENT_WINDOW_PROP_TITLE_CHANGE = 0;
+int ECORE_X_EVENT_WINDOW_PROP_VISIBLE_TITLE_CHANGE = 0;
 int ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE = 0;
 
 int ECORE_X_MODIFIER_SHIFT = 0;
@@ -204,9 +205,10 @@
        ECORE_X_EVENT_CLIENT_MESSAGE           = ecore_event_type_new();
        ECORE_X_EVENT_WINDOW_SHAPE             = ecore_event_type_new();
        
-       ECORE_X_EVENT_WINDOW_DELETE_REQUEST         = ecore_event_type_new();
-       ECORE_X_EVENT_WINDOW_PROP_TITLE_CHANGE      = ecore_event_type_new();
-        ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE = ecore_event_type_new();
+       ECORE_X_EVENT_WINDOW_DELETE_REQUEST            = ecore_event_type_new();
+       ECORE_X_EVENT_WINDOW_PROP_TITLE_CHANGE         = ecore_event_type_new();
+       ECORE_X_EVENT_WINDOW_PROP_VISIBLE_TITLE_CHANGE = ecore_event_type_new();
+        ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE    = ecore_event_type_new();
      }
    
    ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ecore_x_events.c    9 Oct 2003 02:20:37 -0000       1.3
+++ ecore_x_events.c    12 Oct 2003 05:01:41 -0000      1.4
@@ -4,6 +4,7 @@
 
 static void _ecore_x_event_free_window_prop_name_class_change(void *data, void *ev);
 static void _ecore_x_event_free_window_prop_title_change(void *data, void *ev);
+static void _ecore_x_event_free_window_prop_visible_title_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);
@@ -30,6 +31,16 @@
 }
 
 static void
+_ecore_x_event_free_window_prop_visible_title_change(void *data, void *ev)
+{
+   Ecore_X_Event_Window_Prop_Visible_Title_Change *e;
+   
+   e = ev;
+   if (e->title) free(e->title);
+   free(e);
+}
+
+static void
 _ecore_x_event_free_key_down(void *data, void *ev)
 {
    Ecore_X_Event_Key_Down *e;
@@ -711,6 +722,15 @@
        if (!e) return;
        e->title = ecore_x_window_prop_title_get(xevent->xproperty.window);
        ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_TITLE_CHANGE, e, 
_ecore_x_event_free_window_prop_title_change, NULL);
+     }
+   else if (xevent->xproperty.atom == _ecore_x_atom_net_wm_visible_name)
+     {
+       Ecore_X_Event_Window_Prop_Visible_Title_Change *e;
+       
+       e = calloc(1, sizeof(Ecore_X_Event_Window_Prop_Visible_Title_Change));
+       if (!e) return;
+       e->title = ecore_x_window_prop_visible_title_get(xevent->xproperty.window);
+       ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_VISIBLE_TITLE_CHANGE, e, 
_ecore_x_event_free_window_prop_visible_title_change, NULL);
      }
    else 
    {
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ecore_x_window_prop.c       11 Oct 2003 22:15:44 -0000      1.6
+++ ecore_x_window_prop.c       12 Oct 2003 05:01:41 -0000      1.7
@@ -111,7 +111,7 @@
  * @param win The window
  * @param type The property
  * 
- * Get a window string property
+ * Return window string property of a window. String must be free'd when done.
  * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
  */
 char *
@@ -175,6 +175,37 @@
 
    title = ecore_x_window_prop_string_get(win, _ecore_x_atom_net_wm_name);
    if (!title) title = ecore_x_window_prop_string_get(win, _ecore_x_atom_wm_name);
+   return title;
+}
+
+/**
+ * Set a window visible title.
+ * @param win The window
+ * @param t The visible title string
+ * 
+ * Set a window visible title
+ * <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ */
+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);
+}
+
+/**
+ * Get a window visible title.
+ * @param win The window
+ * @return The windows visible title string
+ * 
+ * Return the visible title 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_visible_title_get(Ecore_X_Window win)
+{
+   char *title;
+
+   title = ecore_x_window_prop_string_get(win, _ecore_x_atom_net_wm_visible_name);
    return title;
 }
 




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