4 * Copyright 1994 Alexandre Julliard
9 #ifndef X_DISPLAY_MISSING
11 #else /* !defined(X_DISPLAY_MISSING) */
13 #endif /* !defined(X_DISPLAY_MISSING) */
20 #ifdef MALLOC_DEBUGGING
32 #include "builtin32.h"
33 #include "debugtools.h"
34 #include "debugdefs.h"
46 #include "wine/winuser16.h"
49 /**********************************************************************/
51 USER_DRIVER
*USER_Driver
= NULL
;
53 /* when adding new languages look at ole/ole2nls.c
54 * for proper iso name and Windows code (add 0x0400
55 * to the code listed there)
57 const WINE_LANGUAGE_DEF Languages
[] =
59 {"En",0x0409}, /* LANG_En */
60 {"Es",0x040A}, /* LANG_Es */
61 {"De",0x0407}, /* LANG_De */
62 {"No",0x0414}, /* LANG_No */
63 {"Fr",0x040C}, /* LANG_Fr */
64 {"Fi",0x040B}, /* LANG_Fi */
65 {"Da",0x0406}, /* LANG_Da */
66 {"Cs",0x0405}, /* LANG_Cs */
67 {"Eo",0x048f}, /* LANG_Eo */
68 {"It",0x0410}, /* LANG_It */
69 {"Ko",0x0412}, /* LANG_Ko */
70 {"Hu",0x040e}, /* LANG_Hu */
71 {"Pl",0x0415}, /* LANG_Pl */
72 {"Pt",0x0416}, /* LANG_Pt */
73 {"Sv",0x041d}, /* LANG_Sv */
74 {"Ca",0x0403}, /* LANG_Ca */
75 {"Nl",0x0413}, /* LANG_Nl */
76 {"Ru",0x0419}, /* LANG_Ru */
77 {"Wa",0x0490}, /* LANG_Wa */
78 {"Ga",0x043c}, /* LANG_Ga */
79 {"Gd",0x083c}, /* LANG_Gd */
80 {"Gv",0x0c3c}, /* LANG_Gv */
81 {"Kw",0x0491}, /* LANG_Kw */
82 {"Cy",0x0492}, /* LANG_Cy */
83 {"Br",0x0493}, /* LANG_Br */
87 WORD WINE_LanguageId
= 0x409; /* english as default */
89 struct options Options
=
90 { /* default options */
93 NULL
, /* desktopGeometry */
94 NULL
, /* programName */
96 FALSE
, /* usePrivateMap */
97 FALSE
, /* useFixedMap */
98 FALSE
, /* synchronous */
99 FALSE
, /* backing store */
100 SW_SHOWNORMAL
, /* cmdShow */
102 FALSE
, /* failReadOnly */
103 MODE_ENHANCED
, /* Enhanced mode */
105 DEFAULT_LANG
, /* Default language */
109 FALSE
, /* Managed windows */
110 FALSE
, /* Perfect graphics */
114 NULL
, /* Alternate config file name */
120 static const char szUsage
[] =
122 "Usage: %s [options] \"program_name [arguments]\"\n"
125 " -backingstore Turn on backing store\n"
126 " -config name Specify config file to use\n"
127 " -console driver Select which driver(s) to use for the console\n"
128 " -debug Enter debugger before starting application\n"
129 " -debugmsg name Turn debugging-messages on or off\n"
130 " -depth n Change the depth to use for multiple-depth screens\n"
131 " -desktop geom Use a desktop window of the given geometry\n"
132 " -display name Use the specified display\n"
133 " -dll name Enable or disable built-in DLLs\n"
134 " -failreadonly Read only files may not be opened in write mode\n"
135 " -fixedmap Use a \"standard\" color map\n"
136 " -help Show this help message\n"
137 " -iconic Start as an icon\n"
138 " -language xx Set the language (one of Br,Ca,Cs,Cy,Da,De,En,Eo,Es,Fi,Fr,Ga,Gd,Gv\n"
139 " Hu,It,Ko,Kw,Nl,No,Pl,Pt,Sv,Ru,Wa)\n"
140 " -managed Allow the window manager to manage created windows\n"
141 " -mode mode Start Wine in a particular mode (standard or enhanced)\n"
142 " -name name Set the application name\n"
143 " -nodga Disable XFree86 DGA extensions\n"
144 " -noxshm Disable XSHM extension\n"
145 " -dxgrab Enable DirectX mouse grab\n"
146 " -perfect Favor correctness over speed for graphical operations\n"
147 " -privatemap Use a private color map\n"
148 " -synchronous Turn on synchronous display mode\n"
149 " -version Display the Wine version\n"
150 " -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
151 " -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31\n"
154 /***********************************************************************
157 void MAIN_Usage( char *name
)
159 MESSAGE( szUsage
, WINE_RELEASE_INFO
, name
);
163 /***********************************************************************
164 * MAIN_GetProgramName
166 * Get the program name. The name is specified by (in order of precedence):
167 * - the option '-name'.
168 * - the environment variable 'WINE_NAME'.
169 * - the last component of argv[0].
171 static char *MAIN_GetProgramName( int argc
, char *argv
[] )
176 for (i
= 1; i
< argc
-1; i
++)
177 if (!strcmp( argv
[i
], "-name" )) return argv
[i
+1];
178 if ((p
= getenv( "WINE_NAME" )) != NULL
) return p
;
179 if ((p
= strrchr( argv
[0], '/' )) != NULL
) return p
+1;
183 /***********************************************************************
184 * MAIN_ParseDebugOptions
186 * Turns specific debug messages on or off, according to "options".
189 * TRUE if parsing was successful
191 BOOL
MAIN_ParseDebugOptions(char *options
)
193 /* defined in relay32/relay386.c */
194 extern char **debug_relay_includelist
;
195 extern char **debug_relay_excludelist
;
196 /* defined in relay32/snoop.c */
197 extern char **debug_snoop_includelist
;
198 extern char **debug_snoop_excludelist
;
201 int l
, cls
, dotracerelay
= TRACE_ON(relay
);
206 if (options
[l
-1]=='\n') options
[l
-1]='\0';
209 if ((*options
!='+')&&(*options
!='-')){
212 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
213 if(!lstrncmpiA(options
, debug_cl_name
[j
], strlen(debug_cl_name
[j
])))
215 if(j
==DEBUG_CLASS_COUNT
)
217 options
+= strlen(debug_cl_name
[j
]);
218 if ((*options
!='+')&&(*options
!='-'))
223 cls
= -1; /* all classes */
225 if (strchr(options
,','))
226 l
=strchr(options
,',')-options
;
230 if (!lstrncmpiA(options
+1,"all",l
-1))
233 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
234 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
235 if(cls
== -1 || cls
== j
)
236 __SET_DEBUGGING( j
, debug_channels
[i
], (*options
=='+') );
238 else if (!lstrncmpiA(options
+1, "relay=", 6) ||
239 !lstrncmpiA(options
+1, "snoop=", 6))
242 char *s
, *s2
, ***output
, c
;
244 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
245 if (!strncasecmp( debug_channels
[i
] + 1, options
+ 1, 5))
247 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
248 if(cls
== -1 || cls
== j
)
249 __SET_DEBUGGING( j
, debug_channels
[i
], 1 );
252 /* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
253 if (i
==DEBUG_CHANNEL_COUNT
)
255 output
= (*options
== '+') ?
256 ((*(options
+1) == 'r') ?
257 &debug_relay_includelist
:
258 &debug_snoop_includelist
) :
259 ((*(options
+1) == 'r') ?
260 &debug_relay_excludelist
:
261 &debug_snoop_excludelist
);
263 /* if there are n ':', there are n+1 modules, and we need n+2 slots
264 * last one being for the sentinel (NULL) */
266 while((s
= strchr(s
, ':'))) i
++, s
++;
267 *output
= malloc(sizeof(char **) * i
);
270 while((s2
= strchr(s
, ':'))) {
273 *((*output
)+i
) = CharUpperA(strdup(s
));
279 *(options
+ l
) = '\0';
280 *((*output
)+i
) = CharUpperA(strdup(s
));
282 *((*output
)+i
+1) = NULL
;
287 for (i
=0; i
<DEBUG_CHANNEL_COUNT
; i
++)
288 if (!strncasecmp( debug_channels
[i
] + 1, options
+ 1, l
- 1) && !debug_channels
[i
][l
])
290 for(j
=0; j
<DEBUG_CLASS_COUNT
; j
++)
291 if(cls
== -1 || cls
== j
)
292 __SET_DEBUGGING( j
, debug_channels
[i
], (*options
=='+') );
295 if (i
==DEBUG_CHANNEL_COUNT
)
300 while((*options
==',')&&(*(++options
)));
302 /* special handling for relay debugging */
303 if (dotracerelay
!= TRACE_ON(relay
))
304 BUILTIN32_SwitchRelayDebug( TRACE_ON(relay
) );
310 MESSAGE("%s: Syntax: -debugmsg [class]+xxx,... or "
311 "-debugmsg [class]-xxx,...\n",Options
.argv
[0]);
312 MESSAGE("Example: -debugmsg +all,warn-heap\n"
313 " turn on all messages except warning heap messages\n");
314 MESSAGE("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
315 " turn on -debugmsg +relay only as specified\n"
316 "Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
317 " turn on -debugmsg +relay except as specified\n"
318 "Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
320 MESSAGE("Available message classes:\n");
321 for(i
=0;i
<DEBUG_CLASS_COUNT
;i
++)
322 MESSAGE( "%-9s", debug_cl_name
[i
]);
325 MESSAGE("Available message types:\n");
326 MESSAGE("%-9s ","all");
327 for(i
=0;i
<DEBUG_CHANNEL_COUNT
;i
++)
328 MESSAGE("%-9s%c",debug_channels
[i
] + 1,
329 (((i
+2)%8==0)?'\n':' '));
335 /***********************************************************************
339 * Lang: a string whose two first chars are the iso name of a language.
340 * Country: a string whose two first chars are the iso name of country
341 * Charset: a string defining the chossen charset encoding
342 * Dialect: a string defining a variation of the locale
344 * all those values are from the standardized format of locale
345 * name in unix which is: Lang[_Country][.Charset][@Dialect]
348 * the numeric code of the language used by Windows (or 0x00)
350 int MAIN_GetLanguageID(LPCSTR Lang
,LPCSTR Country
,LPCSTR Charset
,LPCSTR Dialect
)
352 char lang
[3]="??", country
[3]={0,0,0};
353 char *charset
=NULL
, *dialect
=NULL
;
356 if (Lang
==NULL
) return 0x00;
357 if (Lang
[0]) lang
[0]=tolower(Lang
[0]);
358 if (Lang
[1]) lang
[1]=tolower(Lang
[1]);
361 if (Country
[0]) country
[0]=toupper(Country
[0]);
362 if (Country
[1]) country
[1]=toupper(Country
[1]);
367 charset
=(char*)malloc(j
+1);
369 charset
[i
]=toupper(Charset
[i
]);
375 dialect
=(char*)malloc(j
+1);
377 dialect
[i
]=tolower(Dialect
[i
]);
384 #define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
387 goto end_MAIN_GetLanguageID; \
389 #define LANG_SUB_ENTRY(x,y,z) if (!strcmp(country, x )) \
390 ret = MAKELANGID( LANG_##y , SUBLANG_##z ); \
391 goto end_MAIN_GetLanguageID;
392 #define LANG_DIALECT_ENTRY(x,y) { ret = MAKELANGID(LANG_##x , SUBLANG_##y ); \
393 goto end_MAIN_GetLanguageID; }
394 #define LANG_ENTRY_END(x) ret = MAKELANGID(LANG_##x , SUBLANG_DEFAULT); \
395 goto end_MAIN_GetLanguageID; \
398 /*x01*/ LANG_ENTRY_BEGIN( "ar", ARABIC
)
399 LANG_SUB_ENTRY( "SA", ARABIC
, ARABIC
)
400 LANG_SUB_ENTRY( "IQ", ARABIC
, ARABIC_IRAQ
)
401 LANG_SUB_ENTRY( "EG", ARABIC
, ARABIC_EGYPT
)
402 LANG_SUB_ENTRY( "LY", ARABIC
, ARABIC_LIBYA
)
403 LANG_SUB_ENTRY( "DZ", ARABIC
, ARABIC_ALGERIA
)
404 LANG_SUB_ENTRY( "MA", ARABIC
, ARABIC_MOROCCO
)
405 LANG_SUB_ENTRY( "TN", ARABIC
, ARABIC_TUNISIA
)
406 LANG_SUB_ENTRY( "OM", ARABIC
, ARABIC_OMAN
)
407 LANG_SUB_ENTRY( "YE", ARABIC
, ARABIC_YEMEN
)
408 LANG_SUB_ENTRY( "SY", ARABIC
, ARABIC_SYRIA
)
409 LANG_SUB_ENTRY( "JO", ARABIC
, ARABIC_JORDAN
)
410 LANG_SUB_ENTRY( "LB", ARABIC
, ARABIC_LEBANON
)
411 LANG_SUB_ENTRY( "KW", ARABIC
, ARABIC_KUWAIT
)
412 LANG_SUB_ENTRY( "AE", ARABIC
, ARABIC_UAE
)
413 LANG_SUB_ENTRY( "BH", ARABIC
, ARABIC_BAHRAIN
)
414 LANG_SUB_ENTRY( "QA", ARABIC
, ARABIC_QATAR
)
415 LANG_ENTRY_END( ARABIC
)
416 /*x02*/ LANG_ENTRY_BEGIN( "bu", BULGARIAN
)
417 LANG_ENTRY_END( BULGARIAN
)
418 /*x03*/ LANG_ENTRY_BEGIN( "ca", CATALAN
)
419 LANG_ENTRY_END( CATALAN
)
420 /*x04*/ LANG_ENTRY_BEGIN( "zh", CHINESE
)
421 LANG_SUB_ENTRY( "TW", CHINESE
, CHINESE_TRADITIONAL
)
422 LANG_SUB_ENTRY( "CN", CHINESE
, CHINESE_SIMPLIFIED
)
423 LANG_SUB_ENTRY( "HK", CHINESE
, CHINESE_HONGKONG
)
424 LANG_SUB_ENTRY( "SG", CHINESE
, CHINESE_SINGAPORE
)
425 LANG_SUB_ENTRY( "MO", CHINESE
, CHINESE_MACAU
)
426 LANG_ENTRY_END( CHINESE
)
427 /*x05*/ LANG_ENTRY_BEGIN( "cs", CZECH
)
428 LANG_ENTRY_END( CZECH
)
429 /*x06*/ LANG_ENTRY_BEGIN( "da", DANISH
)
430 LANG_ENTRY_END( DANISH
)
431 /*x07*/ LANG_ENTRY_BEGIN( "de", GERMAN
)
432 LANG_SUB_ENTRY( "DE", GERMAN
, GERMAN
)
433 LANG_SUB_ENTRY( "CH", GERMAN
, GERMAN_SWISS
)
434 LANG_SUB_ENTRY( "AT", GERMAN
, GERMAN_AUSTRIAN
)
435 LANG_SUB_ENTRY( "LU", GERMAN
, GERMAN_LUXEMBOURG
)
436 LANG_SUB_ENTRY( "LI", GERMAN
, GERMAN_LIECHTENSTEIN
)
437 LANG_ENTRY_END( GERMAN
)
438 /*x08*/ LANG_ENTRY_BEGIN( "el", GREEK
)
439 LANG_ENTRY_END( GREEK
)
440 /*x09*/ LANG_ENTRY_BEGIN( "en", ENGLISH
)
441 LANG_SUB_ENTRY( "US", ENGLISH
, ENGLISH_US
)
442 LANG_SUB_ENTRY( "UK", ENGLISH
, ENGLISH_UK
)
443 LANG_SUB_ENTRY( "AU", ENGLISH
, ENGLISH_AUS
)
444 LANG_SUB_ENTRY( "CA", ENGLISH
, ENGLISH_CAN
)
445 LANG_SUB_ENTRY( "NZ", ENGLISH
, ENGLISH_NZ
)
446 LANG_SUB_ENTRY( "EI", ENGLISH
, ENGLISH_EIRE
)
447 LANG_SUB_ENTRY( "ZA", ENGLISH
, ENGLISH_SAFRICA
)
448 LANG_SUB_ENTRY( "JM", ENGLISH
, ENGLISH_JAMAICA
)
449 /* LANG_SUB_ENTRY( "AG", ENGLISH, ENGLISH_CARIBBEAN ) */
450 LANG_SUB_ENTRY( "BZ", ENGLISH
, ENGLISH_BELIZE
)
451 LANG_SUB_ENTRY( "TT", ENGLISH
, ENGLISH_TRINIDAD
)
452 LANG_SUB_ENTRY( "ZW", ENGLISH
, ENGLISH_ZIMBABWE
)
453 LANG_SUB_ENTRY( "PH", ENGLISH
, ENGLISH_PHILIPPINES
)
454 LANG_ENTRY_END( ENGLISH
)
455 /*x0a*/ LANG_ENTRY_BEGIN( "es", SPANISH
)
456 /* traditional sorting */
457 if (!strcmp(dialect
,"tradicional"))
458 LANG_DIALECT_ENTRY( SPANISH
, SPANISH
)
459 LANG_SUB_ENTRY( "MX", SPANISH
, SPANISH_MEXICAN
)
460 LANG_SUB_ENTRY( "ES", SPANISH
, SPANISH_MODERN
)
461 LANG_SUB_ENTRY( "GT", SPANISH
, SPANISH_GUATEMALA
)
462 LANG_SUB_ENTRY( "CR", SPANISH
, SPANISH_COSTARICA
)
463 LANG_SUB_ENTRY( "PA", SPANISH
, SPANISH_PANAMA
)
464 LANG_SUB_ENTRY( "DO", SPANISH
, SPANISH_DOMINICAN
)
465 LANG_SUB_ENTRY( "VE", SPANISH
, SPANISH_VENEZUELA
)
466 LANG_SUB_ENTRY( "CO", SPANISH
, SPANISH_COLOMBIA
)
467 LANG_SUB_ENTRY( "PE", SPANISH
, SPANISH_PERU
)
468 LANG_SUB_ENTRY( "AR", SPANISH
, SPANISH_ARGENTINA
)
469 LANG_SUB_ENTRY( "EC", SPANISH
, SPANISH_ECUADOR
)
470 LANG_SUB_ENTRY( "CL", SPANISH
, SPANISH_CHILE
)
471 LANG_SUB_ENTRY( "UY", SPANISH
, SPANISH_URUGUAY
)
472 LANG_SUB_ENTRY( "PY", SPANISH
, SPANISH_PARAGUAY
)
473 LANG_SUB_ENTRY( "BO", SPANISH
, SPANISH_BOLIVIA
)
474 LANG_SUB_ENTRY( "HN", SPANISH
, SPANISH_HONDURAS
)
475 LANG_SUB_ENTRY( "NI", SPANISH
, SPANISH_NICARAGUA
)
476 LANG_SUB_ENTRY( "PR", SPANISH
, SPANISH_PUERTO_RICO
)
477 LANG_ENTRY_END( SPANISH
)
478 /*x0b*/ LANG_ENTRY_BEGIN( "fi", FINNISH
)
479 LANG_ENTRY_END( FINNISH
)
480 /*x0c*/ LANG_ENTRY_BEGIN( "fr", FRENCH
)
481 LANG_SUB_ENTRY( "FR", FRENCH
, FRENCH
)
482 LANG_SUB_ENTRY( "BE", FRENCH
, FRENCH_BELGIAN
)
483 LANG_SUB_ENTRY( "CA", FRENCH
, FRENCH_CANADIAN
)
484 LANG_SUB_ENTRY( "CH", FRENCH
, FRENCH_SWISS
)
485 LANG_SUB_ENTRY( "LU", FRENCH
, FRENCH_LUXEMBOURG
)
486 LANG_SUB_ENTRY( "MC", FRENCH
, FRENCH_MONACO
)
487 LANG_ENTRY_END( FRENCH
)
488 /*x0d*/ LANG_ENTRY_BEGIN( "iw", HEBREW
)
489 LANG_ENTRY_END( HEBREW
)
490 /*x0e*/ LANG_ENTRY_BEGIN( "hu", HUNGARIAN
)
491 LANG_ENTRY_END( HUNGARIAN
)
492 /*x0f*/ LANG_ENTRY_BEGIN( "ic", ICELANDIC
)
493 LANG_ENTRY_END( ICELANDIC
)
494 /*x10*/ LANG_ENTRY_BEGIN( "it", ITALIAN
)
495 LANG_SUB_ENTRY( "IT", ITALIAN
, ITALIAN
)
496 LANG_SUB_ENTRY( "CH", ITALIAN
, ITALIAN_SWISS
)
497 LANG_ENTRY_END( ITALIAN
)
498 /*x11*/ LANG_ENTRY_BEGIN( "ja", JAPANESE
)
499 LANG_ENTRY_END( JAPANESE
)
500 /*x12*/ LANG_ENTRY_BEGIN( "ko", KOREAN
)
502 if (!strcmp(charset
,"JOHAB"))
503 LANG_DIALECT_ENTRY( KOREAN
, KOREAN_JOHAB
)
505 LANG_DIALECT_ENTRY( KOREAN
, KOREAN
)
506 LANG_ENTRY_END( KOREAN
)
507 /*x13*/ LANG_ENTRY_BEGIN( "nl", DUTCH
)
508 LANG_SUB_ENTRY( "NL", DUTCH
, DUTCH
)
509 LANG_SUB_ENTRY( "BE", DUTCH
, DUTCH_BELGIAN
)
510 LANG_SUB_ENTRY( "SR", DUTCH
, DUTCH_SURINAM
)
511 LANG_ENTRY_END( DUTCH
)
512 /*x14*/ LANG_ENTRY_BEGIN( "no", NORWEGIAN
)
514 if (!strcmp(dialect
,"nynorsk"))
515 LANG_DIALECT_ENTRY( NORWEGIAN
, NORWEGIAN_NYNORSK
)
517 LANG_DIALECT_ENTRY( NORWEGIAN
, NORWEGIAN_BOKMAL
)
518 LANG_ENTRY_END( NORWEGIAN
)
519 /*x15*/ LANG_ENTRY_BEGIN( "pl", POLISH
)
520 LANG_ENTRY_END( POLISH
)
521 /*x16*/ LANG_ENTRY_BEGIN( "pt", PORTUGUESE
)
522 LANG_SUB_ENTRY( "BR", PORTUGUESE
, PORTUGUESE_BRAZILIAN
)
523 LANG_SUB_ENTRY( "PT", PORTUGUESE
, PORTUGUESE
)
524 LANG_ENTRY_END( PORTUGUESE
)
525 /*x17*/ LANG_ENTRY_BEGIN( "rm", RHAETO_ROMANCE
)
526 LANG_ENTRY_END( RHAETO_ROMANCE
)
527 /*x18*/ LANG_ENTRY_BEGIN( "ro", ROMANIAN
)
528 LANG_SUB_ENTRY( "RO", ROMANIAN
, ROMANIAN
)
529 LANG_SUB_ENTRY( "MD", ROMANIAN
, ROMANIAN_MOLDAVIA
)
530 LANG_ENTRY_END( ROMANIAN
)
531 /*x19*/ LANG_ENTRY_BEGIN( "ru", RUSSIAN
)
532 LANG_SUB_ENTRY( "RU", RUSSIAN
, RUSSIAN
)
533 LANG_SUB_ENTRY( "MD", RUSSIAN
, RUSSIAN_MOLDAVIA
)
534 LANG_ENTRY_END( RUSSIAN
)
535 /*x1a*/ if (!strcmp(lang
,"sh") || !strcmp(lang
,"hr") || !strcmp(lang
,"sr")) {
537 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, NEUTRAL
)
538 if (!strcmp(charset
,"ISO-8859-5"))
539 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN
)
540 LANG_SUB_ENTRY( "HR", SERBO_CROATIAN
, CROATIAN
)
541 if (!strcmp(country
,"YU") && !strcmp(charset
,"ISO-8859-2"))
542 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN_LATIN
)
543 LANG_SUB_ENTRY( "YU", SERBO_CROATIAN
, SERBIAN
)
544 LANG_DIALECT_ENTRY( SERBO_CROATIAN
, SERBIAN_LATIN
)
546 /*x1b*/ LANG_ENTRY_BEGIN( "sk", SLOVAK
)
547 LANG_ENTRY_END( SLOVAK
)
548 /*x1c*/ LANG_ENTRY_BEGIN( "sq", ALBANIAN
)
549 LANG_ENTRY_END( ALBANIAN
)
550 /*x1d*/ LANG_ENTRY_BEGIN( "sv", SWEDISH
)
551 LANG_SUB_ENTRY( "SE", SWEDISH
, SWEDISH
)
552 LANG_SUB_ENTRY( "FI", SWEDISH
, SWEDISH_FINLAND
)
553 LANG_ENTRY_END( SWEDISH
)
554 /*x1e*/ LANG_ENTRY_BEGIN( "th", THAI
)
555 LANG_ENTRY_END( THAI
)
556 /*x1f*/ LANG_ENTRY_BEGIN( "tr", TURKISH
)
557 LANG_ENTRY_END( TURKISH
)
558 /*x20*/ LANG_ENTRY_BEGIN( "ur", URDU
)
559 LANG_ENTRY_END( URDU
)
560 /*x21*/ LANG_ENTRY_BEGIN( "in", INDONESIAN
)
561 LANG_ENTRY_END( INDONESIAN
)
562 /*x22*/ LANG_ENTRY_BEGIN( "uk", UKRAINIAN
)
563 LANG_ENTRY_END( UKRAINIAN
)
564 /*x23*/ LANG_ENTRY_BEGIN( "be", BYELORUSSIAN
)
565 LANG_ENTRY_END( BYELORUSSIAN
)
566 /*x24*/ LANG_ENTRY_BEGIN( "sl", SLOVENIAN
)
567 LANG_ENTRY_END( SLOVENIAN
)
568 /*x25*/ LANG_ENTRY_BEGIN( "et", ESTONIAN
)
569 LANG_ENTRY_END( ESTONIAN
)
570 /*x26*/ LANG_ENTRY_BEGIN( "lv", LATVIAN
)
571 LANG_ENTRY_END( LATVIAN
)
572 /*x27*/ LANG_ENTRY_BEGIN( "lt", LITHUANIAN
)
573 /* traditional sorting ? */
574 if (!strcmp(dialect
,"classic") || !strcmp(dialect
,"traditional"))
575 LANG_DIALECT_ENTRY( LITHUANIAN
, LITHUANIAN_CLASSIC
)
577 LANG_DIALECT_ENTRY( LITHUANIAN
, LITHUANIAN
)
578 LANG_ENTRY_END( LITHUANIAN
)
579 /*x28*/ LANG_ENTRY_BEGIN( "mi", MAORI
)
580 LANG_ENTRY_END( MAORI
)
581 /*x29*/ LANG_ENTRY_BEGIN( "fa", FARSI
)
582 LANG_ENTRY_END( FARSI
)
583 /*x2a*/ LANG_ENTRY_BEGIN( "vi", VIETNAMESE
)
584 LANG_ENTRY_END( VIETNAMESE
)
585 /*x2b*/ LANG_ENTRY_BEGIN( "hy", ARMENIAN
)
586 LANG_ENTRY_END( ARMENIAN
)
587 /*x2c*/ LANG_ENTRY_BEGIN( "az", AZERI
)
589 if (strstr(charset
,"KOI8") || !strcmp(charset
,"ISO-8859-5"))
590 LANG_DIALECT_ENTRY( AZERI
, AZERI_CYRILLIC
)
592 LANG_DIALECT_ENTRY( AZERI
, AZERI
)
593 LANG_ENTRY_END( AZERI
)
594 /*x2d*/ LANG_ENTRY_BEGIN( "eu", BASQUE
)
595 LANG_ENTRY_END( BASQUE
)
596 /*x2e*/ /*LANG_ENTRY_BEGIN( "??", SORBIAN )
597 LANG_ENTRY_END( SORBIAN ) */
598 /*x2f*/ LANG_ENTRY_BEGIN( "mk", MACEDONIAN
)
599 LANG_ENTRY_END( MACEDONIAN
)
600 /*x30*/ /*LANG_ENTRY_BEGIN( "??", SUTU )
601 LANG_ENTRY_END( SUTU ) */
602 /*x31*/ LANG_ENTRY_BEGIN( "ts", TSONGA
)
603 LANG_ENTRY_END( TSONGA
)
604 /*x32*/ /*LANG_ENTRY_BEGIN( "??", TSWANA )
605 LANG_ENTRY_END( TSWANA ) */
606 /*x33*/ /*LANG_ENTRY_BEGIN( "??", VENDA )
607 LANG_ENTRY_END( VENDA ) */
608 /*x34*/ LANG_ENTRY_BEGIN( "xh", XHOSA
)
609 LANG_ENTRY_END( XHOSA
)
610 /*x35*/ LANG_ENTRY_BEGIN( "zu", ZULU
)
611 LANG_ENTRY_END( ZULU
)
612 /*x36*/ LANG_ENTRY_BEGIN( "af", AFRIKAANS
)
613 LANG_ENTRY_END( AFRIKAANS
)
614 /*x37*/ LANG_ENTRY_BEGIN( "ka", GEORGIAN
)
615 LANG_ENTRY_END( GEORGIAN
)
616 /*x38*/ LANG_ENTRY_BEGIN( "fo", FAEROESE
)
617 LANG_ENTRY_END( FAEROESE
)
618 /*x39*/ LANG_ENTRY_BEGIN( "hi", HINDI
)
619 LANG_ENTRY_END( HINDI
)
620 /*x3a*/ LANG_ENTRY_BEGIN( "mt", MALTESE
)
621 LANG_ENTRY_END( MALTESE
)
622 /*x3b*/ /*LANG_ENTRY_BEGIN( "??", SAAMI )
623 LANG_ENTRY_END( SAAMI ) */
624 /*x3c*/ LANG_ENTRY_BEGIN( "ga", GAELIC
)
625 LANG_DIALECT_ENTRY( GAELIC
, GAELIC
)
626 LANG_ENTRY_END( GAELIC
)
627 /*x3c*/ LANG_ENTRY_BEGIN( "gd", GAELIC
)
628 LANG_DIALECT_ENTRY( GAELIC
, GAELIC_SCOTTISH
)
629 LANG_ENTRY_END( GAELIC
)
631 /*x3e*/ LANG_ENTRY_BEGIN( "ms", MALAY
)
632 LANG_SUB_ENTRY( "MY", MALAY
, MALAY
)
633 LANG_SUB_ENTRY( "BN", MALAY
, MALAY_BRUNEI_DARUSSALAM
)
634 LANG_ENTRY_END( MALAY
)
635 /*x3f*/ LANG_ENTRY_BEGIN( "kk", KAZAKH
)
636 LANG_ENTRY_END( KAZAKH
)
638 /*x41*/ LANG_ENTRY_BEGIN( "sw", SWAHILI
)
639 LANG_ENTRY_END( SWAHILI
)
641 /*x43*/ LANG_ENTRY_BEGIN( "uz", UZBEK
)
643 if (strstr(charset
,"KOI8") || !strcmp(charset
,"ISO-8859-5"))
644 LANG_DIALECT_ENTRY( UZBEK
, UZBEK_CYRILLIC
)
646 LANG_DIALECT_ENTRY( UZBEK
, UZBEK
)
647 LANG_ENTRY_END( UZBEK
)
648 /*x44*/ LANG_ENTRY_BEGIN( "tt", TATAR
)
649 LANG_ENTRY_END( TATAR
)
650 /*x45*/ LANG_ENTRY_BEGIN( "bn", BENGALI
)
651 LANG_ENTRY_END( BENGALI
)
652 /*x46*/ LANG_ENTRY_BEGIN( "pa", PUNJABI
)
653 LANG_ENTRY_END( PUNJABI
)
654 /*x47*/ LANG_ENTRY_BEGIN( "gu", GUJARATI
)
655 LANG_ENTRY_END( GUJARATI
)
656 /*x48*/ LANG_ENTRY_BEGIN( "or", ORIYA
)
657 LANG_ENTRY_END( ORIYA
)
658 /*x49*/ LANG_ENTRY_BEGIN( "ta", TAMIL
)
659 LANG_ENTRY_END( TAMIL
)
660 /*x4a*/ LANG_ENTRY_BEGIN( "te", TELUGU
)
661 LANG_ENTRY_END( TELUGU
)
662 /*x4b*/ LANG_ENTRY_BEGIN( "kn", KANNADA
)
663 LANG_ENTRY_END( KANNADA
)
664 /*x4c*/ LANG_ENTRY_BEGIN( "ml", MALAYALAM
)
665 LANG_ENTRY_END( MALAYALAM
)
666 /*x4d*/ LANG_ENTRY_BEGIN( "as", ASSAMESE
)
667 LANG_ENTRY_END( ASSAMESE
)
668 /*x4e*/ LANG_ENTRY_BEGIN( "mr", MARATHI
)
669 LANG_ENTRY_END( MARATHI
)
670 /*x4f*/ LANG_ENTRY_BEGIN( "sa", SANSKRIT
)
671 LANG_ENTRY_END( SANSKRIT
)
673 /*x57*/ /*LANG_ENTRY_BEGIN( "??", KONKANI )
674 LANG_ENTRY_END( KONKANI ) */
676 LANG_ENTRY_BEGIN( "eo", ESPERANTO
) /* not official */
677 LANG_ENTRY_END( ESPERANTO
)
678 LANG_ENTRY_BEGIN( "wa", WALON
) /* not official */
679 LANG_ENTRY_END( WALON
)
683 end_MAIN_GetLanguageID
:
684 if (Charset
) free(charset
);
690 /***********************************************************************
691 * MAIN_ParseLanguageOption
693 * Parse -language option.
695 void MAIN_ParseLanguageOption( char *arg
)
697 const WINE_LANGUAGE_DEF
*p
= Languages
;
699 /* for compatibility whith non-iso names previously used */
700 if (!strcmp("Sw",arg
)) { strcpy(arg
,"Sv"); FIXME_(system
)("use 'Sv' instead of 'Sw'\n");}
701 if (!strcmp("Cz",arg
)) { strcpy(arg
,"Cs"); FIXME_(system
)("use 'Cs' instead of 'Cz'\n");}
702 if (!strcmp("Po",arg
)) { strcpy(arg
,"Pt"); FIXME_(system
)("use 'Pt' instead of 'Po'\n");}
704 Options
.language
= LANG_Xx
; /* First (dummy) language */
707 if (!lstrcmpiA( p
->name
, arg
))
709 WINE_LanguageId
= p
->langid
;
714 MESSAGE( "Invalid language specified '%s'. Supported languages are: ", arg
);
715 for (p
= Languages
; p
->name
; p
++) MESSAGE( "%s ", p
->name
);
721 /***********************************************************************
722 * MAIN_ParseModeOption
724 * Parse -mode option.
726 void MAIN_ParseModeOption( char *arg
)
728 if (!lstrcmpiA("enhanced", arg
)) Options
.mode
= MODE_ENHANCED
;
729 else if (!lstrcmpiA("standard", arg
)) Options
.mode
= MODE_STANDARD
;
732 MESSAGE( "Invalid mode '%s' specified.\n", arg
);
733 MESSAGE( "Valid modes are: 'standard', 'enhanced' (default).\n");
738 /***********************************************************************
741 * Parse command line options and open display.
743 static void MAIN_ParseOptions( int *argc
, char *argv
[] )
750 Options
.programName
= MAIN_GetProgramName( *argc
, argv
);
752 /* initialise Options.language to 0 to tell "no language choosen yet" */
753 Options
.language
= 0;
755 /* make sure there is no "." in Options.programName to confuse the X
756 resource database lookups */
757 if ((pcDot
= strchr(Options
.programName
, '.'))) *pcDot
= '\0';
759 for (i
= 1; i
< *argc
; i
++)
761 if (!strcmp( argv
[i
], "-v" ) || !strcmp( argv
[i
], "-version" ))
763 MESSAGE( "%s\n", WINE_RELEASE_INFO
);
766 if (!strcmp( argv
[i
], "-h" ) || !strcmp( argv
[i
], "-help" ))
774 /***********************************************************************
777 static void called_at_exit(void)
780 GDI_Driver
->pFinalize();
782 USER_Driver
->pFinalize();
787 /***********************************************************************
790 * Wine initialisation and command-line parsing
792 BOOL
MAIN_WineInit( int *argc
, char *argv
[] )
796 #ifdef MALLOC_DEBUGGING
800 if (!(trace
= getenv("MALLOC_TRACE")))
802 MESSAGE( "MALLOC_TRACE not set. No trace generated\n" );
806 MESSAGE( "malloc trace goes to %s\n", trace
);
814 setlocale(LC_CTYPE
,"");
815 gettimeofday( &tv
, NULL
);
816 MSG_WineStartTicks
= (tv
.tv_sec
* 1000) + (tv
.tv_usec
/ 1000);
818 MAIN_ParseOptions(argc
, argv
);
820 #ifndef X_DISPLAY_MISSING
821 USER_Driver
= &X11DRV_USER_Driver
;
822 #else /* !defined(X_DISPLAY_MISSING) */
823 USER_Driver
= &TTYDRV_USER_Driver
;
824 #endif /* !defined(X_DISPLAY_MISSING) */
826 USER_Driver
->pInitialize();
828 MONITOR_Initialize(&MONITOR_PrimaryMonitor
);
830 atexit(called_at_exit
);
834 /***********************************************************************
835 * MessageBeep16 (USER.104)
837 void WINAPI
MessageBeep16( UINT16 i
)
843 /***********************************************************************
844 * MessageBeep32 (USER32.390)
846 BOOL WINAPI
MessageBeep( UINT i
)
853 /***********************************************************************
856 BOOL WINAPI
Beep( DWORD dwFreq
, DWORD dwDur
)
858 /* dwFreq and dwDur are ignored by Win95 */
864 /***********************************************************************
865 * GetTimerResolution (USER.14)
867 LONG WINAPI
GetTimerResolution16(void)
872 /***********************************************************************
873 * SystemParametersInfo32A (USER32.540)
875 BOOL WINAPI
SystemParametersInfoA( UINT uAction
, UINT uParam
,
876 LPVOID lpvParam
, UINT fuWinIni
)
882 *(BOOL
*) lpvParam
= KEYBOARD_GetBeepActive();
885 KEYBOARD_SetBeepActive(uParam
);
889 *(INT
*)lpvParam
= GetSystemMetrics( SM_CXFRAME
);
892 case SPI_GETDRAGFULLWINDOWS
:
893 *(BOOL
*) lpvParam
= FALSE
;
896 case SPI_SETDRAGFULLWINDOWS
:
899 case SPI_GETFASTTASKSWITCH
:
900 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
901 *(BOOL
*) lpvParam
= TRUE
;
903 *(BOOL
*) lpvParam
= FALSE
;
906 case SPI_GETGRIDGRANULARITY
:
907 *(INT
*)lpvParam
=GetProfileIntA("desktop","GridGranularity",1);
910 case SPI_GETICONTITLEWRAP
:
911 *(BOOL
*)lpvParam
=GetProfileIntA("desktop","IconTitleWrap",TRUE
);
914 case SPI_GETKEYBOARDDELAY
:
915 *(INT
*)lpvParam
=GetProfileIntA("keyboard","KeyboardDelay",1);
918 case SPI_GETKEYBOARDSPEED
:
919 *(DWORD
*)lpvParam
=GetProfileIntA("keyboard","KeyboardSpeed",30);
922 case SPI_GETMENUDROPALIGNMENT
:
923 *(BOOL
*)lpvParam
=GetSystemMetrics(SM_MENUDROPALIGNMENT
); /* XXX check this */
926 case SPI_GETSCREENSAVEACTIVE
:
927 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor
) ||
928 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
929 *(BOOL
*)lpvParam
= TRUE
;
931 *(BOOL
*)lpvParam
= FALSE
;
934 case SPI_GETSCREENSAVETIMEOUT
:
935 timeout
= MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor
);
937 timeout
= GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
938 *(INT
*) lpvParam
= timeout
* 1000;
941 case SPI_ICONHORIZONTALSPACING
:
942 /* FIXME Get/SetProfileInt */
943 if (lpvParam
== NULL
)
944 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
946 *(INT
*)lpvParam
=GetSystemMetrics(SM_CXICONSPACING
);
949 case SPI_ICONVERTICALSPACING
:
950 /* FIXME Get/SetProfileInt */
951 if (lpvParam
== NULL
)
952 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
954 *(INT
*)lpvParam
=GetSystemMetrics(SM_CYICONSPACING
);
957 case SPI_GETICONTITLELOGFONT
: {
958 LPLOGFONTA lpLogFont
= (LPLOGFONTA
)lpvParam
;
960 /* from now on we always have an alias for MS Sans Serif */
962 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
963 lpLogFont
->lfFaceName
, LF_FACESIZE
);
964 lpLogFont
->lfHeight
= -GetProfileIntA("Desktop","IconTitleSize", 13);
965 lpLogFont
->lfWidth
= 0;
966 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
967 lpLogFont
->lfWeight
= FW_NORMAL
;
968 lpLogFont
->lfItalic
= FALSE
;
969 lpLogFont
->lfStrikeOut
= FALSE
;
970 lpLogFont
->lfUnderline
= FALSE
;
971 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
972 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
973 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
974 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
977 case SPI_GETWORKAREA
:
978 SetRect( (RECT
*)lpvParam
, 0, 0,
979 GetSystemMetrics( SM_CXSCREEN
),
980 GetSystemMetrics( SM_CYSCREEN
)
983 case SPI_GETNONCLIENTMETRICS
:
985 #define lpnm ((LPNONCLIENTMETRICSA)lpvParam)
987 if( lpnm
->cbSize
== sizeof(NONCLIENTMETRICSA
) )
989 LPLOGFONTA lpLogFont
= &(lpnm
->lfMenuFont
);
991 /* clear the struct, so we have 'sane' members */
993 (char*)lpvParam
+sizeof(lpnm
->cbSize
),
995 lpnm
->cbSize
-sizeof(lpnm
->cbSize
)
998 /* FIXME: initialize geometry entries */
999 /* FIXME: As these values are presumably in device units,
1000 * we should calculate the defaults based on the screen dpi
1003 lpnm
->iCaptionWidth
= ((TWEAK_WineLook
> WIN31_LOOK
) ? 32 : 20);
1004 lpnm
->iCaptionHeight
= lpnm
->iCaptionWidth
;
1005 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1006 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfCaptionFont
),0);
1009 lpnm
->iSmCaptionWidth
= ((TWEAK_WineLook
> WIN31_LOOK
) ? 32 : 17);
1010 lpnm
->iSmCaptionHeight
= lpnm
->iSmCaptionWidth
;
1011 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
1013 /* menus, FIXME: names of wine.conf entrys are bogus */
1015 lpnm
->iMenuWidth
= GetProfileIntA("Desktop","MenuWidth", 13); /* size of the menu buttons*/
1016 lpnm
->iMenuHeight
= GetProfileIntA("Desktop","MenuHeight",
1017 (TWEAK_WineLook
> WIN31_LOOK
) ? 13 : 27);
1019 GetProfileStringA("Desktop", "MenuFont",
1020 (TWEAK_WineLook
> WIN31_LOOK
) ? "MS Sans Serif": "System",
1021 lpLogFont
->lfFaceName
, LF_FACESIZE
);
1023 lpLogFont
->lfHeight
= -GetProfileIntA("Desktop","MenuFontSize", 13);
1024 lpLogFont
->lfWidth
= 0;
1025 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1026 lpLogFont
->lfWeight
= (TWEAK_WineLook
> WIN31_LOOK
) ? FW_NORMAL
: FW_BOLD
;
1027 lpLogFont
->lfItalic
= FALSE
;
1028 lpLogFont
->lfStrikeOut
= FALSE
;
1029 lpLogFont
->lfUnderline
= FALSE
;
1030 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
1031 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1032 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1033 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
1035 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
1036 (LPVOID
)&(lpnm
->lfStatusFont
),0);
1037 SystemParametersInfoA(SPI_GETICONTITLELOGFONT
, 0,
1038 (LPVOID
)&(lpnm
->lfMessageFont
),0);
1043 case SPI_GETANIMATION
: {
1044 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)lpvParam
;
1046 /* Tell it "disabled" */
1047 lpAnimInfo
->cbSize
= sizeof(ANIMATIONINFO
);
1048 uParam
= sizeof(ANIMATIONINFO
);
1049 lpAnimInfo
->iMinAnimate
= 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1053 case SPI_SETANIMATION
: {
1054 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)lpvParam
;
1057 WARN_(system
)("SPI_SETANIMATION ignored.\n");
1058 lpAnimInfo
->cbSize
= sizeof(ANIMATIONINFO
);
1059 uParam
= sizeof(ANIMATIONINFO
);
1063 case SPI_GETHIGHCONTRAST
:
1065 LPHIGHCONTRASTA lpHighContrastA
= (LPHIGHCONTRASTA
)lpvParam
;
1067 FIXME_(system
)("SPI_GETHIGHCONTRAST not fully implemented\n");
1069 if ( lpHighContrastA
->cbSize
== sizeof( HIGHCONTRASTA
) )
1071 /* Indicate that there is no high contrast available */
1072 lpHighContrastA
->dwFlags
= 0;
1073 lpHighContrastA
->lpszDefaultScheme
= NULL
;
1084 return SystemParametersInfo16(uAction
,uParam
,lpvParam
,fuWinIni
);
1090 /***********************************************************************
1091 * SystemParametersInfo16 (USER.483)
1093 BOOL16 WINAPI
SystemParametersInfo16( UINT16 uAction
, UINT16 uParam
,
1094 LPVOID lpvParam
, UINT16 fuWinIni
)
1102 *(BOOL
*) lpvParam
= KEYBOARD_GetBeepActive();
1106 *(INT16
*)lpvParam
= GetSystemMetrics16( SM_CXFRAME
);
1109 case SPI_GETFASTTASKSWITCH
:
1110 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
1111 *(BOOL16
*) lpvParam
= TRUE
;
1113 *(BOOL16
*) lpvParam
= FALSE
;
1116 case SPI_GETGRIDGRANULARITY
:
1117 *(INT16
*) lpvParam
= GetProfileIntA( "desktop",
1122 case SPI_GETICONTITLEWRAP
:
1123 *(BOOL16
*) lpvParam
= GetProfileIntA( "desktop",
1128 case SPI_GETKEYBOARDDELAY
:
1129 *(INT16
*) lpvParam
= GetProfileIntA( "keyboard",
1130 "KeyboardDelay", 1 );
1133 case SPI_GETKEYBOARDSPEED
:
1134 *(WORD
*) lpvParam
= GetProfileIntA( "keyboard",
1139 case SPI_GETMENUDROPALIGNMENT
:
1140 *(BOOL16
*) lpvParam
= GetSystemMetrics16( SM_MENUDROPALIGNMENT
); /* XXX check this */
1143 case SPI_GETSCREENSAVEACTIVE
:
1144 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor
) ||
1145 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
1146 *(BOOL16
*) lpvParam
= TRUE
;
1148 *(BOOL16
*) lpvParam
= FALSE
;
1151 case SPI_GETSCREENSAVETIMEOUT
:
1152 timeout
= MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor
);
1154 timeout
= GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
1155 *(INT16
*) lpvParam
= timeout
;
1158 case SPI_ICONHORIZONTALSPACING
:
1159 /* FIXME Get/SetProfileInt */
1160 if (lpvParam
== NULL
)
1161 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
1163 *(INT16
*)lpvParam
= GetSystemMetrics16( SM_CXICONSPACING
);
1166 case SPI_ICONVERTICALSPACING
:
1167 /* FIXME Get/SetProfileInt */
1168 if (lpvParam
== NULL
)
1169 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
1171 *(INT16
*)lpvParam
= GetSystemMetrics16(SM_CYICONSPACING
);
1175 KEYBOARD_SetBeepActive(uParam
);
1178 case SPI_SETSCREENSAVEACTIVE
:
1179 MONITOR_SetScreenSaveActive(&MONITOR_PrimaryMonitor
, uParam
);
1182 case SPI_SETSCREENSAVETIMEOUT
:
1183 MONITOR_SetScreenSaveTimeout(&MONITOR_PrimaryMonitor
, uParam
);
1186 case SPI_SETDESKWALLPAPER
:
1187 return (SetDeskWallPaper((LPSTR
) lpvParam
));
1190 case SPI_SETDESKPATTERN
:
1191 if ((INT16
)uParam
== -1) {
1192 GetProfileStringA("Desktop", "Pattern",
1193 "170 85 170 85 170 85 170 85",
1194 buffer
, sizeof(buffer
) );
1195 return (DESKTOP_SetPattern((LPSTR
) buffer
));
1197 return (DESKTOP_SetPattern((LPSTR
) lpvParam
));
1200 case SPI_GETICONTITLELOGFONT
:
1202 LPLOGFONT16 lpLogFont
= (LPLOGFONT16
)lpvParam
;
1203 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1204 lpLogFont
->lfFaceName
, LF_FACESIZE
);
1205 lpLogFont
->lfHeight
= -GetProfileIntA("Desktop","IconTitleSize", 13);
1206 lpLogFont
->lfWidth
= 0;
1207 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1208 lpLogFont
->lfWeight
= FW_NORMAL
;
1209 lpLogFont
->lfItalic
= FALSE
;
1210 lpLogFont
->lfStrikeOut
= FALSE
;
1211 lpLogFont
->lfUnderline
= FALSE
;
1212 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
1213 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1214 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1215 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
1218 case SPI_GETNONCLIENTMETRICS
:
1220 #define lpnm ((LPNONCLIENTMETRICS16)lpvParam)
1221 if( lpnm
->cbSize
== sizeof(NONCLIENTMETRICS16
) )
1223 /* clear the struct, so we have 'sane' members */
1225 (char*)lpvParam
+sizeof(lpnm
->cbSize
),
1227 lpnm
->cbSize
-sizeof(lpnm
->cbSize
)
1229 /* FIXME: initialize geometry entries */
1230 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1231 (LPVOID
)&(lpnm
->lfCaptionFont
),0);
1232 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1233 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1234 (LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
1235 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1236 (LPVOID
)&(lpnm
->lfMenuFont
),0);
1237 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1238 (LPVOID
)&(lpnm
->lfStatusFont
),0);
1239 SystemParametersInfo16( SPI_GETICONTITLELOGFONT
, 0,
1240 (LPVOID
)&(lpnm
->lfMessageFont
),0);
1242 else /* winfile 95 sets sbSize to 340 */
1243 SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
1247 case SPI_LANGDRIVER
:
1249 case SPI_SETDOUBLECLKHEIGHT
:
1250 case SPI_SETDOUBLECLICKTIME
:
1251 case SPI_SETDOUBLECLKWIDTH
:
1252 case SPI_SETFASTTASKSWITCH
:
1253 case SPI_SETKEYBOARDDELAY
:
1254 case SPI_SETKEYBOARDSPEED
:
1255 WARN_(system
)("Option %d ignored.\n", uAction
);
1258 case SPI_GETWORKAREA
:
1259 SetRect16( (RECT16
*)lpvParam
, 0, 0,
1260 GetSystemMetrics16( SM_CXSCREEN
),
1261 GetSystemMetrics16( SM_CYSCREEN
) );
1265 WARN_(system
)("Unknown option %d.\n", uAction
);
1271 /***********************************************************************
1272 * SystemParametersInfo32W (USER32.541)
1274 BOOL WINAPI
SystemParametersInfoW( UINT uAction
, UINT uParam
,
1275 LPVOID lpvParam
, UINT fuWinIni
)
1281 case SPI_SETDESKWALLPAPER
:
1284 lstrcpynWtoA(buffer
,(LPWSTR
)lpvParam
,sizeof(buffer
));
1285 return SetDeskWallPaper(buffer
);
1287 return SetDeskWallPaper(NULL
);
1289 case SPI_SETDESKPATTERN
:
1290 if ((INT
) uParam
== -1)
1292 GetProfileStringA("Desktop", "Pattern",
1293 "170 85 170 85 170 85 170 85",
1294 buffer
, sizeof(buffer
) );
1295 return (DESKTOP_SetPattern((LPSTR
) buffer
));
1299 lstrcpynWtoA(buffer
,(LPWSTR
)lpvParam
,sizeof(buffer
));
1300 return DESKTOP_SetPattern(buffer
);
1302 return DESKTOP_SetPattern(NULL
);
1304 case SPI_GETICONTITLELOGFONT
:
1306 LPLOGFONTW lpLogFont
= (LPLOGFONTW
)lpvParam
;
1308 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1309 buffer
, sizeof(buffer
) );
1310 lstrcpynAtoW(lpLogFont
->lfFaceName
, buffer
, LF_FACESIZE
);
1311 lpLogFont
->lfHeight
= 17;
1312 lpLogFont
->lfWidth
= 0;
1313 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1314 lpLogFont
->lfWeight
= FW_NORMAL
;
1315 lpLogFont
->lfItalic
= lpLogFont
->lfStrikeOut
= lpLogFont
->lfUnderline
= FALSE
;
1316 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
1317 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1318 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1319 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
1322 case SPI_GETNONCLIENTMETRICS
: {
1323 /* FIXME: implement correctly */
1324 LPNONCLIENTMETRICSW lpnm
=(LPNONCLIENTMETRICSW
)lpvParam
;
1326 /* clear the struct, so we have 'sane' members */
1327 memset((char*)lpvParam
+sizeof(lpnm
->cbSize
),
1329 lpnm
->cbSize
-sizeof(lpnm
->cbSize
)
1331 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfCaptionFont
),0);
1332 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1333 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfSmCaptionFont
),0);
1334 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfMenuFont
),0);
1335 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfStatusFont
),0);
1336 SystemParametersInfoW(SPI_GETICONTITLELOGFONT
,0,(LPVOID
)&(lpnm
->lfMessageFont
),0);
1340 case SPI_GETHIGHCONTRAST
:
1342 LPHIGHCONTRASTW lpHighContrastW
= (LPHIGHCONTRASTW
)lpvParam
;
1344 FIXME_(system
)("SPI_GETHIGHCONTRAST not fully implemented\n");
1346 if ( lpHighContrastW
->cbSize
== sizeof( HIGHCONTRASTW
) )
1348 /* Indicate that there is no high contrast available */
1349 lpHighContrastW
->dwFlags
= 0;
1350 lpHighContrastW
->lpszDefaultScheme
= NULL
;
1361 return SystemParametersInfoA(uAction
,uParam
,lpvParam
,fuWinIni
);
1368 /***********************************************************************
1369 * FileCDR (KERNEL.130)
1371 FARPROC16 WINAPI
FileCDR16(FARPROC16 x
)
1373 FIXME_(file
)("(0x%8x): stub\n", (int) x
);
1374 return (FARPROC16
)TRUE
;