diff -Naur microwindows-0.91.old/src/config microwindows-0.91/src/config --- microwindows-0.91.old/src/config 2003-11-16 23:34:12.000000000 +0100 +++ microwindows-0.91/src/config 2006-11-16 10:04:37.000000000 +0100 @@ -38,8 +38,8 @@ # #################################################################### ARCH = LINUX-NATIVE -BIGENDIAN = N -NATIVETOOLSPREFIX = +BIGENDIAN = Y +NATIVETOOLSPREFIX = avr32-linux- ARMTOOLSPREFIX = arm-linux- MIPSTOOLSPREFIX = mipsel-linux- POWERPCTOOLSPREFIX = powerpc-linux- @@ -64,7 +64,7 @@ #################################################################### MICROWIN = Y NANOX = Y -SHAREDLIBS = Y +SHAREDLIBS = N OBJFRAMEWORK = N @@ -136,22 +136,22 @@ #################################################################### HAVE_JPEG_SUPPORT = Y INCJPEG = . -LIBJPEG = /usr/lib/libjpeg.so +LIBJPEG = /usr/avr32-linux/lib/libjpeg.so #################################################################### # PNG support via libpng and libz #################################################################### HAVE_PNG_SUPPORT = N INCPNG = . -LIBPNG = /usr/lib/libpng.a -LIBZ = /usr/lib/libz.a +LIBPNG = /usr/avr32-linux/lib/libpng.a +LIBZ = /usr/avr32-linux/lib/libz.a #################################################################### # TIFF support through libtiff #################################################################### HAVE_TIFF_SUPPORT = N INCTIFF = . -LIBTIFF = /usr/lib/libtiff.a +LIBTIFF = /usr/avr32-linux/lib/libtiff.a #################################################################### # native .fnt loadable font support @@ -170,18 +170,18 @@ #################################################################### # TrueType font support thru FreeType 1.x #################################################################### -HAVE_FREETYPE_SUPPORT = Y -INCFTLIB = /usr/include/freetype1 -LIBFTLIB = /usr/lib/libttf.so +HAVE_FREETYPE_SUPPORT = N +INCFTLIB = /usr/avr32-linux/include/freetype1 +LIBFTLIB = /usr/avr32-linux/lib/libttf.so FREETYPE_FONT_DIR = "fonts/truetype" #################################################################### # Support for many kinds of font thru FreeType 2.x # Must also set FREETYPE_FONT_DIR in the Freetype 1.x section #################################################################### -HAVE_FREETYPE_2_SUPPORT = N -INCFT2LIB = /usr/include -LIBFT2LIB = /usr/lib/libfreetype.a +HAVE_FREETYPE_2_SUPPORT = Y +INCFT2LIB = /usr/avr32-linux/include +LIBFT2LIB = /usr/avr32-linux/lib/libfreetype.a #################################################################### # PCF font support @@ -261,9 +261,9 @@ ifeq ($(X11), Y) # startup screen width, height, (depth for palette mode only) -SCREEN_WIDTH = 640 -SCREEN_HEIGHT = 480 -SCREEN_DEPTH = 4 +SCREEN_WIDTH = 320 +SCREEN_HEIGHT = 240 +SCREEN_DEPTH = 24 # You may want to turn this on for XFree86 4.x or if your backing store # isn't functioning properly @@ -276,7 +276,7 @@ # set FBREVERSE to reverse bit orders in 1,2,4 bpp # set FBVGA=N for all systems without VGA hardware (for MIPS must=N) FRAMEBUFFER = Y -FBVGA = Y +FBVGA = N VTSWITCH = Y FBREVERSE = N @@ -311,10 +311,10 @@ # YOPYMOUSE Yopy (/dev/yopy-ts) # HARRIERMOUSE NEC Harrier (/dev/tpanel) #################################################################### -GPMMOUSE = Y +GPMMOUSE = N SERMOUSE = N SUNMOUSE = N -NOMOUSE = N +NOMOUSE = Y IPAQMOUSE = N ZAURUSMOUSE = N TUXMOUSE = N @@ -330,11 +330,11 @@ # keyboard or null kbd driver TTYKBD = N -SCANKBD = Y +SCANKBD = N PIPEKBD = N IPAQKBD = N LIRCKBD = N -NOKBD = N +NOKBD = Y endif diff -Naur microwindows-0.91.old/src/demos/nanowm/wlist.c microwindows-0.91/src/demos/nanowm/wlist.c --- microwindows-0.91.old/src/demos/nanowm/wlist.c 2001-11-15 23:49:18.000000000 +0100 +++ microwindows-0.91/src/demos/nanowm/wlist.c 2006-11-16 10:05:25.000000000 +0100 @@ -13,7 +13,7 @@ #include "nanowm.h" -static win *windows = NULL; +win *windows = NULL; /* * Find the windowlist entry for the specified window ID and return a pointer diff -Naur microwindows-0.91.old/src/engine/font_freetype2.c microwindows-0.91/src/engine/font_freetype2.c --- microwindows-0.91.old/src/engine/font_freetype2.c 2003-05-14 16:16:06.000000000 +0200 +++ microwindows-0.91/src/engine/font_freetype2.c 2006-11-16 10:04:37.000000000 +0100 @@ -60,10 +60,12 @@ * proportional to the number of MWFREETYPE2FONT objects). * * FIXME: This option should be in the config file. + * + * NOTE: See #if after include of freetype headers - we may + * change this back to '0' there. */ #define HAVE_FREETYPE_2_CACHE 1 - /* * Enable the Freetype 2 character map cache. Only applicable if * FreeType 2 itself is enabled, and HAVE_FREETYPE_2_CACHE is also @@ -142,6 +144,37 @@ #define FREETYPE_FONT_DIR "/usr/local/microwin/fonts" #endif + +/* + * Starting with Freetype version 2.1.8, the FTC_ImageTypeRec + * element "FTC_FontRec font" was removed, and replaced with + * "FTC_FaceID face_id". + * Code here assumes the "FTC_FontRec font" element exists. + * So, if we're running 2.1.8 or higher, re-define + * HAVE_FREETYPE_2_CACHE to "0". + * Perhaps some version-specific code can be added to this + * module in the future that supports the newer versions of + * Freetype. + */ +#if HAVE_FREETYPE_VERSION_AFTER_OR_EQUAL(2,1,8) +#undef HAVE_FREETYPE_2_CACHE +#define HAVE_FREETYPE_2_CACHE 0 +#endif + +/* + * Define OPTIMIZE_FONT_ANGLE_ZERO to '1' if code can skip calculating/using + * transformation matrix when there isn't any rotation angle (should be + * faster). This code doesn't seem to work starting with Freetype 2 + * version 2.1.5 so only define it to '1' for earlier versions (until + * code here is updated to work with the newer versions). + */ +#if HAVE_FREETYPE_VERSION_AFTER_OR_EQUAL(2,1,5) +#define OPTIMIZE_FONT_ANGLE_ZERO 0 +#else +#define OPTIMIZE_FONT_ANGLE_ZERO 1 +#endif + + /** * The Freetype 2 font directory. */ @@ -230,7 +263,8 @@ static PMWFREETYPE2FONT freetype2_createfont_internal(freetype2_fontdata * faceid, - char *filename, MWCOORD height); + char *filename, MWCOORD height, const unsigned char *buffer, + unsigned buf_length); /** @@ -344,7 +378,11 @@ return FT_New_Face(library, filename, 0, aface); } } -#endif +#else /* !HAVE_FREETYPE_2_CACHE */ +/* This case wasn't being defined, so I added it. Is it the correct call? */ +#define LOOKUP_CHAR(pf_,face_,ch_) \ + (FT_Get_Char_Index((face_), (ch_))) +#endif /* HAVE_FREETYPE_2_CACHE */ /** @@ -505,7 +543,7 @@ faceid = NULL; #endif - pf = freetype2_createfont_internal(faceid, fontname, height); + pf = freetype2_createfont_internal(faceid, fontname, height, 0, 0); if (!pf) { #if HAVE_FREETYPE_2_CACHE if (first_time) { @@ -572,7 +610,7 @@ (char)buffercopy[2], (char)buffercopy[3], length); */ - pf = freetype2_createfont_internal(faceid, NULL, height); + pf = freetype2_createfont_internal(faceid, NULL, height, buffer, length); if (!pf) { free(faceid); } @@ -596,7 +634,9 @@ */ static PMWFREETYPE2FONT freetype2_createfont_internal(freetype2_fontdata * faceid, - char *filename, MWCOORD height) + char *filename, MWCOORD height, + const unsigned char *buffer, + unsigned buf_length) { PMWFREETYPE2FONT pf; #if HAVE_FREETYPE_2_CACHE @@ -640,7 +680,7 @@ /*DPRINTF("Nano-X-Freetype2: Loading font from file \"%s\"\n", filename); */ } else { error = FT_New_Memory_Face(freetype2_library, - buffer, length, 0, &pf->face); + buffer, buf_length, 0, &pf->face); if (error != FT_Err_Ok) { EPRINTF("Nano-X-Freetype2: Can't load font from memory - %lx\n", (unsigned long) error); @@ -761,7 +801,7 @@ strcpy(filename, pf->filename); #endif pnewf = freetype2_createfont_internal(pf->faceid, filename, - height); + height, 0, 0); if (!pnewf) { free(filename); return NULL; @@ -770,7 +810,7 @@ pf->faceid->refcount++; pnewf = freetype2_createfont_internal(pf->faceid, NULL, - height); + height, 0, 0); if (!pnewf) { pf->faceid->refcount--; return NULL; @@ -820,7 +860,6 @@ #endif } - /** * Set the rotation of a font. Caller must update pfont->fontrotation. * @@ -852,12 +891,14 @@ pf->matrix.xy = (FT_Fixed) 0; } else { FT_Angle angle = (tenthdegrees << 16) / 10; + FT_Vector sincosvec; FT_Vector_Unit(&sincosvec, angle); - pf->matrix.yy = sincosvec.y; - pf->matrix.xx = sincosvec.y; - pf->matrix.yx = sincosvec.x; - pf->matrix.xy = -sincosvec.x; + + pf->matrix.yy = sincosvec.x; + pf->matrix.xx = sincosvec.x; + pf->matrix.yx = sincosvec.y; + pf->matrix.xy = -sincosvec.y; } } @@ -1189,7 +1230,7 @@ } #if 1 - if ((pf->fontrotation != 0) + if (!OPTIMIZE_FONT_ANGLE_ZERO || (pf->fontrotation != 0) #if HAVE_FREETYPE_2_CACHE || (!CAN_USE_FT2_CACHE(pf)) /* Cache does not support bitmaps >256x256 */ #endif @@ -1238,7 +1279,7 @@ pos.x += (glyph->advance.x >> 10) & (~63); - if (pf->fontrotation) { + if (!OPTIMIZE_FONT_ANGLE_ZERO || pf->fontrotation) { // rotate the glyph image now.. FT_Glyph_Transform(glyph, &pf->matrix, 0); } @@ -1280,7 +1321,7 @@ FT_Bitmap *bitmap; #endif - ay += (pos.y >> 6); + ay -= (pos.y >> 6); for (i = 0; i < cc; i++) { curchar = LOOKUP_CHAR(pf, face, str[i]); @@ -1336,7 +1377,6 @@ */ ax += (face->glyph->advance.x >> 6); #endif - if ((blit_instructions.dstw > 0) && (blit_instructions.dsth > 0)) { GdDrawAreaInternal(psd, &blit_instructions, blit_op); @@ -1446,7 +1486,7 @@ pos.x += (glyph->advance.x >> 10) & (~63); - if (pf->fontrotation) { + if (!OPTIMIZE_FONT_ANGLE_ZERO || pf->fontrotation) { // rotate the glyph image now.. FT_Glyph_Transform(glyph, &pf->matrix, 0); } @@ -1609,7 +1649,7 @@ assert(pheight); assert(pbase); - if ((pf->fontrotation != 0) + if (!OPTIMIZE_FONT_ANGLE_ZERO || (pf->fontrotation != 0) #if HAVE_FREETYPE_2_CACHE || (!CAN_USE_FT2_CACHE(pf)) #endif diff -Naur microwindows-0.91.old/src/mwin/winevent.c microwindows-0.91/src/mwin/winevent.c --- microwindows-0.91.old/src/mwin/winevent.c 2002-08-21 18:36:20.000000000 +0200 +++ microwindows-0.91/src/mwin/winevent.c 2006-11-16 10:04:37.000000000 +0100 @@ -14,7 +14,7 @@ #include #if !(DOS_TURBOC | DOS_QUICKC | _MINIX | VXWORKS) -static int +int abs(int n) { return n >= 0? n: -n;