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"
34 #include "debugdefs.h"
44 #include "wine/winuser16.h"
46 /**********************************************************************/
48 USER_DRIVER *USER_Driver = NULL;
50 /* when adding new languages look at ole/ole2nls.c
51 * for proper iso name and Windows code (add 0x0400
52 * to the code listed there)
54 const WINE_LANGUAGE_DEF Languages[] =
56 {"En",0x0409}, /* LANG_En */
57 {"Es",0x040A}, /* LANG_Es */
58 {"De",0x0407}, /* LANG_De */
59 {"No",0x0414}, /* LANG_No */
60 {"Fr",0x040C}, /* LANG_Fr */
61 {"Fi",0x040B}, /* LANG_Fi */
62 {"Da",0x0406}, /* LANG_Da */
63 {"Cs",0x0405}, /* LANG_Cs */
64 {"Eo",0x048f}, /* LANG_Eo */
65 {"It",0x0410}, /* LANG_It */
66 {"Ko",0x0412}, /* LANG_Ko */
67 {"Hu",0x040e}, /* LANG_Hu */
68 {"Pl",0x0415}, /* LANG_Pl */
69 {"Pt",0x0416}, /* LANG_Pt */
70 {"Sv",0x041d}, /* LANG_Sv */
71 {"Ca",0x0403}, /* LANG_Ca */
72 {"Nl",0x0413}, /* LANG_Nl */
73 {"Ru",0x0419}, /* LANG_Ru */
74 {"Wa",0x0490}, /* LANG_Wa */
78 WORD WINE_LanguageId = 0x409; /* english as default */
80 struct options Options =
81 { /* default options */
84 NULL, /* desktopGeometry */
85 NULL, /* programName */
88 FALSE, /* usePrivateMap */
89 FALSE, /* useFixedMap */
90 FALSE, /* synchronous */
91 FALSE, /* backing store */
92 SW_SHOWNORMAL, /* cmdShow */
94 FALSE, /* failReadOnly */
95 MODE_ENHANCED, /* Enhanced mode */
97 DEFAULT_LANG, /* Default language */
101 FALSE, /* Managed windows */
102 FALSE, /* Perfect graphics */
104 NULL, /* Alternate config file name */
108 static char szUsage[] =
110 "Usage: %s [options] \"program_name [arguments]\"\n"
113 " -backingstore Turn on backing store\n"
114 " -config name Specify config file to use\n"
115 " -console driver Select which driver(s) to use for the console\n"
116 " -debug Enter debugger before starting application\n"
117 " -debugmsg name Turn debugging-messages on or off\n"
118 " -depth n Change the depth to use for multiple-depth screens\n"
119 " -desktop geom Use a desktop window of the given geometry\n"
120 " -display name Use the specified display\n"
121 " -dll name Enable or disable built-in DLLs\n"
122 " -failreadonly Read only files may not be opened in write mode\n"
123 " -fixedmap Use a \"standard\" color map\n"
124 " -help Show this help message\n"
125 " -iconic Start as an icon\n"
126 " -language xx Set the language (one of Ca,Cs,Da,De,En,Eo,Es,Fi,Fr,Hu,It,\n"
127 " Ko,Nl,No,Pl,Pt,Sv,Ru,Wa)\n"
128 " -managed Allow the window manager to manage created windows\n"
129 " -mode mode Start Wine in a particular mode (standard or enhanced)\n"
130 " -name name Set the application name\n"
131 " -nodga Disable XFree86 DGA extensions\n"
132 " -perfect Favor correctness over speed for graphical operations\n"
133 " -privatemap Use a private color map\n"
134 " -synchronous Turn on synchronous display mode\n"
135 " -version Display the Wine version\n"
136 " -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
137 " -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31\n"
140 /***********************************************************************
143 void MAIN_Usage( char *name )
145 MSG( szUsage, WINE_RELEASE_INFO, name );
149 /***********************************************************************
150 * MAIN_GetProgramName
152 * Get the program name. The name is specified by (in order of precedence):
153 * - the option '-name'.
154 * - the environment variable 'WINE_NAME'.
155 * - the last component of argv[0].
157 static char *MAIN_GetProgramName( int argc, char *argv[] )
162 for (i = 1; i < argc-1; i++)
163 if (!strcmp( argv[i], "-name" )) return argv[i+1];
164 if ((p = getenv( "WINE_NAME" )) != NULL) return p;
165 if ((p = strrchr( argv[0], '/' )) != NULL) return p+1;
169 /***********************************************************************
170 * MAIN_ParseDebugOptions
172 * Turns specific debug messages on or off, according to "options".
175 * TRUE if parsing was successful
177 BOOL MAIN_ParseDebugOptions(char *options)
179 /* defined in relay32/relay386.c */
180 extern char **debug_relay_includelist;
181 extern char **debug_relay_excludelist;
182 /* defined in relay32/snoop.c */
183 extern char **debug_snoop_includelist;
184 extern char **debug_snoop_excludelist;
187 int l, cls, dotracerelay = TRACE_ON(relay);
192 if (options[l-1]=='\n') options[l-1]='\0';
195 if ((*options!='+')&&(*options!='-')){
198 for(j=0; j<DEBUG_CLASS_COUNT; j++)
199 if(!lstrncmpiA(options, debug_cl_name[j], strlen(debug_cl_name[j])))
201 if(j==DEBUG_CLASS_COUNT)
203 options += strlen(debug_cl_name[j]);
204 if ((*options!='+')&&(*options!='-'))
209 cls = -1; /* all classes */
211 if (strchr(options,','))
212 l=strchr(options,',')-options;
216 if (!lstrncmpiA(options+1,"all",l-1))
219 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
220 for(j=0; j<DEBUG_CLASS_COUNT; j++)
221 if(cls == -1 || cls == j)
222 debug_msg_enabled[i][j]=(*options=='+');
224 else if (!lstrncmpiA(options+1, "relay=", 6) ||
225 !lstrncmpiA(options+1, "snoop=", 6))
228 char *s, *s2, ***output, c;
230 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
231 if (debug_ch_name && (!lstrncmpiA(debug_ch_name[i],options+1,5))){
232 for(j=0; j<DEBUG_CLASS_COUNT; j++)
233 if(cls == -1 || cls == j)
234 debug_msg_enabled[i][j]=TRUE;
237 /* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
238 if (i==DEBUG_CHANNEL_COUNT)
240 output = (*options == '+') ?
241 ((*(options+1) == 'r') ?
242 &debug_relay_includelist :
243 &debug_snoop_includelist) :
244 ((*(options+1) == 'r') ?
245 &debug_relay_excludelist :
246 &debug_snoop_excludelist);
249 while((s = strchr(s, ':'))) i++, s++;
250 *output = malloc(sizeof(char **) * i + 1);
253 while((s2 = strchr(s, ':'))) {
256 *((*output)+i) = strdup(s);
262 *(options + l) = '\0';
263 *((*output)+i) = strdup(s);
265 *((*output)+i+1) = NULL;
270 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
271 if (debug_ch_name && (!lstrncmpiA(options+1,debug_ch_name[i],l-1))){
272 for(j=0; j<DEBUG_CLASS_COUNT; j++)
273 if(cls == -1 || cls == j)
274 debug_msg_enabled[i][j]=(*options=='+');
277 if (i==DEBUG_CHANNEL_COUNT)
282 while((*options==',')&&(*(++options)));
284 /* special handling for relay debugging */
285 if (dotracerelay != TRACE_ON(relay))
286 BUILTIN32_SwitchRelayDebug( TRACE_ON(relay) );
292 MSG("%s: Syntax: -debugmsg [class]+xxx,... or "
293 "-debugmsg [class]-xxx,...\n",Options.argv[0]);
294 MSG("Example: -debugmsg +all,warn-heap\n"
295 " turn on all messages except warning heap messages\n");
296 MSG("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
297 " turn on -debugmsg +relay only as specified\n"
298 "Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
299 " turn on -debugmsg +relay except as specified\n"
300 "Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
302 MSG("Available message classes:\n");
303 for(i=0;i<DEBUG_CLASS_COUNT;i++)
304 MSG( "%-9s", debug_cl_name[i]);
307 MSG("Available message types:\n");
309 for(i=0;i<DEBUG_CHANNEL_COUNT;i++)
311 MSG("%-9s%c",debug_ch_name[i],
312 (((i+2)%8==0)?'\n':' '));
317 /***********************************************************************
321 * Lang: a string whose two first chars are the iso name of a language.
322 * Country: a string whose two first chars are the iso name of country
323 * Charset: a string defining the chossen charset encoding
324 * Dialect: a string defining a variation of the locale
326 * all those values are from the standardized format of locale
327 * name in unix which is: Lang[_Country][.Charset][@Dialect]
330 * the numeric code of the language used by Windows (or 0x00)
332 int MAIN_GetLanguageID(LPCSTR Lang,LPCSTR Country,LPCSTR Charset,LPCSTR Dialect)
334 char lang[3]="??", country[3]={0,0,0};
335 char *charset=NULL, *dialect=NULL;
338 if (Lang==NULL) return 0x00;
339 if (Lang[0]) lang[0]=tolower(Lang[0]);
340 if (Lang[1]) lang[1]=tolower(Lang[1]);
343 if (Country[0]) country[0]=toupper(Country[0]);
344 if (Country[1]) country[1]=toupper(Country[1]);
349 charset=(char*)malloc(j+1);
351 charset[i]=toupper(Charset[i]);
357 dialect=(char*)malloc(j+1);
359 dialect[i]=tolower(Dialect[i]);
366 #define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
369 goto end_MAIN_GetLanguageID; \
371 #define LANG_SUB_ENTRY(x,y,z) if (!strcmp(country, x )) \
372 ret = MAKELANGID( LANG_##y , SUBLANG_##z ); \
373 goto end_MAIN_GetLanguageID;
374 #define LANG_DIALECT_ENTRY(x,y) { ret = MAKELANGID(LANG_##x , SUBLANG_##y ); \
375 goto end_MAIN_GetLanguageID; }
376 #define LANG_ENTRY_END(x) ret = MAKELANGID(LANG_##x , SUBLANG_DEFAULT); \
377 goto end_MAIN_GetLanguageID; \
380 /*x01*/ LANG_ENTRY_BEGIN( "ar", ARABIC )
381 LANG_SUB_ENTRY( "SA", ARABIC, ARABIC)
382 LANG_SUB_ENTRY( "IQ", ARABIC, ARABIC_IRAQ )
383 LANG_SUB_ENTRY( "EG", ARABIC, ARABIC_EGYPT )
384 LANG_SUB_ENTRY( "LY", ARABIC, ARABIC_LIBYA )
385 LANG_SUB_ENTRY( "DZ", ARABIC, ARABIC_ALGERIA )
386 LANG_SUB_ENTRY( "MA", ARABIC, ARABIC_MOROCCO )
387 LANG_SUB_ENTRY( "TN", ARABIC, ARABIC_TUNISIA )
388 LANG_SUB_ENTRY( "OM", ARABIC, ARABIC_OMAN )
389 LANG_SUB_ENTRY( "YE", ARABIC, ARABIC_YEMEN )
390 LANG_SUB_ENTRY( "SY", ARABIC, ARABIC_SYRIA )
391 LANG_SUB_ENTRY( "JO", ARABIC, ARABIC_JORDAN )
392 LANG_SUB_ENTRY( "LB", ARABIC, ARABIC_LEBANON )
393 LANG_SUB_ENTRY( "KW", ARABIC, ARABIC_KUWAIT )
394 LANG_SUB_ENTRY( "AE", ARABIC, ARABIC_UAE )
395 LANG_SUB_ENTRY( "BH", ARABIC, ARABIC_BAHRAIN )
396 LANG_SUB_ENTRY( "QA", ARABIC, ARABIC_QATAR )
397 LANG_ENTRY_END( ARABIC )
398 /*x02*/ LANG_ENTRY_BEGIN( "bu", BULGARIAN )
399 LANG_ENTRY_END( BULGARIAN )
400 /*x03*/ LANG_ENTRY_BEGIN( "ca", CATALAN )
401 LANG_ENTRY_END( CATALAN )
402 /*x04*/ LANG_ENTRY_BEGIN( "zh", CHINESE )
403 LANG_SUB_ENTRY( "TW", CHINESE, CHINESE_TRADITIONAL )
404 LANG_SUB_ENTRY( "CN", CHINESE, CHINESE_SIMPLIFIED )
405 LANG_SUB_ENTRY( "HK", CHINESE, CHINESE_HONGKONG )
406 LANG_SUB_ENTRY( "SG", CHINESE, CHINESE_SINGAPORE )
407 LANG_SUB_ENTRY( "MO", CHINESE, CHINESE_MACAU )
408 LANG_ENTRY_END( CHINESE )
409 /*x05*/ LANG_ENTRY_BEGIN( "cs", CZECH )
410 LANG_ENTRY_END( CZECH )
411 /*x06*/ LANG_ENTRY_BEGIN( "da", DANISH )
412 LANG_ENTRY_END( DANISH )
413 /*x07*/ LANG_ENTRY_BEGIN( "de", GERMAN )
414 LANG_SUB_ENTRY( "DE", GERMAN, GERMAN )
415 LANG_SUB_ENTRY( "CH", GERMAN, GERMAN_SWISS )
416 LANG_SUB_ENTRY( "AT", GERMAN, GERMAN_AUSTRIAN )
417 LANG_SUB_ENTRY( "LU", GERMAN, GERMAN_LUXEMBOURG )
418 LANG_SUB_ENTRY( "LI", GERMAN, GERMAN_LIECHTENSTEIN )
419 LANG_ENTRY_END( GERMAN )
420 /*x08*/ LANG_ENTRY_BEGIN( "el", GREEK )
421 LANG_ENTRY_END( GREEK )
422 /*x09*/ LANG_ENTRY_BEGIN( "en", ENGLISH )
423 LANG_SUB_ENTRY( "US", ENGLISH, ENGLISH_US )
424 LANG_SUB_ENTRY( "UK", ENGLISH, ENGLISH_UK )
425 LANG_SUB_ENTRY( "AU", ENGLISH, ENGLISH_AUS )
426 LANG_SUB_ENTRY( "CA", ENGLISH, ENGLISH_CAN )
427 LANG_SUB_ENTRY( "NZ", ENGLISH, ENGLISH_NZ )
428 LANG_SUB_ENTRY( "EI", ENGLISH, ENGLISH_EIRE )
429 LANG_SUB_ENTRY( "ZA", ENGLISH, ENGLISH_SAFRICA )
430 LANG_SUB_ENTRY( "JM", ENGLISH, ENGLISH_JAMAICA )
431 /* LANG_SUB_ENTRY( "AG", ENGLISH, ENGLISH_CARIBBEAN ) */
432 LANG_SUB_ENTRY( "BZ", ENGLISH, ENGLISH_BELIZE )
433 LANG_SUB_ENTRY( "TT", ENGLISH, ENGLISH_TRINIDAD )
434 LANG_SUB_ENTRY( "ZW", ENGLISH, ENGLISH_ZIMBABWE )
435 LANG_SUB_ENTRY( "PH", ENGLISH, ENGLISH_PHILIPPINES )
436 LANG_ENTRY_END( ENGLISH )
437 /*x0a*/ LANG_ENTRY_BEGIN( "es", SPANISH )
438 /* traditional sorting */
439 if (!strcmp(dialect,"tradicional"))
440 LANG_DIALECT_ENTRY( SPANISH, SPANISH )
441 LANG_SUB_ENTRY( "MX", SPANISH, SPANISH_MEXICAN )
442 LANG_SUB_ENTRY( "ES", SPANISH, SPANISH_MODERN )
443 LANG_SUB_ENTRY( "GT", SPANISH, SPANISH_GUATEMALA )
444 LANG_SUB_ENTRY( "CR", SPANISH, SPANISH_COSTARICA )
445 LANG_SUB_ENTRY( "PA", SPANISH, SPANISH_PANAMA )
446 LANG_SUB_ENTRY( "DO", SPANISH, SPANISH_DOMINICAN )
447 LANG_SUB_ENTRY( "VE", SPANISH, SPANISH_VENEZUELA )
448 LANG_SUB_ENTRY( "CO", SPANISH, SPANISH_COLOMBIA )
449 LANG_SUB_ENTRY( "PE", SPANISH, SPANISH_PERU )
450 LANG_SUB_ENTRY( "AR", SPANISH, SPANISH_ARGENTINA )
451 LANG_SUB_ENTRY( "EC", SPANISH, SPANISH_ECUADOR )
452 LANG_SUB_ENTRY( "CL", SPANISH, SPANISH_CHILE )
453 LANG_SUB_ENTRY( "UY", SPANISH, SPANISH_URUGUAY )
454 LANG_SUB_ENTRY( "PY", SPANISH, SPANISH_PARAGUAY )
455 LANG_SUB_ENTRY( "BO", SPANISH, SPANISH_BOLIVIA )
456 LANG_SUB_ENTRY( "HN", SPANISH, SPANISH_HONDURAS )
457 LANG_SUB_ENTRY( "NI", SPANISH, SPANISH_NICARAGUA )
458 LANG_SUB_ENTRY( "PR", SPANISH, SPANISH_PUERTO_RICO )
459 LANG_ENTRY_END( SPANISH )
460 /*x0b*/ LANG_ENTRY_BEGIN( "fi", FINNISH )
461 LANG_ENTRY_END( FINNISH )
462 /*x0c*/ LANG_ENTRY_BEGIN( "fr", FRENCH )
463 LANG_SUB_ENTRY( "FR", FRENCH, FRENCH )
464 LANG_SUB_ENTRY( "BE", FRENCH, FRENCH_BELGIAN )
465 LANG_SUB_ENTRY( "CA", FRENCH, FRENCH_CANADIAN )
466 LANG_SUB_ENTRY( "CH", FRENCH, FRENCH_SWISS )
467 LANG_SUB_ENTRY( "LU", FRENCH, FRENCH_LUXEMBOURG )
468 LANG_SUB_ENTRY( "MC", FRENCH, FRENCH_MONACO )
469 LANG_ENTRY_END( FRENCH )
470 /*x0d*/ LANG_ENTRY_BEGIN( "iw", HEBREW )
471 LANG_ENTRY_END( HEBREW )
472 /*x0e*/ LANG_ENTRY_BEGIN( "hu", HUNGARIAN )
473 LANG_ENTRY_END( HUNGARIAN )
474 /*x0f*/ LANG_ENTRY_BEGIN( "ic", ICELANDIC )
475 LANG_ENTRY_END( ICELANDIC )
476 /*x10*/ LANG_ENTRY_BEGIN( "it", ITALIAN )
477 LANG_SUB_ENTRY( "IT", ITALIAN, ITALIAN )
478 LANG_SUB_ENTRY( "CH", ITALIAN, ITALIAN_SWISS )
479 LANG_ENTRY_END( ITALIAN )
480 /*x11*/ LANG_ENTRY_BEGIN( "ja", JAPANESE )
481 LANG_ENTRY_END( JAPANESE )
482 /*x12*/ LANG_ENTRY_BEGIN( "ko", KOREAN )
484 if (!strcmp(charset,"JOHAB"))
485 LANG_DIALECT_ENTRY( KOREAN, KOREAN_JOHAB )
487 LANG_DIALECT_ENTRY( KOREAN, KOREAN )
488 LANG_ENTRY_END( KOREAN )
489 /*x13*/ LANG_ENTRY_BEGIN( "nl", DUTCH )
490 LANG_SUB_ENTRY( "NL", DUTCH, DUTCH )
491 LANG_SUB_ENTRY( "BE", DUTCH, DUTCH_BELGIAN )
492 LANG_SUB_ENTRY( "SR", DUTCH, DUTCH_SURINAM )
493 LANG_ENTRY_END( DUTCH )
494 /*x14*/ LANG_ENTRY_BEGIN( "no", NORWEGIAN )
496 if (!strcmp(dialect,"nynorsk"))
497 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_NYNORSK )
499 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_BOKMAL )
500 LANG_ENTRY_END( NORWEGIAN )
501 /*x15*/ LANG_ENTRY_BEGIN( "pl", POLISH )
502 LANG_ENTRY_END( POLISH )
503 /*x16*/ LANG_ENTRY_BEGIN( "pt", PORTUGUESE )
504 LANG_SUB_ENTRY( "BR", PORTUGUESE, PORTUGUESE_BRAZILIAN )
505 LANG_SUB_ENTRY( "PT", PORTUGUESE, PORTUGUESE )
506 LANG_ENTRY_END( PORTUGUESE )
507 /*x17*/ LANG_ENTRY_BEGIN( "rm", RHAETO_ROMANCE )
508 LANG_ENTRY_END( RHAETO_ROMANCE )
509 /*x18*/ LANG_ENTRY_BEGIN( "ro", ROMANIAN )
510 LANG_SUB_ENTRY( "RO", ROMANIAN, ROMANIAN )
511 LANG_SUB_ENTRY( "MD", ROMANIAN, ROMANIAN_MOLDAVIA )
512 LANG_ENTRY_END( ROMANIAN )
513 /*x19*/ LANG_ENTRY_BEGIN( "ru", RUSSIAN )
514 LANG_SUB_ENTRY( "RU", RUSSIAN, RUSSIAN )
515 LANG_SUB_ENTRY( "MD", RUSSIAN, RUSSIAN_MOLDAVIA )
516 LANG_ENTRY_END( RUSSIAN )
517 /*x1a*/ if (!strcmp(lang,"sh") || !strcmp(lang,"hr") || !strcmp(lang,"sr")) {
519 LANG_DIALECT_ENTRY( SERBO_CROATIAN, NEUTRAL)
520 if (!strcmp(charset,"ISO-8859-5"))
521 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN )
522 LANG_SUB_ENTRY( "HR", SERBO_CROATIAN, CROATIAN )
523 if (!strcmp(country,"YU") && !strcmp(charset,"ISO-8859-2"))
524 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
525 LANG_SUB_ENTRY( "YU", SERBO_CROATIAN, SERBIAN )
526 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
528 /*x1b*/ LANG_ENTRY_BEGIN( "sk", SLOVAK )
529 LANG_ENTRY_END( SLOVAK )
530 /*x1c*/ LANG_ENTRY_BEGIN( "sq", ALBANIAN )
531 LANG_ENTRY_END( ALBANIAN )
532 /*x1d*/ LANG_ENTRY_BEGIN( "sv", SWEDISH )
533 LANG_SUB_ENTRY( "SE", SWEDISH, SWEDISH )
534 LANG_SUB_ENTRY( "FI", SWEDISH, SWEDISH_FINLAND )
535 LANG_ENTRY_END( SWEDISH )
536 /*x1e*/ LANG_ENTRY_BEGIN( "th", THAI )
537 LANG_ENTRY_END( THAI )
538 /*x1f*/ LANG_ENTRY_BEGIN( "tr", TURKISH )
539 LANG_ENTRY_END( TURKISH )
540 /*x20*/ LANG_ENTRY_BEGIN( "ur", URDU )
541 LANG_ENTRY_END( URDU )
542 /*x21*/ LANG_ENTRY_BEGIN( "in", INDONESIAN )
543 LANG_ENTRY_END( INDONESIAN )
544 /*x22*/ LANG_ENTRY_BEGIN( "uk", UKRAINIAN )
545 LANG_ENTRY_END( UKRAINIAN )
546 /*x23*/ LANG_ENTRY_BEGIN( "be", BYELORUSSIAN )
547 LANG_ENTRY_END( BYELORUSSIAN )
548 /*x24*/ LANG_ENTRY_BEGIN( "sl", SLOVENIAN )
549 LANG_ENTRY_END( SLOVENIAN )
550 /*x25*/ LANG_ENTRY_BEGIN( "et", ESTONIAN )
551 LANG_ENTRY_END( ESTONIAN )
552 /*x26*/ LANG_ENTRY_BEGIN( "lv", LATVIAN )
553 LANG_ENTRY_END( LATVIAN )
554 /*x27*/ LANG_ENTRY_BEGIN( "lt", LITHUANIAN )
555 /* traditional sorting ? */
556 if (!strcmp(dialect,"classic") || !strcmp(dialect,"traditional"))
557 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN_CLASSIC )
559 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN )
560 LANG_ENTRY_END( LITHUANIAN )
561 /*x28*/ LANG_ENTRY_BEGIN( "mi", MAORI )
562 LANG_ENTRY_END( MAORI )
563 /*x29*/ LANG_ENTRY_BEGIN( "fa", FARSI )
564 LANG_ENTRY_END( FARSI )
565 /*x2a*/ LANG_ENTRY_BEGIN( "vi", VIETNAMESE )
566 LANG_ENTRY_END( VIETNAMESE )
567 /*x2b*/ LANG_ENTRY_BEGIN( "hy", ARMENIAN )
568 LANG_ENTRY_END( ARMENIAN )
569 /*x2c*/ LANG_ENTRY_BEGIN( "az", AZERI )
571 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
572 LANG_DIALECT_ENTRY( AZERI, AZERI_CYRILLIC )
574 LANG_DIALECT_ENTRY( AZERI, AZERI )
575 LANG_ENTRY_END( AZERI )
576 /*x2d*/ LANG_ENTRY_BEGIN( "eu", BASQUE )
577 LANG_ENTRY_END( BASQUE )
578 /*x2e*/ /*LANG_ENTRY_BEGIN( "??", SORBIAN )
579 LANG_ENTRY_END( SORBIAN ) */
580 /*x2f*/ LANG_ENTRY_BEGIN( "mk", MACEDONIAN )
581 LANG_ENTRY_END( MACEDONIAN )
582 /*x30*/ /*LANG_ENTRY_BEGIN( "??", SUTU )
583 LANG_ENTRY_END( SUTU ) */
584 /*x31*/ LANG_ENTRY_BEGIN( "ts", TSONGA )
585 LANG_ENTRY_END( TSONGA )
586 /*x32*/ /*LANG_ENTRY_BEGIN( "??", TSWANA )
587 LANG_ENTRY_END( TSWANA ) */
588 /*x33*/ /*LANG_ENTRY_BEGIN( "??", VENDA )
589 LANG_ENTRY_END( VENDA ) */
590 /*x34*/ LANG_ENTRY_BEGIN( "xh", XHOSA )
591 LANG_ENTRY_END( XHOSA )
592 /*x35*/ LANG_ENTRY_BEGIN( "zu", ZULU )
593 LANG_ENTRY_END( ZULU )
594 /*x36*/ LANG_ENTRY_BEGIN( "af", AFRIKAANS )
595 LANG_ENTRY_END( AFRIKAANS )
596 /*x37*/ LANG_ENTRY_BEGIN( "ka", GEORGIAN )
597 LANG_ENTRY_END( GEORGIAN )
598 /*x38*/ LANG_ENTRY_BEGIN( "fo", FAEROESE )
599 LANG_ENTRY_END( FAEROESE )
600 /*x39*/ LANG_ENTRY_BEGIN( "hi", HINDI )
601 LANG_ENTRY_END( HINDI )
602 /*x3a*/ LANG_ENTRY_BEGIN( "mt", MALTESE )
603 LANG_ENTRY_END( MALTESE )
604 /*x3b*/ /*LANG_ENTRY_BEGIN( "??", SAAMI )
605 LANG_ENTRY_END( SAAMI ) */
606 /*x3c*/ LANG_ENTRY_BEGIN( "ga", GAELIC )
607 LANG_DIALECT_ENTRY( GAELIC, GAELIC )
608 LANG_ENTRY_END( GAELIC )
609 /*x3c*/ LANG_ENTRY_BEGIN( "gd", GAELIC )
610 LANG_DIALECT_ENTRY( GAELIC, GAELIC_SCOTTISH )
611 LANG_ENTRY_END( GAELIC )
613 /*x3e*/ LANG_ENTRY_BEGIN( "ms", MALAY )
614 LANG_SUB_ENTRY( "MY", MALAY, MALAY )
615 LANG_SUB_ENTRY( "BN", MALAY, MALAY_BRUNEI_DARUSSALAM )
616 LANG_ENTRY_END( MALAY )
617 /*x3f*/ LANG_ENTRY_BEGIN( "kk", KAZAKH )
618 LANG_ENTRY_END( KAZAKH )
620 /*x41*/ LANG_ENTRY_BEGIN( "sw", SWAHILI )
621 LANG_ENTRY_END( SWAHILI )
623 /*x43*/ LANG_ENTRY_BEGIN( "uz", UZBEK )
625 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
626 LANG_DIALECT_ENTRY( UZBEK, UZBEK_CYRILLIC )
628 LANG_DIALECT_ENTRY( UZBEK, UZBEK )
629 LANG_ENTRY_END( UZBEK )
630 /*x44*/ LANG_ENTRY_BEGIN( "tt", TATAR )
631 LANG_ENTRY_END( TATAR )
632 /*x45*/ LANG_ENTRY_BEGIN( "bn", BENGALI )
633 LANG_ENTRY_END( BENGALI )
634 /*x46*/ LANG_ENTRY_BEGIN( "pa", PUNJABI )
635 LANG_ENTRY_END( PUNJABI )
636 /*x47*/ LANG_ENTRY_BEGIN( "gu", GUJARATI )
637 LANG_ENTRY_END( GUJARATI )
638 /*x48*/ LANG_ENTRY_BEGIN( "or", ORIYA )
639 LANG_ENTRY_END( ORIYA )
640 /*x49*/ LANG_ENTRY_BEGIN( "ta", TAMIL )
641 LANG_ENTRY_END( TAMIL )
642 /*x4a*/ LANG_ENTRY_BEGIN( "te", TELUGU )
643 LANG_ENTRY_END( TELUGU )
644 /*x4b*/ LANG_ENTRY_BEGIN( "kn", KANNADA )
645 LANG_ENTRY_END( KANNADA )
646 /*x4c*/ LANG_ENTRY_BEGIN( "ml", MALAYALAM )
647 LANG_ENTRY_END( MALAYALAM )
648 /*x4d*/ LANG_ENTRY_BEGIN( "as", ASSAMESE )
649 LANG_ENTRY_END( ASSAMESE )
650 /*x4e*/ LANG_ENTRY_BEGIN( "mr", MARATHI )
651 LANG_ENTRY_END( MARATHI )
652 /*x4f*/ LANG_ENTRY_BEGIN( "sa", SANSKRIT )
653 LANG_ENTRY_END( SANSKRIT )
655 /*x57*/ /*LANG_ENTRY_BEGIN( "??", KONKANI )
656 LANG_ENTRY_END( KONKANI ) */
658 LANG_ENTRY_BEGIN( "eo", ESPERANTO ) /* not official */
659 LANG_ENTRY_END( ESPERANTO )
660 LANG_ENTRY_BEGIN( "wa", WALON ) /* not official */
661 LANG_ENTRY_END( WALON )
665 end_MAIN_GetLanguageID:
666 if (Charset) free(charset);
672 /***********************************************************************
673 * MAIN_ParseLanguageOption
675 * Parse -language option.
677 void MAIN_ParseLanguageOption( char *arg )
679 const WINE_LANGUAGE_DEF *p = Languages;
681 /* for compatibility whith non-iso names previously used */
682 if (!strcmp("Sw",arg)) { strcpy(arg,"Sv"); FIXME(system,"use 'Sv' instead of 'Sw'\n");}
683 if (!strcmp("Cz",arg)) { strcpy(arg,"Cs"); FIXME(system,"use 'Cs' instead of 'Cz'\n");}
684 if (!strcmp("Po",arg)) { strcpy(arg,"Pt"); FIXME(system,"use 'Pt' instead of 'Po'\n");}
686 Options.language = LANG_Xx; /* First (dummy) language */
689 if (!lstrcmpiA( p->name, arg ))
691 WINE_LanguageId = p->langid;
696 MSG( "Invalid language specified '%s'. Supported languages are: ", arg );
697 for (p = Languages; p->name; p++) MSG( "%s ", p->name );
703 /***********************************************************************
704 * MAIN_ParseModeOption
706 * Parse -mode option.
708 void MAIN_ParseModeOption( char *arg )
710 if (!lstrcmpiA("enhanced", arg)) Options.mode = MODE_ENHANCED;
711 else if (!lstrcmpiA("standard", arg)) Options.mode = MODE_STANDARD;
714 MSG( "Invalid mode '%s' specified.\n", arg);
715 MSG( "Valid modes are: 'standard', 'enhanced' (default).\n");
720 /***********************************************************************
723 * Parse command line options and open display.
725 static void MAIN_ParseOptions( int *argc, char *argv[] )
732 Options.programName = MAIN_GetProgramName( *argc, argv );
733 Options.argv0 = argv[0];
735 /* initialise Options.language to 0 to tell "no language choosen yet" */
736 Options.language = 0;
738 /* make sure there is no "." in Options.programName to confuse the X
739 resource database lookups */
740 if ((pcDot = strchr(Options.programName, '.'))) *pcDot = '\0';
742 for (i = 1; i < *argc; i++)
744 if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "-version" ))
746 MSG( "%s\n", WINE_RELEASE_INFO );
749 if (!strcmp( argv[i], "-h" ) || !strcmp( argv[i], "-help" ))
757 /***********************************************************************
760 static void called_at_exit(void)
763 GDI_Driver->pFinalize();
765 USER_Driver->pFinalize();
771 /***********************************************************************
774 * Wine initialisation and command-line parsing
776 BOOL MAIN_WineInit( int *argc, char *argv[] )
780 #ifdef MALLOC_DEBUGGING
784 if (!(trace = getenv("MALLOC_TRACE")))
786 MSG( "MALLOC_TRACE not set. No trace generated\n" );
790 MSG( "malloc trace goes to %s\n", trace );
798 setlocale(LC_CTYPE,"");
799 gettimeofday( &tv, NULL);
800 MSG_WineStartTicks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
802 MAIN_ParseOptions(argc, argv);
804 #ifndef X_DISPLAY_MISSING
805 USER_Driver = &X11DRV_USER_Driver;
806 #else /* !defined(X_DISPLAY_MISSING) */
807 USER_Driver = &TTYDRV_USER_Driver;
808 #endif /* !defined(X_DISPLAY_MISSING) */
810 USER_Driver->pInitialize();
812 MONITOR_Initialize(&MONITOR_PrimaryMonitor);
814 if (Options.dllFlags)
815 BUILTIN32_ParseDLLOptions( Options.dllFlags );
816 /* if (__winelib && errors ) print_error_message_like_misc_main(); */
818 atexit(called_at_exit);
822 /***********************************************************************
823 * MessageBeep16 (USER.104)
825 void WINAPI MessageBeep16( UINT16 i )
831 /***********************************************************************
832 * MessageBeep32 (USER32.390)
834 BOOL WINAPI MessageBeep( UINT i )
841 /***********************************************************************
844 BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
846 /* dwFreq and dwDur are ignored by Win95 */
852 /***********************************************************************
853 * GetTimerResolution (USER.14)
855 LONG WINAPI GetTimerResolution16(void)
860 /***********************************************************************
861 * SystemParametersInfo32A (USER32.540)
863 BOOL WINAPI SystemParametersInfoA( UINT uAction, UINT uParam,
864 LPVOID lpvParam, UINT fuWinIni )
870 *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
873 KEYBOARD_SetBeepActive(uParam);
877 *(INT *)lpvParam = GetSystemMetrics( SM_CXFRAME );
880 case SPI_GETDRAGFULLWINDOWS:
881 *(BOOL *) lpvParam = FALSE;
884 case SPI_SETDRAGFULLWINDOWS:
887 case SPI_GETFASTTASKSWITCH:
888 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
889 *(BOOL *) lpvParam = TRUE;
891 *(BOOL *) lpvParam = FALSE;
894 case SPI_GETGRIDGRANULARITY:
895 *(INT*)lpvParam=GetProfileIntA("desktop","GridGranularity",1);
898 case SPI_GETICONTITLEWRAP:
899 *(BOOL*)lpvParam=GetProfileIntA("desktop","IconTitleWrap",TRUE);
902 case SPI_GETKEYBOARDDELAY:
903 *(INT*)lpvParam=GetProfileIntA("keyboard","KeyboardDelay",1);
906 case SPI_GETKEYBOARDSPEED:
907 *(DWORD*)lpvParam=GetProfileIntA("keyboard","KeyboardSpeed",30);
910 case SPI_GETMENUDROPALIGNMENT:
911 *(BOOL*)lpvParam=GetSystemMetrics(SM_MENUDROPALIGNMENT); /* XXX check this */
914 case SPI_GETSCREENSAVEACTIVE:
915 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
916 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
917 *(BOOL*)lpvParam = TRUE;
919 *(BOOL*)lpvParam = FALSE;
922 case SPI_GETSCREENSAVETIMEOUT:
923 timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
925 timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
926 *(INT *) lpvParam = timeout * 1000;
929 case SPI_ICONHORIZONTALSPACING:
930 /* FIXME Get/SetProfileInt */
931 if (lpvParam == NULL)
932 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
934 *(INT*)lpvParam=GetSystemMetrics(SM_CXICONSPACING);
937 case SPI_ICONVERTICALSPACING:
938 /* FIXME Get/SetProfileInt */
939 if (lpvParam == NULL)
940 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
942 *(INT*)lpvParam=GetSystemMetrics(SM_CYICONSPACING);
945 case SPI_GETICONTITLELOGFONT: {
946 LPLOGFONTA lpLogFont = (LPLOGFONTA)lpvParam;
948 /* from now on we always have an alias for MS Sans Serif */
950 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
951 lpLogFont->lfFaceName, LF_FACESIZE );
952 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
953 lpLogFont->lfWidth = 0;
954 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
955 lpLogFont->lfWeight = FW_NORMAL;
956 lpLogFont->lfItalic = FALSE;
957 lpLogFont->lfStrikeOut = FALSE;
958 lpLogFont->lfUnderline = FALSE;
959 lpLogFont->lfCharSet = ANSI_CHARSET;
960 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
961 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
962 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
965 case SPI_GETWORKAREA:
966 SetRect( (RECT *)lpvParam, 0, 0,
967 GetSystemMetrics( SM_CXSCREEN ),
968 GetSystemMetrics( SM_CYSCREEN )
971 case SPI_GETNONCLIENTMETRICS:
973 #define lpnm ((LPNONCLIENTMETRICSA)lpvParam)
975 if( lpnm->cbSize == sizeof(NONCLIENTMETRICSA) )
977 /* FIXME: initialize geometry entries */
979 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
980 (LPVOID)&(lpnm->lfCaptionFont),0);
981 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
982 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
983 (LPVOID)&(lpnm->lfSmCaptionFont),0);
984 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
985 (LPVOID)&(lpnm->lfMenuFont),0);
986 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
987 (LPVOID)&(lpnm->lfStatusFont),0);
988 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
989 (LPVOID)&(lpnm->lfMessageFont),0);
994 case SPI_GETANIMATION: {
995 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
997 /* Tell it "disabled" */
998 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
999 uParam = sizeof(ANIMATIONINFO);
1000 lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1004 case SPI_SETANIMATION: {
1005 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
1008 WARN(system, "SPI_SETANIMATION ignored.\n");
1009 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
1010 uParam = sizeof(ANIMATIONINFO);
1014 case SPI_GETHIGHCONTRAST:
1016 LPHIGHCONTRASTA lpHighContrastA = (LPHIGHCONTRASTA)lpvParam;
1018 FIXME(system,"SPI_GETHIGHCONTRAST not fully implemented\n");
1020 if ( lpHighContrastA->cbSize == sizeof( HIGHCONTRASTA ) )
1022 /* Indicate that there is no high contrast available */
1023 lpHighContrastA->dwFlags = 0;
1024 lpHighContrastA->lpszDefaultScheme = NULL;
1035 return SystemParametersInfo16(uAction,uParam,lpvParam,fuWinIni);
1041 /***********************************************************************
1042 * SystemParametersInfo16 (USER.483)
1044 BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
1045 LPVOID lpvParam, UINT16 fuWinIni )
1053 *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
1057 *(INT16 *)lpvParam = GetSystemMetrics16( SM_CXFRAME );
1060 case SPI_GETFASTTASKSWITCH:
1061 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
1062 *(BOOL16 *) lpvParam = TRUE;
1064 *(BOOL16 *) lpvParam = FALSE;
1067 case SPI_GETGRIDGRANULARITY:
1068 *(INT16 *) lpvParam = GetProfileIntA( "desktop",
1073 case SPI_GETICONTITLEWRAP:
1074 *(BOOL16 *) lpvParam = GetProfileIntA( "desktop",
1079 case SPI_GETKEYBOARDDELAY:
1080 *(INT16 *) lpvParam = GetProfileIntA( "keyboard",
1081 "KeyboardDelay", 1 );
1084 case SPI_GETKEYBOARDSPEED:
1085 *(WORD *) lpvParam = GetProfileIntA( "keyboard",
1090 case SPI_GETMENUDROPALIGNMENT:
1091 *(BOOL16 *) lpvParam = GetSystemMetrics16( SM_MENUDROPALIGNMENT ); /* XXX check this */
1094 case SPI_GETSCREENSAVEACTIVE:
1095 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
1096 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
1097 *(BOOL16 *) lpvParam = TRUE;
1099 *(BOOL16 *) lpvParam = FALSE;
1102 case SPI_GETSCREENSAVETIMEOUT:
1103 timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
1105 timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
1106 *(INT16 *) lpvParam = timeout;
1109 case SPI_ICONHORIZONTALSPACING:
1110 /* FIXME Get/SetProfileInt */
1111 if (lpvParam == NULL)
1112 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
1114 *(INT16 *)lpvParam = GetSystemMetrics16( SM_CXICONSPACING );
1117 case SPI_ICONVERTICALSPACING:
1118 /* FIXME Get/SetProfileInt */
1119 if (lpvParam == NULL)
1120 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
1122 *(INT16 *)lpvParam = GetSystemMetrics16(SM_CYICONSPACING);
1126 KEYBOARD_SetBeepActive(uParam);
1129 case SPI_SETSCREENSAVEACTIVE:
1130 MONITOR_SetScreenSaveActive(&MONITOR_PrimaryMonitor, uParam);
1133 case SPI_SETSCREENSAVETIMEOUT:
1134 MONITOR_SetScreenSaveTimeout(&MONITOR_PrimaryMonitor, uParam);
1137 case SPI_SETDESKWALLPAPER:
1138 return (SetDeskWallPaper((LPSTR) lpvParam));
1141 case SPI_SETDESKPATTERN:
1142 if ((INT16)uParam == -1) {
1143 GetProfileStringA("Desktop", "Pattern",
1144 "170 85 170 85 170 85 170 85",
1145 buffer, sizeof(buffer) );
1146 return (DESKTOP_SetPattern((LPSTR) buffer));
1148 return (DESKTOP_SetPattern((LPSTR) lpvParam));
1151 case SPI_GETICONTITLELOGFONT:
1153 LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
1155 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1156 lpLogFont->lfFaceName, LF_FACESIZE );
1157 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
1158 lpLogFont->lfWidth = 0;
1159 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1160 lpLogFont->lfWeight = FW_NORMAL;
1161 lpLogFont->lfItalic = FALSE;
1162 lpLogFont->lfStrikeOut = FALSE;
1163 lpLogFont->lfUnderline = FALSE;
1164 lpLogFont->lfCharSet = ANSI_CHARSET;
1165 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1166 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1167 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1170 case SPI_GETNONCLIENTMETRICS:
1172 #define lpnm ((LPNONCLIENTMETRICS16)lpvParam)
1173 if( lpnm->cbSize == sizeof(NONCLIENTMETRICS16) )
1175 /* FIXME: initialize geometry entries */
1176 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1177 (LPVOID)&(lpnm->lfCaptionFont),0);
1178 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
1179 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1180 (LPVOID)&(lpnm->lfSmCaptionFont),0);
1181 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1182 (LPVOID)&(lpnm->lfMenuFont),0);
1183 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1184 (LPVOID)&(lpnm->lfStatusFont),0);
1185 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1186 (LPVOID)&(lpnm->lfMessageFont),0);
1188 else /* winfile 95 sets sbSize to 340 */
1189 SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
1193 case SPI_LANGDRIVER:
1195 case SPI_SETDOUBLECLKHEIGHT:
1196 case SPI_SETDOUBLECLICKTIME:
1197 case SPI_SETDOUBLECLKWIDTH:
1198 case SPI_SETFASTTASKSWITCH:
1199 case SPI_SETKEYBOARDDELAY:
1200 case SPI_SETKEYBOARDSPEED:
1201 WARN(system, "Option %d ignored.\n", uAction);
1204 case SPI_GETWORKAREA:
1205 SetRect16( (RECT16 *)lpvParam, 0, 0,
1206 GetSystemMetrics16( SM_CXSCREEN ),
1207 GetSystemMetrics16( SM_CYSCREEN ) );
1211 WARN(system, "Unknown option %d.\n", uAction);
1217 /***********************************************************************
1218 * SystemParametersInfo32W (USER32.541)
1220 BOOL WINAPI SystemParametersInfoW( UINT uAction, UINT uParam,
1221 LPVOID lpvParam, UINT fuWinIni )
1227 case SPI_SETDESKWALLPAPER:
1230 lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
1231 return SetDeskWallPaper(buffer);
1233 return SetDeskWallPaper(NULL);
1235 case SPI_SETDESKPATTERN:
1236 if ((INT) uParam == -1)
1238 GetProfileStringA("Desktop", "Pattern",
1239 "170 85 170 85 170 85 170 85",
1240 buffer, sizeof(buffer) );
1241 return (DESKTOP_SetPattern((LPSTR) buffer));
1245 lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
1246 return DESKTOP_SetPattern(buffer);
1248 return DESKTOP_SetPattern(NULL);
1250 case SPI_GETICONTITLELOGFONT:
1252 LPLOGFONTW lpLogFont = (LPLOGFONTW)lpvParam;
1253 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1254 buffer, sizeof(buffer) );
1255 lstrcpynAtoW(lpLogFont->lfFaceName, buffer ,LF_FACESIZE);
1256 lpLogFont->lfHeight = 10;
1257 lpLogFont->lfWidth = 0;
1258 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1259 lpLogFont->lfWeight = FW_NORMAL;
1260 lpLogFont->lfItalic = lpLogFont->lfStrikeOut = lpLogFont->lfUnderline = FALSE;
1261 lpLogFont->lfCharSet = ANSI_CHARSET;
1262 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1263 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1264 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1267 case SPI_GETNONCLIENTMETRICS: {
1268 /* FIXME: implement correctly */
1269 LPNONCLIENTMETRICSW lpnm=(LPNONCLIENTMETRICSW)lpvParam;
1271 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfCaptionFont),0);
1272 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
1273 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfSmCaptionFont),0);
1274 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMenuFont),0);
1275 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfStatusFont),0);
1276 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMessageFont),0);
1280 case SPI_GETHIGHCONTRAST:
1282 LPHIGHCONTRASTW lpHighContrastW = (LPHIGHCONTRASTW)lpvParam;
1284 FIXME(system,"SPI_GETHIGHCONTRAST not fully implemented\n");
1286 if ( lpHighContrastW->cbSize == sizeof( HIGHCONTRASTW ) )
1288 /* Indicate that there is no high contrast available */
1289 lpHighContrastW->dwFlags = 0;
1290 lpHighContrastW->lpszDefaultScheme = NULL;
1301 return SystemParametersInfoA(uAction,uParam,lpvParam,fuWinIni);
1308 /***********************************************************************
1309 * FileCDR (KERNEL.130)
1311 FARPROC16 WINAPI FileCDR16(FARPROC16 x)
1313 FIXME(file,"(0x%8x): stub\n", (int) x);
1314 return (FARPROC16)TRUE;