| 68 | |
| 69 | |
| 70 | BOOL Python_check_message(const MSG *msg) // TRUE if fully processed. |
| 71 | { |
| 72 | BOOL ret; |
| 73 | ui_assoc_object *pObj = NULL; |
| 74 | PyObject *method; |
| 75 | CWnd *pWnd = bInFatalShutdown ? NULL : CWnd::FromHandlePermanent(msg->hwnd); |
| 76 | // is_uiobjects calls python methods, must already hold lock |
| 77 | CEnterLeavePython _celp; |
| 78 | if (pWnd && |
| 79 | (pObj=ui_assoc_object::GetAssocObject(pWnd)) && |
| 80 | pObj->is_uiobject( &PyCWnd::type ) && |
| 81 | ((PyCWnd *)pObj)->pMessageHookList && |
| 82 | ((PyCWnd *)pObj)->pMessageHookList->Lookup(msg->message,(void *&)method)) { |
| 83 | |
| 84 | #ifdef TRACE_CALLBACKS |
| 85 | TRACE("Message callback: message %04X, object %s (hwnd %p) (%p)\n",msg->message, (const char *)GetReprText(pObj), pWnd, pWnd->GetSafeHwnd()); |
| 86 | #endif |
| 87 | // Our Python convention is TRUE means "pass it on" |
| 88 | // CEnterLeavePython _celp; |
| 89 | ret = Python_callback(method, msg)==0; |
| 90 | } else |
| 91 | ret = FALSE; // dont want it. |
| 92 | Py_XDECREF(pObj); |
| 93 | return ret; |
| 94 | } |
| 95 | |
| 96 | BOOL Python_check_key_message(const MSG *msg) |
| 97 | { |
no test coverage detected