2003/09/10 05:15:01
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:06:11 +0000 (07:06 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:06:11 +0000 (07:06 +0000)
darcs-hash:20040130070611-2ba56-e2d2e3211eb8d18d35bf1e9afc14341ef92e6e4f.gz

src/org/xwt/plat/GCJ.cc
src/org/xwt/plat/Linux.cc
src/org/xwt/plat/Solaris.cc
src/org/xwt/plat/Win32.cc
src/org/xwt/plat/X11.cc

index fef47a5..f53fae2 100644 (file)
@@ -5,6 +5,10 @@
 #include <gcj/cni.h>
 #include <gcj/array.h>
 extern "C" {
+
+// hack for broken Solaris headers
+#define _WCHAR_T
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <setjmp.h>
index fcc28b7..12c927a 100644 (file)
@@ -1 +1,2 @@
+#include <stdint.h>
 #include "X11.cc"
index 2186086..167635d 100644 (file)
@@ -1,6 +1,6 @@
 #include <sys/int_types.h>
-#define u_int8_t uint8_t
-#define u_int16_t uint16_t
-#define u_int32_t uint32_t
-#define u_int64_t uint64_t
+
+// HACK
+typedef unsigned long long uint64_t;
+
 #include "X11.cc"
index 6ba10bf..208c2c3 100644 (file)
@@ -818,10 +818,10 @@ jint org::xwt::plat::Win32$Win32Surface::WndProc(jint _hwnd, jint _iMsg, jint _w
         addwidth = (window_rect.right - window_rect.left) - (client_rect.right - client_rect.left);
         addheight = (window_rect.bottom - window_rect.top) - (client_rect.bottom - client_rect.top);
         mmi = (MINMAXINFO*)lParam;
-        mmi->ptMinTrackSize.x = ((uint32_t)root->dmin(0)) + addwidth;
-        mmi->ptMinTrackSize.y = ((uint32_t)root->dmin(1)) + addheight;
-        mmi->ptMaxTrackSize.x = min(org::xwt::plat::Win32::getScreenWidth(), ((uint32_t)root->dmax(0)) + addwidth);
-        mmi->ptMaxTrackSize.y = min(org::xwt::plat::Win32::getScreenHeight(), ((uint32_t)root->dmax(1)) + addheight);
+        mmi->ptMinTrackSize.x = ((uint32_t)root->minwidth) + addwidth;
+        mmi->ptMinTrackSize.y = ((uint32_t)root->minheight) + addheight;
+        mmi->ptMaxTrackSize.x = min(org::xwt::plat::Win32::getScreenWidth(), ((uint32_t)root->maxwidth) + addwidth);
+        mmi->ptMaxTrackSize.y = min(org::xwt::plat::Win32::getScreenHeight(), ((uint32_t)root->maxheight) + addheight);
         return 0;
         
     case WM_PAINT: 
index 876c9a8..ccbac13 100644 (file)
@@ -133,7 +133,7 @@ void org::xwt::plat::X11$X11DoubleBuffer::slowDrawPicture(org::xwt::Picture* s,
                 int targetpixel;
                 switch (xi->bits_per_pixel) {
                 case 8: targetpixel = (int)(*current_pixel); break;
-                case 16: targetpixel = (int)(*((u_int16_t*)current_pixel)); break;
+                case 16: targetpixel = (int)(*((uint16_t*)current_pixel)); break;
                 case 24: targetpixel = (((int)*current_pixel) << 16) | (((int)*(current_pixel + 1)) << 8) | (((int)*(current_pixel + 2))); break;
                 case 32: targetpixel = *((int*)current_pixel); break;
                 default: org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: bpp not a multiple of 8!"));
@@ -156,21 +156,21 @@ void org::xwt::plat::X11$X11DoubleBuffer::slowDrawPicture(org::xwt::Picture* s,
             red = ((source_red * colormap_info->red_max * alpha) + (red * 0xFF * (0xFF - alpha))) / (0xFF * 0xFF);
             green = ((source_green * colormap_info->green_max * alpha) + (green * 0xFF * (0xFF - alpha))) / (0xFF * 0xFF);
             blue = ((source_blue * colormap_info->blue_max * alpha) + (blue * 0xFF * (0xFF - alpha))) / (0xFF * 0xFF);
-            u_int32_t destpixel = red * colormap_info->red_mult + green * colormap_info->green_mult +
+            uint32_t destpixel = red * colormap_info->red_mult + green * colormap_info->green_mult +
                 blue * colormap_info->blue_mult + colormap_info->base_pixel;
 
             switch (xi->bits_per_pixel) {
             case 8: *current_pixel = (char)(destpixel & 0xFF); break;
-            case 16: *((u_int16_t*)current_pixel) = (u_int16_t)destpixel; break;
+            case 16: *((uint16_t*)current_pixel) = (uint16_t)destpixel; break;
             case 24: {
                 int offset = (int)current_pixel & 0x3;
-                u_int64_t dest = ((u_int64_t)destpixel) << (8 * offset);
-                u_int64_t mask = ((u_int64_t)0xffffff) << (8 * offset);
-                u_int64_t* base = (u_int64_t*)(current_pixel - offset);
+                uint64_t dest = ((uint64_t)destpixel) << (8 * offset);
+                uint64_t mask = ((uint64_t)0xffffff) << (8 * offset);
+                uint64_t* base = (uint64_t*)(current_pixel - offset);
                 *base = (*base & ~mask) | dest;
                 break;
             }
-            case 32: *((u_int32_t*)current_pixel) = destpixel; break;
+            case 32: *((uint32_t*)current_pixel) = destpixel; break;
             default: org::xwt::Platform::criticalAbort(JvNewStringLatin1("ERROR: bpp not a multiple of 8!"));
             }
         }