Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

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


Modified Files:
        Ecore_X.h ecore_x.c 


Log Message:


move to simpler calls.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- Ecore_X.h   22 Sep 2004 08:17:15 -0000      1.60
+++ Ecore_X.h   17 Oct 2004 06:21:21 -0000      1.61
@@ -34,10 +34,6 @@
 extern "C" {
 #endif
    
-#ifndef _ECORE_X_PRIVATE_H
-typedef void Ecore_X_Reply;   
-#endif
-
 typedef struct _Ecore_X_Rectangle {
    int x, y;
    unsigned int width, height;
@@ -890,9 +886,7 @@
    void            ecore_x_window_client_sniff(Ecore_X_Window win);
    Ecore_X_Atom    ecore_x_atom_get(char *name);
 
-   void            ecore_x_reply_del(Ecore_X_Reply *reply);
-       
-   typedef struct _Ecore_X_Reply_Window_Attributes
+   typedef struct _Ecore_X_Window_Attributes
      {
        Ecore_X_Window     root;
        int                x, y, w, h;
@@ -917,11 +911,10 @@
         * Visual *visual;
         */
      }
-   Ecore_X_Reply_Window_Attributes;
-   Ecore_X_Reply *
-     ecore_x_window_attributes_fetch(Ecore_X_Window win,
-                                    void (*func) (void *data, Ecore_X_Reply *reply, 
void *reply_data),
-                                    void *data);
+   Ecore_X_Window_Attributes;
+   
+   int
+     ecore_x_window_attributes_get(Ecore_X_Window win, Ecore_X_Window_Attributes 
*att_ret);
        
    Ecore_X_Cursor
      ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int 
hot_y);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- ecore_x.c   22 Sep 2004 08:17:15 -0000      1.40
+++ ecore_x.c   17 Oct 2004 06:21:21 -0000      1.41
@@ -990,82 +990,40 @@
    return XInternAtom(_ecore_x_disp, name, False);
 }
 
-void
-ecore_x_reply_del(Ecore_X_Reply *reply)
-{
-   ecore_job_del(reply->job);
-   reply->reply_data_free(reply->reply_data);
-   free(reply);
-}
 
-static void _ecore_x_reply_call(void *data);
-static void
-_ecore_x_reply_call(void *data)
-{
-   Ecore_X_Reply *reply;
-   
-   reply = data;
-   reply->func(reply->data, reply, reply->reply_data);
-   reply->reply_data_free(reply->reply_data);
-   free(reply);
-}
 
-Ecore_X_Reply *
-ecore_x_window_attributes_fetch(Ecore_X_Window win,
-                               void (*func) (void *data, Ecore_X_Reply *reply, void 
*reply_data),
-                               void *data)
+
+
+
+int
+ecore_x_window_attributes_get(Ecore_X_Window win, Ecore_X_Window_Attributes *att_ret)
 {
-   Ecore_X_Reply *reply;
-   Ecore_X_Reply_Window_Attributes *reply_data;
+   XWindowAttributes att;
    
-   reply = calloc(1, sizeof(Ecore_X_Reply));
-   if (!reply) return NULL;
-   reply_data = calloc(1, sizeof(Ecore_X_Reply_Window_Attributes));
-   if (!reply_data)
-     {
-       free(reply);
-       return NULL;
-     }
-   reply->reply_data = reply_data;
-   reply->reply_data_free = free;
-   reply->func = func;
-   reply->data = data;
-   
-     {
-       XWindowAttributes att;
-       
-       if (!XGetWindowAttributes(_ecore_x_disp, win, &att))
-         {
-            reply->reply_data_free(reply->reply_data);
-            free(reply);
-            return NULL;
-         }
-       reply_data->root = att.root;
-       reply_data->x = att.x;
-       reply_data->y = att.y;
-       reply_data->w = att.width;
-       reply_data->h = att.height;
-       reply_data->border = att.border_width;
-       reply_data->depth = att.depth;
-       if (att.map_state != IsUnmapped) reply_data->visible = 1;
-       if (att.map_state == IsViewable) reply_data->viewable = 1;
-       if (att.override_redirect) reply_data->override = 1;
-       if (att.class == InputOnly) reply_data->input_only = 1;
-       if (att.save_under) reply_data->save_under = 1;
-       reply_data->event_mask.mine = att.your_event_mask;
-       reply_data->event_mask.all = att.your_event_mask;
-       reply_data->event_mask.no_propagate = att.do_not_propagate_mask;
-     }
-   reply->job = ecore_job_add(_ecore_x_reply_call, reply);
-   if (!reply->job)
-     {
-       reply->reply_data_free(reply->reply_data);
-       free(reply);
-       return NULL;
-     }
-   return reply;
+   if (!XGetWindowAttributes(_ecore_x_disp, win, &att)) return 0;
+   memset(att_ret, 0, sizeof(Ecore_X_Window_Attributes));
+   att_ret->root = att.root;
+   att_ret->x = att.x;
+   att_ret->y = att.y;
+   att_ret->w = att.width;
+   att_ret->h = att.height;
+   att_ret->border = att.border_width;
+   att_ret->depth = att.depth;
+   if (att.map_state != IsUnmapped) att_ret->visible = 1;
+   if (att.map_state == IsViewable) att_ret->viewable = 1;
+   if (att.override_redirect) att_ret->override = 1;
+   if (att.class == InputOnly) att_ret->input_only = 1;
+   if (att.save_under) att_ret->save_under = 1;
+   att_ret->event_mask.mine = att.your_event_mask;
+   att_ret->event_mask.all = att.your_event_mask;
+   att_ret->event_mask.no_propagate = att.do_not_propagate_mask;
+   return 1;
 }
 
+
+
+
+
 Ecore_X_Cursor
 ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int 
hot_y)
 {




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to