< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Component.cpp

Print this page

        

*** 961,970 **** --- 961,976 ---- RECT rc; ::GetWindowRect(GetHWnd(), &rc); ::MapWindowPoints(HWND_DESKTOP, ::GetParent(GetHWnd()), (LPPOINT)&rc, 2); DTRACE_PRINTLN4("AwtComponent::Reshape from %d, %d, %d, %d", rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top); #endif + + x = ScaleUpX(x); + y = ScaleUpY(y); + w = ScaleUpX(w); + h = ScaleUpY(h); + AwtWindow* container = GetContainer(); AwtComponent* parent = GetParent(); if (container != NULL && container == parent) { container->SubtractInsetPoint(x, y); }
*** 2210,2221 **** } } } for(i = 0; i < 2; i++) { if (un[i] != 0) { ! DoCallback("handleExpose", "(IIII)V", un[i]->left, un[i]->top, ! un[i]->right-un[i]->left, un[i]->bottom-un[i]->top); } } delete [] buffer; } ::DeleteObject((HGDIOBJ)rgn); --- 2216,2230 ---- } } } for(i = 0; i < 2; i++) { if (un[i] != 0) { ! DoCallback("handleExpose", "(IIII)V", ! ScaleDownX(un[i]->left), ! ScaleDownY(un[i]->top), ! ScaleDownX(un[i]->right - un[i]->left), ! ScaleDownY(un[i]->bottom - un[i]->top)); } } delete [] buffer; } ::DeleteObject((HGDIOBJ)rgn);
*** 4606,4615 **** --- 4615,4652 ---- ((BYTE*)(dest++))[3] = alpha; } } } + int AwtComponent::ScaleUpX(int x) { + int screen = AwtWin32GraphicsDevice::DeviceIndexForWindow(GetHWnd()); + Devices::InstanceAccess devices; + AwtWin32GraphicsDevice* device = devices->GetDevice(screen); + return device == NULL ? x : device->ScaleUpX(x); + } + + int AwtComponent::ScaleUpY(int y) { + int screen = AwtWin32GraphicsDevice::DeviceIndexForWindow(GetHWnd()); + Devices::InstanceAccess devices; + AwtWin32GraphicsDevice* device = devices->GetDevice(screen); + return device == NULL ? y : device->ScaleUpY(y); + } + + int AwtComponent::ScaleDownX(int x) { + int screen = AwtWin32GraphicsDevice::DeviceIndexForWindow(GetHWnd()); + Devices::InstanceAccess devices; + AwtWin32GraphicsDevice* device = devices->GetDevice(screen); + return device == NULL ? x : device->ScaleDownX(x); + } + + int AwtComponent::ScaleDownY(int y) { + int screen = AwtWin32GraphicsDevice::DeviceIndexForWindow(GetHWnd()); + Devices::InstanceAccess devices; + AwtWin32GraphicsDevice* device = devices->GetDevice(screen); + return device == NULL ? y : device->ScaleDownY(y); + } + jintArray AwtComponent::CreatePrintedPixels(SIZE &loc, SIZE &size, int alpha) { JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); if (!::IsWindowVisible(GetHWnd())) { return NULL;
*** 4899,4910 **** int xAbs = GET_X_LPARAM(curMousePos); int yAbs = GET_Y_LPARAM(curMousePos); jobject mouseEvent = env->NewObject(mouseEventCls, mouseEventConst, target, id, when, modifiers, ! x+insets.left, y+insets.top, ! xAbs, yAbs, clickCount, popupTrigger, button); if (safe_ExceptionOccurred(env)) { env->ExceptionDescribe(); env->ExceptionClear(); --- 4936,4948 ---- int xAbs = GET_X_LPARAM(curMousePos); int yAbs = GET_Y_LPARAM(curMousePos); jobject mouseEvent = env->NewObject(mouseEventCls, mouseEventConst, target, id, when, modifiers, ! ScaleDownX(x + insets.left), ! ScaleDownY(y + insets.top), ! ScaleDownX(xAbs), ScaleDownY(yAbs), clickCount, popupTrigger, button); if (safe_ExceptionOccurred(env)) { env->ExceptionDescribe(); env->ExceptionClear();
*** 4967,4978 **** jobject mouseWheelEvent = env->NewObject(mouseWheelEventCls, mouseWheelEventConst, target, id, when, modifiers, ! x+insets.left, y+insets.top, ! xAbs, yAbs, clickCount, popupTrigger, scrollType, scrollAmount, roundedWheelRotation, preciseWheelRotation); DASSERT(mouseWheelEvent != NULL); --- 5005,5018 ---- jobject mouseWheelEvent = env->NewObject(mouseWheelEventCls, mouseWheelEventConst, target, id, when, modifiers, ! ScaleDownX(x + insets.left), ! ScaleDownY(y + insets.top), ! ScaleDownX(xAbs), ! ScaleDownY(yAbs), clickCount, popupTrigger, scrollType, scrollAmount, roundedWheelRotation, preciseWheelRotation); DASSERT(mouseWheelEvent != NULL);
*** 5474,5484 **** if (::IsWindow(p->GetHWnd())) { RECT rect; VERIFY(::GetWindowRect(p->GetHWnd(),&rect)); result = JNU_NewObjectByName(env, "java/awt/Point", "(II)V", ! rect.left, rect.top); } ret: env->DeleteGlobalRef(self); if (result != NULL) --- 5514,5525 ---- if (::IsWindow(p->GetHWnd())) { RECT rect; VERIFY(::GetWindowRect(p->GetHWnd(),&rect)); result = JNU_NewObjectByName(env, "java/awt/Point", "(II)V", ! p->ScaleDownX(rect.left), ! p->ScaleDownY(rect.top)); } ret: env->DeleteGlobalRef(self); if (result != NULL)
*** 7062,7071 **** --- 7103,7117 ---- } env->DeleteLocalRef(target); target = parent; } + x = ScaleUpX(x); + y = ScaleUpY(y); + width = ScaleUpX(width); + height = ScaleUpY(height); + // Test whether component's bounds match the native window's RECT rect; VERIFY(::GetWindowRect(GetHWnd(), &rect)); #if 0 DASSERT( (x == rect.left) &&
*** 7255,7260 **** } removedDCs = removedDCs->next; delete tmpDCList; } } - --- 7301,7305 ----
< prev index next >