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: hook it all in =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/Ecore_X.h,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -u -3 -r1.1.2.14 -r1.1.2.15 --- Ecore_X.h 5 Feb 2003 06:51:57 -0000 1.1.2.14 +++ Ecore_X.h 6 Feb 2003 06:19:40 -0000 1.1.2.15 @@ -386,7 +386,8 @@ extern int ECORE_LOCK_NUM; extern int ECORE_LOCK_CAPS; -int ecore_x_init(const char *name); +int ecore_x_init(const char *name); +int ecore_x_shutdown(void); Display *ecore_x_display_get(void); void ecore_x_double_click_time_set(double t); double ecore_x_double_click_time_get(void); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/Attic/ecore_x.c,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -u -3 -r1.1.2.11 -r1.1.2.12 --- ecore_x.c 5 Feb 2003 06:51:57 -0000 1.1.2.11 +++ ecore_x.c 6 Feb 2003 06:19:40 -0000 1.1.2.12 @@ -15,6 +15,8 @@ static int _ecore_x_event_handlers_num = 0; static void (**_ecore_x_event_handlers) (XEvent * event) = NULL; +static int _ecore_x_init_count = 0; + Display *_ecore_x_disp = NULL; double _ecore_x_double_click_time = 0.25; Time _ecore_x_event_last_time = 0; @@ -76,7 +78,7 @@ /** * Init the X display connection * @param name - * @return 1 on success, 0 on failure + * @return greater than 1 on success, 0 on failure * * Set up an X display connection and event handlers for event processing */ @@ -86,7 +88,11 @@ int shape_base = 0; int shape_err_base = 0; - if (_ecore_x_disp) return 1; + if (_ecore_x_init_count > 0) + { + _ecore_x_init_count++; + return _ecore_x_init_count; + } _ecore_x_disp = XOpenDisplay((char *)name); if (!_ecore_x_disp) return 0; _ecore_x_error_handler_init(); @@ -207,18 +213,22 @@ _ecore_x_atom_wm_protocols = XInternAtom(_ecore_x_disp, "WM_PROTOCOLS", False); _ecore_x_atom_wm_class = XInternAtom(_ecore_x_disp, "WM_CLASS", False); _ecore_x_atom_wm_name = XInternAtom(_ecore_x_disp, "WM_NAME", False); - return 1; + _ecore_x_init_count++; + return _ecore_x_init_count; } /** * Shut down the X syystem + * @return The number of times ecore X has left to be shut down * * This closes the X display connection and removes the handlers for it. */ -void +int ecore_x_shutdown(void) { - if (!_ecore_x_disp) return; + _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); free(_ecore_x_event_handlers); ecore_main_fd_handler_del(_ecore_x_fd_handler_handle); @@ -227,6 +237,7 @@ _ecore_x_filter_handler = NULL; _ecore_x_disp = NULL; _ecore_x_event_handlers = NULL; + return _ecore_x_init_count; } /** ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs