gdi: Fix 24bpp -> 32bpp copy.
[wine] / dlls / usp10 / usp10.c
1 /*
2  * Implementation of Uniscribe Script Processor (usp10.dll)
3  *
4  * Copyright 2005 Steven Edwards for CodeWeavers
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  * Notes:
21  * Uniscribe allows for processing of complex scripts such as joining
22  * and filtering characters and bi-directional text with custom line breaks.
23  */
24
25 #include <stdarg.h>
26
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "usp10.h"
32
33 #include "wine/debug.h"
34
35 /**
36  * some documentation here:
37  *   http://www.microsoft.com/typography/developers/uniscribe/uniscribe.htm
38  */
39
40 WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
41
42 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
43 {
44     switch(fdwReason) {
45         case DLL_PROCESS_ATTACH:
46             DisableThreadLibraryCalls(hInstDLL);
47             break;
48         case DLL_PROCESS_DETACH:
49             break;
50     }
51     return TRUE;
52 }
53
54 /***********************************************************************
55  *      ScriptGetProperties (USP10.@)
56  *
57  */
58 HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***ppSp, int *piNumScripts)
59 {
60     FIXME("%p,%p\n",ppSp,piNumScripts);
61     return E_NOTIMPL;
62 }
63
64 /***********************************************************************
65  *      ScriptGetFontProperties (USP10.@)
66  *
67  */
68 HRESULT WINAPI ScriptGetFontProperties(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp)
69 {
70     FIXME("%p,%p,%p\n", hdc, psc, sfp);
71     /* return something sensible? */
72     if (NULL != sfp) {
73         sfp->cBytes        = sizeof(SCRIPT_FONTPROPERTIES);
74         sfp->wgBlank       = 0;
75         sfp->wgDefault     = 0;
76         sfp->wgInvalid     = 0;
77         sfp->wgKashida     = 1;
78         sfp->iKashidaWidth = 0;
79     }
80     return 0;
81 }
82
83 /***********************************************************************
84  *      ScriptRecordDigitSubstitution (USP10.@)
85  *
86  */
87 HRESULT WINAPI ScriptRecordDigitSubstitution(LCID Locale,SCRIPT_DIGITSUBSTITUTE *psds)
88 {
89     FIXME("%ld,%p\n",Locale,psds);
90     return E_NOTIMPL;
91 }
92
93 /***********************************************************************
94  *      ScriptApplyDigitSubstitution (USP10.@)
95  *
96  */
97 HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE* psds, 
98                                             SCRIPT_CONTROL* psc, SCRIPT_STATE* pss)
99 {
100     FIXME("%p,%p,%p\n",psds,psc,pss);
101     return E_NOTIMPL;
102 }
103
104 /***********************************************************************
105  *      ScriptItemize (USP10.@)
106  *
107  */
108 HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems, 
109                              const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, 
110                              SCRIPT_ITEM *pItems, int *pcItems)
111 {
112     FIXME("%s,%d,%d,%p,%p,%p,%p\n", debugstr_w(pwcInChars), cInChars, cMaxItems, 
113           psControl, psState, pItems, pcItems);
114     return E_INVALIDARG;
115 }
116
117 /***********************************************************************
118  *      ScriptStringAnalyse (USP10.@)
119  *
120  */
121 HRESULT WINAPI ScriptStringAnalyse(HDC hdc, 
122                                    const void *pString, 
123                                    int cString, 
124                                    int cGlyphs,
125                                    int iCharset,
126                                    DWORD dwFlags,
127                                    int iReqWidth,
128                                    SCRIPT_CONTROL *psControl,
129                                    SCRIPT_STATE *psState,
130                                    const int *piDx,
131                                    SCRIPT_TABDEF *pTabdef,
132                                    const BYTE *pbInClass,
133                                    SCRIPT_STRING_ANALYSIS *pssa)
134 {
135   FIXME("(%p,%p,%d,%d,%d,0x%lx,%d,%p,%p,%p,%p,%p,%p): stub\n",
136         hdc, pString, cString, cGlyphs, iCharset, dwFlags,
137         iReqWidth, psControl, psState, piDx, pTabdef, pbInClass, pssa);
138   if (1 > cString || NULL == pString) {
139     return E_INVALIDARG;
140   }
141   if ((dwFlags & SSA_GLYPHS) && NULL == hdc) {
142     return E_INVALIDARG;
143   }
144
145   return E_NOTIMPL;
146 }
147
148 /***********************************************************************
149  *      ScriptStringFree (USP10.@)
150  *
151  */
152 HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa) {
153   FIXME("(%p): stub\n",pssa);
154   return S_OK;
155 }
156
157 /***********************************************************************
158  *      ScriptIsComplex (USP10.@)
159  *
160  */
161 HRESULT WINAPI ScriptIsComplex(const WCHAR* pwcInChars, int cInChars, DWORD dwFlags) {
162   FIXME("(%s,%d,0x%lx): stub\n",  debugstr_w(pwcInChars), cInChars, dwFlags);
163    return E_NOTIMPL;
164 }