Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: E.h events.c lang.c main.c Log Message: Debug tweaks. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v retrieving revision 1.373 retrieving revision 1.374 diff -u -3 -r1.373 -r1.374 --- E.h 22 Feb 2005 17:40:04 -0000 1.373 +++ E.h 22 Feb 2005 21:04:12 -0000 1.374 @@ -1016,7 +1016,6 @@ pid_t *children; char *machine_name; } wm; - int debug; int mode; char place; char flipp; @@ -1538,10 +1537,13 @@ #define EDBUG_TYPE_IPC 141 #define EDBUG_TYPE_EVENTS 142 #define EDBUG_TYPE_ICONBOX 143 +#define EDBUG_TYPE_VERBOSE 144 int EventDebug(unsigned int type); +void EventDebugSet(unsigned int type, int value); #else #define EventDebug(type) 0 +#define EventDebugSet(type, value) #endif void EventsInit(void); void CheckEvent(void); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -3 -r1.77 -r1.78 --- events.c 20 Feb 2005 19:02:52 -0000 1.77 +++ events.c 22 Feb 2005 21:04:20 -0000 1.78 @@ -71,8 +71,8 @@ EventsExtensionShowInfo(const char *name, int major, int minor, int event_base, int error_base) { - if (Mode.debug) - Eprintf("Found extension %-8s version %d.%d -" + if (EventDebug(EDBUG_TYPE_VERBOSE)) + Eprintf("Found extension %-10s version %d.%d -" " Event/error base = %d/%d\n", name, major, minor, event_base, error_base); } @@ -356,12 +356,14 @@ int i, j, n; int xa, ya, xb, yb; +#if ENABLE_DEBUG_EVENTS /* Debug - should be taken out */ if (EventDebug(EDBUG_TYPE_COMPRESSION)) for (i = 0; i < count; i++) if (evq[i].type) Eprintf("EventsCompress-1 %3d %s w=%#lx\n", i, EventName(evq[i].type), evq[i].xany.window); +#endif /* Loop through event list, starting with latest */ for (i = count - 1; i > 0; i--) @@ -389,10 +391,12 @@ ev2->type = 0; } } +#if ENABLE_DEBUG_EVENTS if (n && EventDebug(EDBUG_TYPE_COMPRESSION)) Eprintf("EventsCompress n=%4d %s %#lx x,y = %d,%d\n", n, EventName(ev->type), ev->xmotion.window, ev->xmotion.x, ev->xmotion.y); +#endif break; case Expose: @@ -426,10 +430,12 @@ ev->xexpose.y = ya; ev->xexpose.height = yb - ya; } +#if ENABLE_DEBUG_EVENTS if (EventDebug(EDBUG_TYPE_COMPRESSION)) Eprintf("EventsCompress n=%4d %s %#lx x=%4d-%4d y=%4d-%4d\n", n, EventName(ev->type), ev->xexpose.window, xa, xb, ya, yb); +#endif break; default: @@ -446,20 +452,24 @@ ev2->type = 0; } } +#if ENABLE_DEBUG_EVENTS if (n && EventDebug(EDBUG_TYPE_COMPRESSION)) Eprintf("EventsCompress n=%4d %s %#lx\n", n, EventName(ev->type), ev->xmotion.window); +#endif } break; } } +#if ENABLE_DEBUG_EVENTS /* Debug - should be taken out */ if (EventDebug(EDBUG_TYPE_COMPRESSION)) for (i = 0; i < count; i++) if (evq[i].type) Eprintf("EventsCompress-2 %3d %s w=%#lx\n", i, EventName(evq[i].type), evq[i].xany.window); +#endif } static int @@ -737,6 +747,16 @@ return ev_debug && (type < sizeof(ev_debug_flags)) && ev_debug_flags[type]; } +void +EventDebugSet(unsigned int type, int value) +{ + if (type >= sizeof(ev_debug_flags)) + return; + + ev_debug = 1; + ev_debug_flags[type] = value; +} + static const char *const TxtEventNames[] = { "Error", "Reply", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", @@ -936,7 +956,7 @@ #else void -EventDebugInit(const char *param) +EventDebugInit(const char *param __UNUSED__) { } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/lang.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- lang.c 24 May 2004 17:39:51 -0000 1.4 +++ lang.c 22 Feb 2005 21:04:23 -0000 1.5 @@ -154,9 +154,12 @@ else enc_int = enc_loc; - if (Mode.debug >= 1) - Eprintf("Locale: %s Character encoding: locale=%s internal=%s\n", - setlocale(LC_ALL, NULL), enc_loc, enc_int); + if (EventDebug(EDBUG_TYPE_VERBOSE)) + { + Eprintf("Locale: %s\n", setlocale(LC_ALL, NULL)); + Eprintf("Character encoding: locale=%s internal=%s\n", enc_loc, + enc_int); + } if (!strcasecmp(enc_loc, "utf8") || !strcasecmp(enc_loc, "utf-8")) Mode.text.utf8_loc = 1; =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -3 -r1.113 -r1.114 --- main.c 17 Feb 2005 21:17:21 -0000 1.113 +++ main.c 22 Feb 2005 21:04:24 -0000 1.114 @@ -73,13 +73,10 @@ Mode.wm.startup = 1; Mode.move.check = 1; - str = getenv("EDBUG"); - if (str) - Mode.debug = atoi(str); - str = getenv("EDBUG_FLAGS"); + str = getenv("EDEBUG"); if (str) EventDebugInit(str); - str = getenv("EDBUG_COREDUMP"); + str = getenv("EDEBUG_COREDUMP"); if (str) Mode.wm.coredump = 1; @@ -102,9 +99,6 @@ if (!Mode.wm.machine_name) Mode.wm.machine_name = Estrdup("localhost"); - /* Initialise internationalisation */ - LangInit(); - /* Now we're going to interpret any of the commandline parameters * that are passed to it -- Well, at least the ones that we * understand. @@ -185,13 +179,13 @@ (!strcmp("-version", argv[i])) || (!strcmp("--version", argv[i]))) { - printf(_("Enlightenment Version: %s\nLast updated on: %s\n"), + printf("Enlightenment %s - %s\n", ENLIGHTENMENT_VERSION, E_CHECKOUT_DATE); exit(0); } else if ((!strcmp("-v", argv[i])) || (!strcmp("-verbose", argv[i]))) { - Mode.debug++; + EventDebugSet(EDBUG_TYPE_VERBOSE, 1); } #if USE_COMPOSITE else if ((!strcmp("-C", argv[i]))) @@ -201,6 +195,9 @@ #endif } + /* Initialise internationalisation */ + LangInit(); + /* run most of the setup */ AlertInit(); /* Set up all the text bits that belong on the GSOD */ SignalsSetup(); ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs