From: <enl...@li...> - 2003-05-07 02:20:37
|
Enlightenment CVS committal Author : raster Project : e17 Module : libs/ecore Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: Tag: SPLIT Ecore_X.h Makefile.am ecore_x.c ecore_x_private.h Log Message: start of calls that do async fetches from x.... =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/Ecore_X.h,v retrieving revision 1.1.2.26 retrieving revision 1.1.2.27 diff -u -3 -r1.1.2.26 -r1.1.2.27 --- Ecore_X.h 5 May 2003 09:03:50 -0000 1.1.2.26 +++ Ecore_X.h 7 May 2003 02:20:05 -0000 1.1.2.27 @@ -15,7 +15,7 @@ #endif #ifndef _ECORE_X_PRIVATE_H - +typedef void Ecore_X_Reply; #endif typedef enum _Ecore_X_Event_Mode @@ -416,14 +416,6 @@ void ecore_x_window_reparent(Ecore_X_Window win, Ecore_X_Window new_parent, int x, int y); void ecore_x_window_size_get(Ecore_X_Window win, int *w, int *h); void ecore_x_window_cursor_show(Ecore_X_Window win, int show); - - /* FIXME: these funcs need categorising */ - - Ecore_X_Window *ecore_x_window_root_list(int *num_ret); - int ecore_x_window_manage(Ecore_X_Window win); - void ecore_x_window_container_manage(Ecore_X_Window win); - void ecore_x_window_client_manage(Ecore_X_Window win); - void ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Atom format, int size, void *data, int number); void ecore_x_window_prop_title_set(Ecore_X_Window win, const char *t); @@ -448,6 +440,49 @@ Ecore_X_GC ecore_x_gc_new(Ecore_X_Drawable draw); void ecore_x_gc_del(Ecore_X_GC gc); + + + /* FIXME: these funcs need categorising */ + + Ecore_X_Window *ecore_x_window_root_list(int *num_ret); + int ecore_x_window_manage(Ecore_X_Window win); + void ecore_x_window_container_manage(Ecore_X_Window win); + void ecore_x_window_client_manage(Ecore_X_Window win); + + void ecore_x_reply_del(Ecore_X_Reply *reply); + + typedef struct _Ecore_X_Reply_Window_Attributes + { + Ecore_X_Window root; + int x, y, w, h; + int border; + int depth; + char visible : 1; + char viewable : 1; + char override : 1; + char input_only : 1; + char save_under : 1; + struct { + Ecore_X_Event_Mask mine; + Ecore_X_Event_Mask all; + Ecore_X_Event_Mask no_propagate; + } event_mask; + /* FIXME: missing + * Colormap comormap; + * int map_installed; + * int bit_gravity; + * int win_gravity; + * Screen *screen; + * 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); + + #ifdef __cplusplus } #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/Makefile.am,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -3 -r1.1.2.7 -r1.1.2.8 --- Makefile.am 15 Feb 2003 14:54:29 -0000 1.1.2.7 +++ Makefile.am 7 May 2003 02:20:05 -0000 1.1.2.8 @@ -2,6 +2,7 @@ INCLUDES = \ -I$(top_srcdir)/src/lib/ecore \ +-I$(top_srcdir)/src/lib/ecore_job \ @x_cflags@ libecore_x_la_LDFLAGS = -version-info 1:0:0 @@ -25,11 +26,13 @@ libecore_x_la_LIBADD = \ $(top_builddir)/src/lib/ecore/libecore.la \ +$(top_builddir)/src/lib/ecore_job/libecore_job.la \ @x_ldflags@ \ @x_libs@ libecore_x_la_DEPENDENCIES = \ -$(top_builddir)/src/lib/ecore/libecore.la +$(top_builddir)/src/lib/ecore/libecore.la \ +$(top_builddir)/src/lib/ecore_job/libecore_job.la endif =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x.c,v retrieving revision 1.1.2.19 retrieving revision 1.1.2.20 diff -u -3 -r1.1.2.19 -r1.1.2.20 --- ecore_x.c 5 May 2003 09:03:51 -0000 1.1.2.19 +++ ecore_x.c 7 May 2003 02:20:05 -0000 1.1.2.20 @@ -524,6 +524,71 @@ ResizeRedirectMask); } +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) +{ + Ecore_X_Reply *reply; + Ecore_X_Reply_Window_Attributes *reply_data; + + 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; + + reply->job = ecore_job_add(_ecore_x_reply_call, reply); + { + XWindowAttributes att; + + XGetWindowAttributes(_ecore_x_disp, win, &att); + 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; + } + return reply; +} + /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x_private.h,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -3 -r1.1.2.8 -r1.1.2.9 --- ecore_x_private.h 8 Apr 2003 08:03:27 -0000 1.1.2.8 +++ ecore_x_private.h 7 May 2003 02:20:06 -0000 1.1.2.9 @@ -11,6 +11,24 @@ #include <X11/extensions/XShm.h> #include <X11/extensions/shape.h> + +/* FIXME: this is for simulation only */ +#include "Ecore_Job.h" + +typedef struct _Ecore_X_Reply Ecore_X_Reply; + +struct _Ecore_X_Reply +{ +/* FIXME: this is for simulation only */ + Ecore_Job *job; + + void *reply_data; + void (*reply_data_free) (void *reply_data); + + void (*func) (void *data, Ecore_X_Reply *reply, void *reply_data); + void *data; +}; + extern Display *_ecore_x_disp; extern double _ecore_x_double_click_time; extern Time _ecore_x_event_last_time; |