Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_obj_dialog.c e_obj_dialog.h e_sys.c Log Message: metrics sys patch =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_obj_dialog.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_obj_dialog.c 21 Sep 2006 20:07:02 -0000 1.2 +++ e_obj_dialog.c 28 Oct 2006 01:30:31 -0000 1.3 @@ -45,11 +45,18 @@ od->bg_object = o; e_win_centered_set(od->win, 1); + od->cb_delete = NULL; return od; } EAPI void +e_obj_dialog_cb_delete_set(E_Obj_Dialog *od, void (*func)(E_Obj_Dialog *od)) +{ + od->cb_delete = func; +} + +EAPI void e_obj_dialog_icon_set(E_Obj_Dialog *od, char *icon) { E_OBJECT_CHECK(od); @@ -116,6 +123,8 @@ E_Obj_Dialog *od; od = win->data; + if (od->cb_delete) + od->cb_delete(od); e_object_del(E_OBJECT(od)); } @@ -125,5 +134,7 @@ E_Obj_Dialog *od; od = data; + if (od->cb_delete) + od->cb_delete(od); e_object_del(E_OBJECT(od)); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_obj_dialog.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_obj_dialog.h 10 Sep 2006 04:51:07 -0000 1.1 +++ e_obj_dialog.h 28 Oct 2006 01:30:31 -0000 1.2 @@ -18,6 +18,7 @@ E_Win *win; Evas_Object *bg_object; void *data; + void (*cb_delete)(E_Obj_Dialog *od); }; EAPI E_Obj_Dialog *e_obj_dialog_new(E_Container *con, char *title, char *class_name, char *class_class); @@ -25,6 +26,7 @@ EAPI void e_obj_dialog_show(E_Obj_Dialog *od); EAPI void e_obj_dialog_obj_part_text_set(E_Obj_Dialog *od, char *part, char *text); EAPI void e_obj_dialog_obj_theme_set(E_Obj_Dialog *od, char *theme_cat, char *theme_obj); +EAPI void e_obj_dialog_cb_delete_set(E_Obj_Dialog *od, void (*func)(E_Obj_Dialog *od)); #endif #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_sys.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_sys.c 21 Oct 2006 11:19:40 -0000 1.6 +++ e_sys.c 28 Oct 2006 01:30:31 -0000 1.7 @@ -15,6 +15,7 @@ static void _e_sys_current_action(void); static void _e_sys_action_failed(void); static int _e_sys_action_do(E_Sys_Action a, char *param); +static void _e_sys_dialog_cb_delete(E_Obj_Dialog * od); static Ecore_Event_Handler *_e_sys_exe_exit_handler = NULL; static Ecore_Exe *_e_sys_halt_check_exe = NULL; @@ -482,6 +483,7 @@ e_obj_dialog_show(od); e_obj_dialog_icon_set(od, "enlightenment/halt"); if (_e_sys_dialog) e_object_del(E_OBJECT(_e_sys_dialog)); + e_obj_dialog_cb_delete_set(od, _e_sys_dialog_cb_delete); _e_sys_dialog = od; /* FIXME: display halt status */ } @@ -508,6 +510,7 @@ e_obj_dialog_show(od); e_obj_dialog_icon_set(od, "enlightenment/reboot"); if (_e_sys_dialog) e_object_del(E_OBJECT(_e_sys_dialog)); + e_obj_dialog_cb_delete_set(od, _e_sys_dialog_cb_delete); _e_sys_dialog = od; /* FIXME: display reboot status */ } @@ -533,6 +536,7 @@ e_obj_dialog_show(od); e_obj_dialog_icon_set(od, "enlightenment/suspend"); if (_e_sys_dialog) e_object_del(E_OBJECT(_e_sys_dialog)); + e_obj_dialog_cb_delete_set(od, _e_sys_dialog_cb_delete); _e_sys_dialog = od; /* FIXME: display suspend status */ } @@ -559,6 +563,7 @@ e_obj_dialog_icon_set(od, "enlightenment/hibernate"); if (_e_sys_dialog) e_object_del(E_OBJECT(_e_sys_dialog)); _e_sys_dialog = od; + e_obj_dialog_cb_delete_set(od, _e_sys_dialog_cb_delete); /* FIXME: display hibernate status */ } break; @@ -566,4 +571,12 @@ return 0; } return 1; +} + +static void _e_sys_dialog_cb_delete(E_Obj_Dialog * od) +{ + /* If we don't NULL out the _e_sys_dialog, then the + * ECORE_EXE_EVENT_DEL callback will trigger and segv if the window + * is deleted in some other way. */ + _e_sys_dialog = NULL; } ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs