[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    patch: gdi.467
From:       lawson_whitney () juno ! com
Date:       1999-11-29 2:19:32
[Download RAW message or body]

G'day!

This implements gdi.467 well enough that my silly winelib test program
can't tell the difference between builtin and native WFW 3.11 except for
this line with native:

Warning: Modules 'gdi' and 'gdi32' have different loadorder which may
cause trouble

If no one has objections, comments, or [decent] suggestions in the next
few days, I will submit it and chip away at another stub :-)

This patch is to Wine-991114.  Sorry, if no one will do a cvsmail
server, I won't do CVS.  gzipped and uuencoded follows the plaintext, in
case I am not the only one who would rather get patches that way.

Lawson
	  >< Microsoft free environment

This mail client runs on Wine.  Your mileage may vary.

ChangeLog

	* in1632/gdi.spec, memory.string.c:
	Lawson Whitney <lawson_whitney@juno.com>
	Unstub (implement) gdi.467

diff -urN was/if1632/gdi.spec is/if1632/gdi.spec
--- was/if1632/gdi.spec	Sun Oct 31 21:44:52 1999
+++ is/if1632/gdi.spec	Mon Nov 29 00:32:30 1999
@@ -293,7 +293,7 @@
 464 stub FIXUPBOGUSPUBLISHERMETAFILE
 465 pascal16 RectVisible(word ptr) RectVisible16
 466 pascal16 RectInRegion(word ptr) RectInRegion16
-467 stub UNICODETOANSI
+467 pascal16 UnicodeToAnsi(ptr ptr) GDI_UnicodeToAnsi16
 468 pascal16 GetBitmapDimensionEx(word ptr) GetBitmapDimensionEx16
 469 pascal16 GetBrushOrgEx(word ptr) GetBrushOrgEx16
 470 pascal16 GetCurrentPositionEx(word ptr) GetCurrentPositionEx16
diff -urN was/memory/string.c is/memory/string.c
--- was/memory/string.c	Sun Nov 14 23:33:10 1999
+++ is/memory/string.c	Mon Nov 29 01:10:14 1999
@@ -7,6 +7,7 @@
 
 #include <ctype.h>
 #include <string.h>
+#include <limits.h>
 
 #include "wine/winbase16.h"
 #include "wine/winuser16.h"
@@ -466,6 +467,72 @@
 
     return (INT16)lstrlenA( dst );
 }
+UINT16 UNICODE_Reverse_Translate(LPSTR dest, LPWSTR source, LPWSTR
tabel,
+		INT offset, INT size, short defalt);
+
+/***********************************************************************
+ *	     UnicodeToAnsi   (GDI.467)
+ */
+UINT16 WINAPI GDI_UnicodeToAnsi16(LPWSTR source, LPSTR dest)
+{
+	static INT16 giddy_reverse_xtab[] = { 
+			0x201a, 0x192,
+			0x201e, 0x2026, 0x2020, 0x2021,
+			0x2c6, 0x2030, 0x160, 0x2039,
+			0x152, 0x8d, 0x8e, 0x8f,
+			0x90, 0x2018, 0x2019, 0x201c,
+			0x201d, 0x2022, 0x2013, 0x2014,
+			0x2dc, 0x2122, 0x161, 0x203a,
+			0x153, 0x9d, 0x9e, 0x178,
+			0xa0, 0xa1, 0xa2, 0xa3,
+			0xa4, 0xa5, 0xa6, 0xa7,
+			0xa8, 0xa9, 0xaa, 0xab,
+			0xac, 0xad, 0xae, 0xaf,
+			0xb0, 0xb1, 0xb2, 0xb3,
+			0xb4, 0xb5, 0xb6, 0x2219 };
+#define GIDDY_OFFSET 130
+
+	return UNICODE_Reverse_Translate(dest, source,
giddy_reverse_xtab,
+			GIDDY_OFFSET, sizeof(giddy_reverse_xtab)/2,
0x1f);
+}
+UINT16 UNICODE_Reverse_Translate(LPSTR dest, LPWSTR source, LPWSTR
tabel,
+		INT offset, INT size, short defalt)
+
+/* I didn't like to do a full reverse-translate as you know who does
+ * and I didn't want to take 128k for a translate table full of 1f's
+ * and the ix86 doesn't have a translate instruction anyway,
+ * so my compromise is to only reverse-translate that
+ * part of the code space that needs it.
+ *
+ * <lawson_whitney@juno.com> Mon Nov 29 05:01:12 UTC 1999
+ */
+ {	unsigned short shrift = 1;
+ 	short sheeted = offset + size;
+ 	int eres = 0, ted = 0;
+ 	int k;
+ 	while(shrift)
+ 	{
+ 		shrift = source[eres++];
+ 		if (((shrift >= offset) && (shrift < sheeted))
+ 			 || (shrift >= UCHAR_MAX))
+ 		{
+ 			for ( k = 0; k < size; k++)
+ 			{
+ 				if (tabel[k] == shrift)
+ 				{
+ 					shrift = offset + k;
+ 					goto Woonsocket;
+ 				}
+ 			}
+ 			shrift = defalt;
+ 		}
+ 		Woonsocket:  /* come from inner loop. */
+ 		dest[ted++] = (char) shrift;
+ 	}
+	return ted;
+ }
+ 
+	 
 
 
 /***********************************************************************

begin 644 gdi.diff.gz
M'XL("),D0C@``V=I9&1Y`,56;6_:2!#^;/^*42NU4`/!AO!V:16:MR*E293`
MI:>H0HN]ABW&B[SK$B[-?[_97=M`0K]5.B-Y\<PSS\SN/K/VR8S$4WK)I[9M
M?0`6NZV&=S`-6$TLJ5^!!5WP9%T3,F'QM.;W;.N2K`2/X7[&9$S7<!3IY_'*
M/!__2&->\_GBDVV-8B'3"9388AG1!8UE&11QL]6V[8"%(533Y`I61!RP<"<M
ML%<FNUJM[H-:=VD,U[Z$A@N>VVLV>X<>N-UNUW8<9P^/]15KO^(_P>M"O=YK
M>+U&W>"/CZ'J=1N5-CAF.#ZVH=EJ@I[$^>#;Z.;S]<7H[F;T^7)P]^7L]NO9
ML'\^N#Q3J$-8$N&3R&W!+?7EWTRP241+*YX$L)1)>=OJME1$:S=B$-_2*>/Q
MBY#<C#%57#=3R^AJ<')]>C:\[E_=#6Q'V0NN4<Q\'M`A[\>"E9#'<%V<#L8[
M+E-$9Q-X0>5G)A=D><IPJP3F/'O<*F:?VW!T=SF25,RND^FKX,*NH]KUG:B3
M-$E0'S=<,+DG\RLW<NP*R,CT()>IVO@7ID)`+^Q:0$H0;A.\1J_1Z+GU'0&]
MQ&\+R$5P#P,+`;4K+7#:F7AL>,MB/TH#"D>^7"]I;?9IVY91HM'9&".V8%)H
MY!;VS8K%]`!O$R)00+79FWW.5-#$.%4MJ#%5#<JCTO:R@M254)DF,90&5T.W
M58ZPBHC&_1($0D+Y+QN>;6>D?;G0QK?T)TT$'0\3$HN(2%JZO+D;WD)`A:S`
MY<V]>A`\37Q:/$HRH5'%=BP+N8"'H:"(5?\%^Q=A8L83B0PAB21F=6SGX,.?
MN6P'/EAZICN*Q^<2MH$Z?LH*<E!,\WYPU;\9[.N1TJNYY=-&BB><G)!$,A\,
MSY0%P7J<9(OUB"OP\!T^PA.H5;#JCU[=)16H/[I=K[(Q467RZEXK&^O9Z!88
M/W,UM,MM98A&-T>XAYXR=0)]UX2=,'=V,[C;R<9N-OI;10194B_S-;*Q66`"
M7YM<`W%;;E8$V12A@[J:JJN+<-N=W$MT%41'$4U!&H6OJ9\/]5W/E;0+GZZ:
MZ)J)7CTR*7RZ)*(3$IV0%+.>Z'P3G6^B\TV*?!.=;Z+S3<S:>FX7GE&%;U&0
MV$QP,3@]_6=\?7Y^=S8$MU%7^K2RQOE]5YA^R,7R6@ZF@&WNBNX&'I9>@\L'
M9J5#U1W_0T^:EH0!!"R(WTN(V)R"Y!!P(!"F4019M569EP!$P)JG,(_Y"E8S
MA:5"]1J0.-@PK4@L%9,DR.AZG3F$/$'2#0\6&E&3A(?@AN\W+')&@3UV6II;
ML<W(3[H3S/"S(TE]]:;`B/6*K"LZ6G!8K`$_398)7S"!0*&JX'&TWC,5.2-2
MART)K@E6H1*KLP'$DOC&#S&E@0`F:PJIT;_]'(+M]\9A3[TZ/!@-3[)WC3Z/
MX,E*\=R9QC3(]D+,$A9*/$1<%`%8N9%2B9"/V1:"H_=/(Q@N+4VH0"=V@$'5
M"\]<_\/:\-O$4*NCT'I2-ZO(953SH&@<Y[L.L5@(I5(6`Y_RS&5X]PYRZU%>
M6%F36A;\^@5;(:.3+_W;\=?^M\QOLEIJ[TLPUW7B<&3F`G/'R6@RG"Y!*_AA
MCL?J1]B:P!9J,XUB<<RLU37EN.'WG,>"^W,J<_NS&;.A(#"-8$#&MPGM`6!S
MX,:B3%%.*+J8)A!QOJR9K;0LU8D/N!RXADA6\F<$OV8,N>9\WAPIB%(FE02-
08.O?'WL?_@>()4"HXPL``+0L
`
end
 




___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.


=========================================================================

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic