Enlightenment CVS committal

Author  : kwo
Project : e17
Module  : libs/ecore

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


Modified Files:
        Ecore_X.h ecore_x.c 


Log Message:
Introduce ecore_x_disconnect().
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- Ecore_X.h   2 Sep 2004 18:45:31 -0000       1.56
+++ Ecore_X.h   7 Sep 2004 19:47:46 -0000       1.57
@@ -718,6 +718,7 @@
 
 int              ecore_x_init(const char *name);
 int              ecore_x_shutdown(void);       
+int              ecore_x_disconnect(void);       
 Ecore_X_Display *ecore_x_display_get(void);
 int              ecore_x_fd_get(void);
 void             ecore_x_double_click_time_set(double t);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- ecore_x.c   25 Aug 2004 23:41:57 -0000      1.37
+++ ecore_x.c   7 Sep 2004 19:47:46 -0000       1.38
@@ -483,23 +483,16 @@
    return _ecore_x_init_count;
 }
 
-/**
- * Shuts down the Ecore X library.
- *
- * In shutting down the library, the X display connection is terminated
- * and any event handlers for it are removed.
- *
- * @return  The number of times the library has been initialized without
- *          being shut down.
- * @ingroup Ecore_X_Init_Group
- */
-int
-ecore_x_shutdown(void)
+static int
+_ecore_x_shutdown(int close_display)
 {
    _ecore_x_init_count--;
    if (_ecore_x_init_count > 0) return _ecore_x_init_count;
    if (!_ecore_x_disp) return _ecore_x_init_count;
-   XCloseDisplay(_ecore_x_disp);
+   if (close_display)
+      XCloseDisplay(_ecore_x_disp);
+   else
+      close(ConnectionNumber(_ecore_x_disp));
    free(_ecore_x_event_handlers);
    ecore_main_fd_handler_del(_ecore_x_fd_handler_handle);
    ecore_event_filter_del(_ecore_x_filter_handler);
@@ -513,6 +506,35 @@
 }
 
 /**
+ * Shuts down the Ecore X library.
+ *
+ * In shutting down the library, the X display connection is terminated
+ * and any event handlers for it are removed.
+ *
+ * @return  The number of times the library has been initialized without
+ *          being shut down.
+ * @ingroup Ecore_X_Init_Group
+ */
+int
+ecore_x_shutdown(void)
+{
+   return _ecore_x_shutdown(1);
+}
+
+/**
+ * Shuts down the Ecore X library.
+ *
+ * As ecore_x_shutdown, except do not close Display, only connection.
+ *
+ * @ingroup Ecore_X_Init_Group
+ */
+int
+ecore_x_disconnect(void)
+{
+   return _ecore_x_shutdown(0);
+}
+
+/**
  * @defgroup Ecore_X_Display_Attr_Group Ecore X Display Attributes
  *
  * Functions that set and retrieve X display attributes.




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to