add --debug-handlers so --debug-events isnt so noisy.

This commit is contained in:
Campbell Barton 2012-10-27 15:05:12 +00:00
parent 7413adce04
commit c9e5b1e6ee
4 changed files with 13 additions and 10 deletions

@ -130,8 +130,9 @@ enum {
G_DEBUG_FFMPEG = (1 << 1), G_DEBUG_FFMPEG = (1 << 1),
G_DEBUG_PYTHON = (1 << 2), /* extra python info */ G_DEBUG_PYTHON = (1 << 2), /* extra python info */
G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */ G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
G_DEBUG_WM = (1 << 4), /* operator, undo */ G_DEBUG_HANDLERS = (1 << 4), /* events handling */
G_DEBUG_JOBS = (1 << 5) /* jobs time profiling */ G_DEBUG_WM = (1 << 5), /* operator, undo */
G_DEBUG_JOBS = (1 << 6) /* jobs time profiling */
}; };
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS) #define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS)
@ -145,17 +146,17 @@ enum {
#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */ #define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */
#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */ #define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */
#define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */ #define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */
/* #define G_FILE_SHOW_PROFILE (1 << 6) */ /* deprecated */ /* #define G_FILE_SHOW_PROFILE (1 << 6) */ /* deprecated */
#define G_FILE_LOCK (1 << 7) #define G_FILE_LOCK (1 << 7)
#define G_FILE_SIGN (1 << 8) #define G_FILE_SIGN (1 << 8)
/* #define G_FILE_PUBLISH (1 << 9) */ /* deprecated */ /* #define G_FILE_PUBLISH (1 << 9) */ /* deprecated */
#define G_FILE_NO_UI (1 << 10) #define G_FILE_NO_UI (1 << 10)
/* #define G_FILE_GAME_TO_IPO (1 << 11) */ /* deprecated */ /* #define G_FILE_GAME_TO_IPO (1 << 11) */ /* deprecated */
#define G_FILE_GAME_MAT (1 << 12) /* deprecated */ #define G_FILE_GAME_MAT (1 << 12) /* deprecated */
/* #define G_FILE_DISPLAY_LISTS (1 << 13) */ /* deprecated */ /* #define G_FILE_DISPLAY_LISTS (1 << 13) */ /* deprecated */
#define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */ #define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */
#define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */ #define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */
/* #define G_FILE_GLSL_NO_LIGHTS (1 << 16) */ /* deprecated */ /* #define G_FILE_GLSL_NO_LIGHTS (1 << 16) */ /* deprecated */
#define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */ #define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */
#define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */ #define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */
#define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */ #define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */

@ -242,6 +242,7 @@ static PyGetSetDef bpy_app_getsets[] = {
{(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG}, {(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG},
{(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON}, {(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON},
{(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS}, {(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS},
{(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS},
{(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM}, {(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
{(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL}, {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL},

@ -853,7 +853,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
WM_operator_last_properties_init(op); WM_operator_last_properties_init(op);
} }
if ((G.debug & G_DEBUG_EVENTS) && event && event->type != MOUSEMOVE) { if ((G.debug & G_DEBUG_HANDLERS) && event && event->type != MOUSEMOVE) {
printf("%s: handle evt %d win %d op %s\n", printf("%s: handle evt %d win %d op %s\n",
__func__, event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname); __func__, event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname);
} }
@ -1680,7 +1680,7 @@ static int wm_action_not_handled(int action)
static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers) static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers)
{ {
#ifndef NDEBUG #ifndef NDEBUG
const int do_debug_handler = (G.debug & G_DEBUG_EVENTS) const int do_debug_handler = (G.debug & G_DEBUG_HANDLERS)
/* comment this out to flood the console! (if you really want to test) */ /* comment this out to flood the console! (if you really want to test) */
&& !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
; ;
@ -2067,7 +2067,7 @@ void wm_event_do_handlers(bContext *C)
while ( (event = win->queue.first) ) { while ( (event = win->queue.first) ) {
int action = WM_HANDLER_CONTINUE; int action = WM_HANDLER_CONTINUE;
if ((G.debug & G_DEBUG_EVENTS) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) { if ((G.debug & G_DEBUG_HANDLERS) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
printf("%s: pass on evt %d val %d\n", __func__, event->type, event->val); printf("%s: pass on evt %d val %d\n", __func__, event->type, event->val);
} }

@ -1128,6 +1128,7 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
#endif #endif
BLI_argsAdd(ba, 1, NULL, "--debug-python", "\n\tEnable debug messages for python", debug_mode_generic, (void *)G_DEBUG_PYTHON); BLI_argsAdd(ba, 1, NULL, "--debug-python", "\n\tEnable debug messages for python", debug_mode_generic, (void *)G_DEBUG_PYTHON);
BLI_argsAdd(ba, 1, NULL, "--debug-events", "\n\tEnable debug messages for the event system", debug_mode_generic, (void *)G_DEBUG_EVENTS); BLI_argsAdd(ba, 1, NULL, "--debug-events", "\n\tEnable debug messages for the event system", debug_mode_generic, (void *)G_DEBUG_EVENTS);
BLI_argsAdd(ba, 1, NULL, "--debug-handlers", "\n\tEnable debug messages for event handling", debug_mode_generic, (void *)G_DEBUG_HANDLERS);
BLI_argsAdd(ba, 1, NULL, "--debug-wm", "\n\tEnable debug messages for the window manager", debug_mode_generic, (void *)G_DEBUG_WM); BLI_argsAdd(ba, 1, NULL, "--debug-wm", "\n\tEnable debug messages for the window manager", debug_mode_generic, (void *)G_DEBUG_WM);
BLI_argsAdd(ba, 1, NULL, "--debug-all", "\n\tEnable all debug messages (excludes libmv)", debug_mode_generic, (void *)G_DEBUG_ALL); BLI_argsAdd(ba, 1, NULL, "--debug-all", "\n\tEnable all debug messages (excludes libmv)", debug_mode_generic, (void *)G_DEBUG_ALL);