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


Log Message:


some minimal meat to start with.. but nothing permenant or final...

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/Ecore_X.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -3 -r1.1.2.1 -r1.1.2.2
--- Ecore_X.h   16 Jan 2003 11:26:42 -0000      1.1.2.1
+++ Ecore_X.h   16 Jan 2003 11:39:41 -0000      1.1.2.2
@@ -18,6 +18,7 @@
    
 #endif
 
+int ecore_x_init(const char *name);       
    
 #ifdef __cplusplus
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -3 -r1.1.2.1 -r1.1.2.2
--- ecore_x.c   16 Jan 2003 11:26:42 -0000      1.1.2.1
+++ ecore_x.c   16 Jan 2003 11:39:41 -0000      1.1.2.2
@@ -1,3 +1,55 @@
 #include "Ecore.h"
 #include "ecore_x_private.h"
 #include "Ecore_X.h"
+
+static int _ecore_x_fd_handler(Ecore_Fd_Handler *fd_handler, void *data);
+static int _ecore_x_fd_handler_buf(Ecore_Fd_Handler *fd_handler, void *data);
+
+static Display *disp = NULL;
+
+/**
+ * Init the X display connection
+ * @param name
+ * @return 1 on success, 0 on failure
+ * 
+ * Set up an X display connection and event handlers for event processing
+ */
+int
+ecore_x_init(const char *name)
+{
+   if (disp) return 1;
+   disp = XOpenDisplay((char *)name);
+   if (!disp) return 0;
+   /* FIXME: more to go here... */
+   ecore_main_fd_handler_add(ConnectionNumber(disp),
+                            ECORE_FD_READ,
+                            _ecore_x_fd_handler, disp,
+                            _ecore_x_fd_handler_buf, disp);
+   return 1;
+}
+
+static int
+_ecore_x_fd_handler(Ecore_Fd_Handler *fd_handler, void *data)
+{
+   Display *d;
+   
+   d = data;
+   while (XPending(d))
+     {
+       XEvent ev;
+       
+       XNextEvent(d, &ev);
+       /* FIXME: here we should be putting an event on the event list */
+     }
+   return 1;
+}
+
+static int
+_ecore_x_fd_handler_buf(Ecore_Fd_Handler *fd_handler, void *data)
+{
+   Display *d;
+
+   d = data;
+   if (XPending(d)) return 1;
+   return 0;
+}




-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to