Ejemplo n.º 1
0
void CALLBACK WebKitVBufBackend_t::renderThread_winEventProcHook(HWINEVENTHOOK hookID, DWORD eventID, HWND hwnd, long objectID, long childID, DWORD threadID, DWORD time) {
    switch (eventID) {
    case EVENT_OBJECT_VALUECHANGE:
    case EVENT_OBJECT_STATECHANGE:
        break;
    default:
        return;
    }

    WebKitVBufBackend_t* backend = NULL;
    for (VBufBackendSet_t::iterator it = runningBackends.begin(); it != runningBackends.end(); ++it) {
        HWND rootWindow = (HWND)(*it)->rootDocHandle;
        if (hwnd == rootWindow || IsChild(rootWindow, hwnd)) {
            backend = static_cast<WebKitVBufBackend_t*>(*it);
            break;
        }
    }
    if (!backend)
        return;

    IAccessible* acc = IAccessibleFromIdentifier((int)hwnd, childID);
    if (!acc)
        return;
    acc->Release();
    map<IAccessible*, WebKitVBufStorage_controlFieldNode_t*>::const_iterator it;
    if ((it = backend->accessiblesToNodes.find(acc)) == backend->accessiblesToNodes.end())
        return;
    backend->invalidateSubtree(it->second);
}
Ejemplo n.º 2
0
void CALLBACK WebKitVBufBackend_t::renderThread_winEventProcHook(HWINEVENTHOOK hookID, DWORD eventID, HWND hwnd, long objectID, long childID, DWORD threadID, DWORD time) {
	switch (eventID) {
		case EVENT_OBJECT_VALUECHANGE:
		case EVENT_OBJECT_STATECHANGE:
		case EVENT_OBJECT_REORDER:
			break;
		default:
			return;
	}

	WebKitVBufBackend_t* backend = NULL;
	for (VBufBackendSet_t::iterator it = runningBackends.begin(); it != runningBackends.end(); ++it) {
		HWND rootWindow = (HWND)UlongToHandle((*it)->rootDocHandle);
		if (hwnd == rootWindow || IsChild(rootWindow, hwnd)) {
			backend = static_cast<WebKitVBufBackend_t*>(*it);
			break;
		}
	}
	if (!backend)
		return;
	int docHandle = HandleToUlong(hwnd);
	// WebKit returns positive values for uniqueID, but fires events with negative ids.
	// Therefore, flip the sign on childID.
	VBufStorage_controlFieldNode_t* node = backend->getControlFieldNodeWithIdentifier(docHandle, -childID);
	if (!node)
		return;
	backend->invalidateSubtree(node);
}