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"
44 #include "wine/winuser16.h"
47 /**********************************************************************/
49 USER_DRIVER *USER_Driver = NULL;
51 /* when adding new languages look at ole/ole2nls.c
52 * for proper iso name and Windows code (add 0x0400
53 * to the code listed there)
55 const WINE_LANGUAGE_DEF Languages[] =
57 {"En",0x0409}, /* LANG_En */
58 {"Es",0x040A}, /* LANG_Es */
59 {"De",0x0407}, /* LANG_De */
60 {"No",0x0414}, /* LANG_No */
61 {"Fr",0x040C}, /* LANG_Fr */
62 {"Fi",0x040B}, /* LANG_Fi */
63 {"Da",0x0406}, /* LANG_Da */
64 {"Cs",0x0405}, /* LANG_Cs */
65 {"Eo",0x048f}, /* LANG_Eo */
66 {"It",0x0410}, /* LANG_It */
67 {"Ko",0x0412}, /* LANG_Ko */
68 {"Hu",0x040e}, /* LANG_Hu */
69 {"Pl",0x0415}, /* LANG_Pl */
70 {"Pt",0x0416}, /* LANG_Pt */
71 {"Sv",0x041d}, /* LANG_Sv */
72 {"Ca",0x0403}, /* LANG_Ca */
73 {"Nl",0x0413}, /* LANG_Nl */
74 {"Ru",0x0419}, /* LANG_Ru */
75 {"Wa",0x0490}, /* LANG_Wa */
79 WORD WINE_LanguageId = 0x409; /* english as default */
81 struct options Options =
82 { /* default options */
85 NULL, /* desktopGeometry */
86 NULL, /* programName */
89 FALSE, /* usePrivateMap */
90 FALSE, /* useFixedMap */
91 FALSE, /* synchronous */
92 FALSE, /* backing store */
93 SW_SHOWNORMAL, /* cmdShow */
95 FALSE, /* failReadOnly */
96 MODE_ENHANCED, /* Enhanced mode */
98 DEFAULT_LANG, /* Default language */
102 FALSE, /* Managed windows */
103 FALSE, /* Perfect graphics */
106 NULL, /* Alternate config file name */
110 static char szUsage[] =
112 "Usage: %s [options] \"program_name [arguments]\"\n"
115 " -backingstore Turn on backing store\n"
116 " -config name Specify config file to use\n"
117 " -console driver Select which driver(s) to use for the console\n"
118 " -debug Enter debugger before starting application\n"
119 " -debugmsg name Turn debugging-messages on or off\n"
120 " -depth n Change the depth to use for multiple-depth screens\n"
121 " -desktop geom Use a desktop window of the given geometry\n"
122 " -display name Use the specified display\n"
123 " -dll name Enable or disable built-in DLLs\n"
124 " -failreadonly Read only files may not be opened in write mode\n"
125 " -fixedmap Use a \"standard\" color map\n"
126 " -help Show this help message\n"
127 " -iconic Start as an icon\n"
128 " -language xx Set the language (one of Ca,Cs,Da,De,En,Eo,Es,Fi,Fr,Hu,It,\n"
129 " Ko,Nl,No,Pl,Pt,Sv,Ru,Wa)\n"
130 " -managed Allow the window manager to manage created windows\n"
131 " -mode mode Start Wine in a particular mode (standard or enhanced)\n"
132 " -name name Set the application name\n"
133 " -nodga Disable XFree86 DGA extensions\n"
134 " -noxshm Disable XSHM extension\n"
135 " -perfect Favor correctness over speed for graphical operations\n"
136 " -privatemap Use a private color map\n"
137 " -synchronous Turn on synchronous display mode\n"
138 " -version Display the Wine version\n"
139 " -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
140 " -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31\n"
143 /***********************************************************************
146 void MAIN_Usage( char *name )
148 MESSAGE( szUsage, WINE_RELEASE_INFO, name );
152 /***********************************************************************
153 * MAIN_GetProgramName
155 * Get the program name. The name is specified by (in order of precedence):
156 * - the option '-name'.
157 * - the environment variable 'WINE_NAME'.
158 * - the last component of argv[0].
160 static char *MAIN_GetProgramName( int argc, char *argv[] )
165 for (i = 1; i < argc-1; i++)
166 if (!strcmp( argv[i], "-name" )) return argv[i+1];
167 if ((p = getenv( "WINE_NAME" )) != NULL) return p;
168 if ((p = strrchr( argv[0], '/' )) != NULL) return p+1;
172 /***********************************************************************
173 * MAIN_ParseDebugOptions
175 * Turns specific debug messages on or off, according to "options".
178 * TRUE if parsing was successful
180 BOOL MAIN_ParseDebugOptions(char *options)
182 /* defined in relay32/relay386.c */
183 extern char **debug_relay_includelist;
184 extern char **debug_relay_excludelist;
185 /* defined in relay32/snoop.c */
186 extern char **debug_snoop_includelist;
187 extern char **debug_snoop_excludelist;
190 int l, cls, dotracerelay = TRACE_ON(relay);
195 if (options[l-1]=='\n') options[l-1]='\0';
198 if ((*options!='+')&&(*options!='-')){
201 for(j=0; j<DEBUG_CLASS_COUNT; j++)
202 if(!lstrncmpiA(options, debug_cl_name[j], strlen(debug_cl_name[j])))
204 if(j==DEBUG_CLASS_COUNT)
206 options += strlen(debug_cl_name[j]);
207 if ((*options!='+')&&(*options!='-'))
212 cls = -1; /* all classes */
214 if (strchr(options,','))
215 l=strchr(options,',')-options;
219 if (!lstrncmpiA(options+1,"all",l-1))
222 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
223 for(j=0; j<DEBUG_CLASS_COUNT; j++)
224 if(cls == -1 || cls == j)
225 __SET_DEBUGGING( j, i, (*options=='+') );
227 else if (!lstrncmpiA(options+1, "relay=", 6) ||
228 !lstrncmpiA(options+1, "snoop=", 6))
231 char *s, *s2, ***output, c;
233 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
234 if (debug_ch_name && (!lstrncmpiA(debug_ch_name[i],options+1,5))){
235 for(j=0; j<DEBUG_CLASS_COUNT; j++)
236 if(cls == -1 || cls == j)
237 __SET_DEBUGGING( j, i, 1 );
240 /* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
241 if (i==DEBUG_CHANNEL_COUNT)
243 output = (*options == '+') ?
244 ((*(options+1) == 'r') ?
245 &debug_relay_includelist :
246 &debug_snoop_includelist) :
247 ((*(options+1) == 'r') ?
248 &debug_relay_excludelist :
249 &debug_snoop_excludelist);
251 /* if there are n ':', there are n+1 modules, and we need n+2 slots
252 * last one being for the sentinel (NULL) */
254 while((s = strchr(s, ':'))) i++, s++;
255 *output = malloc(sizeof(char **) * i);
258 while((s2 = strchr(s, ':'))) {
261 *((*output)+i) = CharUpperA(strdup(s));
267 *(options + l) = '\0';
268 *((*output)+i) = CharUpperA(strdup(s));
270 *((*output)+i+1) = NULL;
275 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
276 if (debug_ch_name && (!lstrncmpiA(options+1,debug_ch_name[i],l-1))){
277 for(j=0; j<DEBUG_CLASS_COUNT; j++)
278 if(cls == -1 || cls == j)
279 __SET_DEBUGGING( j, i, (*options=='+') );
282 if (i==DEBUG_CHANNEL_COUNT)
287 while((*options==',')&&(*(++options)));
289 /* special handling for relay debugging */
290 if (dotracerelay != TRACE_ON(relay))
291 BUILTIN32_SwitchRelayDebug( TRACE_ON(relay) );
297 MESSAGE("%s: Syntax: -debugmsg [class]+xxx,... or "
298 "-debugmsg [class]-xxx,...\n",Options.argv[0]);
299 MESSAGE("Example: -debugmsg +all,warn-heap\n"
300 " turn on all messages except warning heap messages\n");
301 MESSAGE("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
302 " turn on -debugmsg +relay only as specified\n"
303 "Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
304 " turn on -debugmsg +relay except as specified\n"
305 "Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
307 MESSAGE("Available message classes:\n");
308 for(i=0;i<DEBUG_CLASS_COUNT;i++)
309 MESSAGE( "%-9s", debug_cl_name[i]);
312 MESSAGE("Available message types:\n");
313 MESSAGE("%-9s ","all");
314 for(i=0;i<DEBUG_CHANNEL_COUNT;i++)
316 MESSAGE("%-9s%c",debug_ch_name[i],
317 (((i+2)%8==0)?'\n':' '));
323 /***********************************************************************
327 * Lang: a string whose two first chars are the iso name of a language.
328 * Country: a string whose two first chars are the iso name of country
329 * Charset: a string defining the chossen charset encoding
330 * Dialect: a string defining a variation of the locale
332 * all those values are from the standardized format of locale
333 * name in unix which is: Lang[_Country][.Charset][@Dialect]
336 * the numeric code of the language used by Windows (or 0x00)
338 int MAIN_GetLanguageID(LPCSTR Lang,LPCSTR Country,LPCSTR Charset,LPCSTR Dialect)
340 char lang[3]="??", country[3]={0,0,0};
341 char *charset=NULL, *dialect=NULL;
344 if (Lang==NULL) return 0x00;
345 if (Lang[0]) lang[0]=tolower(Lang[0]);
346 if (Lang[1]) lang[1]=tolower(Lang[1]);
349 if (Country[0]) country[0]=toupper(Country[0]);
350 if (Country[1]) country[1]=toupper(Country[1]);
355 charset=(char*)malloc(j+1);
357 charset[i]=toupper(Charset[i]);
363 dialect=(char*)malloc(j+1);
365 dialect[i]=tolower(Dialect[i]);
372 #define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
375 goto end_MAIN_GetLanguageID; \
377 #define LANG_SUB_ENTRY(x,y,z) if (!strcmp(country, x )) \
378 ret = MAKELANGID( LANG_##y , SUBLANG_##z ); \
379 goto end_MAIN_GetLanguageID;
380 #define LANG_DIALECT_ENTRY(x,y) { ret = MAKELANGID(LANG_##x , SUBLANG_##y ); \
381 goto end_MAIN_GetLanguageID; }
382 #define LANG_ENTRY_END(x) ret = MAKELANGID(LANG_##x , SUBLANG_DEFAULT); \
383 goto end_MAIN_GetLanguageID; \
386 /*x01*/ LANG_ENTRY_BEGIN( "ar", ARABIC )
387 LANG_SUB_ENTRY( "SA", ARABIC, ARABIC)
388 LANG_SUB_ENTRY( "IQ", ARABIC, ARABIC_IRAQ )
389 LANG_SUB_ENTRY( "EG", ARABIC, ARABIC_EGYPT )
390 LANG_SUB_ENTRY( "LY", ARABIC, ARABIC_LIBYA )
391 LANG_SUB_ENTRY( "DZ", ARABIC, ARABIC_ALGERIA )
392 LANG_SUB_ENTRY( "MA", ARABIC, ARABIC_MOROCCO )
393 LANG_SUB_ENTRY( "TN", ARABIC, ARABIC_TUNISIA )
394 LANG_SUB_ENTRY( "OM", ARABIC, ARABIC_OMAN )
395 LANG_SUB_ENTRY( "YE", ARABIC, ARABIC_YEMEN )
396 LANG_SUB_ENTRY( "SY", ARABIC, ARABIC_SYRIA )
397 LANG_SUB_ENTRY( "JO", ARABIC, ARABIC_JORDAN )
398 LANG_SUB_ENTRY( "LB", ARABIC, ARABIC_LEBANON )
399 LANG_SUB_ENTRY( "KW", ARABIC, ARABIC_KUWAIT )
400 LANG_SUB_ENTRY( "AE", ARABIC, ARABIC_UAE )
401 LANG_SUB_ENTRY( "BH", ARABIC, ARABIC_BAHRAIN )
402 LANG_SUB_ENTRY( "QA", ARABIC, ARABIC_QATAR )
403 LANG_ENTRY_END( ARABIC )
404 /*x02*/ LANG_ENTRY_BEGIN( "bu", BULGARIAN )
405 LANG_ENTRY_END( BULGARIAN )
406 /*x03*/ LANG_ENTRY_BEGIN( "ca", CATALAN )
407 LANG_ENTRY_END( CATALAN )
408 /*x04*/ LANG_ENTRY_BEGIN( "zh", CHINESE )
409 LANG_SUB_ENTRY( "TW", CHINESE, CHINESE_TRADITIONAL )
410 LANG_SUB_ENTRY( "CN", CHINESE, CHINESE_SIMPLIFIED )
411 LANG_SUB_ENTRY( "HK", CHINESE, CHINESE_HONGKONG )
412 LANG_SUB_ENTRY( "SG", CHINESE, CHINESE_SINGAPORE )
413 LANG_SUB_ENTRY( "MO", CHINESE, CHINESE_MACAU )
414 LANG_ENTRY_END( CHINESE )
415 /*x05*/ LANG_ENTRY_BEGIN( "cs", CZECH )
416 LANG_ENTRY_END( CZECH )
417 /*x06*/ LANG_ENTRY_BEGIN( "da", DANISH )
418 LANG_ENTRY_END( DANISH )
419 /*x07*/ LANG_ENTRY_BEGIN( "de", GERMAN )
420 LANG_SUB_ENTRY( "DE", GERMAN, GERMAN )
421 LANG_SUB_ENTRY( "CH", GERMAN, GERMAN_SWISS )
422 LANG_SUB_ENTRY( "AT", GERMAN, GERMAN_AUSTRIAN )
423 LANG_SUB_ENTRY( "LU", GERMAN, GERMAN_LUXEMBOURG )
424 LANG_SUB_ENTRY( "LI", GERMAN, GERMAN_LIECHTENSTEIN )
425 LANG_ENTRY_END( GERMAN )
426 /*x08*/ LANG_ENTRY_BEGIN( "el", GREEK )
427 LANG_ENTRY_END( GREEK )
428 /*x09*/ LANG_ENTRY_BEGIN( "en", ENGLISH )
429 LANG_SUB_ENTRY( "US", ENGLISH, ENGLISH_US )
430 LANG_SUB_ENTRY( "UK", ENGLISH, ENGLISH_UK )
431 LANG_SUB_ENTRY( "AU", ENGLISH, ENGLISH_AUS )
432 LANG_SUB_ENTRY( "CA", ENGLISH, ENGLISH_CAN )
433 LANG_SUB_ENTRY( "NZ", ENGLISH, ENGLISH_NZ )
434 LANG_SUB_ENTRY( "EI", ENGLISH, ENGLISH_EIRE )
435 LANG_SUB_ENTRY( "ZA", ENGLISH, ENGLISH_SAFRICA )
436 LANG_SUB_ENTRY( "JM", ENGLISH, ENGLISH_JAMAICA )
437 /* LANG_SUB_ENTRY( "AG", ENGLISH, ENGLISH_CARIBBEAN ) */
438 LANG_SUB_ENTRY( "BZ", ENGLISH, ENGLISH_BELIZE )
439 LANG_SUB_ENTRY( "TT", ENGLISH, ENGLISH_TRINIDAD )
440 LANG_SUB_ENTRY( "ZW", ENGLISH, ENGLISH_ZIMBABWE )
441 LANG_SUB_ENTRY( "PH", ENGLISH, ENGLISH_PHILIPPINES )
442 LANG_ENTRY_END( ENGLISH )
443 /*x0a*/ LANG_ENTRY_BEGIN( "es", SPANISH )
444 /* traditional sorting */
445 if (!strcmp(dialect,"tradicional"))
446 LANG_DIALECT_ENTRY( SPANISH, SPANISH )
447 LANG_SUB_ENTRY( "MX", SPANISH, SPANISH_MEXICAN )
448 LANG_SUB_ENTRY( "ES", SPANISH, SPANISH_MODERN )
449 LANG_SUB_ENTRY( "GT", SPANISH, SPANISH_GUATEMALA )
450 LANG_SUB_ENTRY( "CR", SPANISH, SPANISH_COSTARICA )
451 LANG_SUB_ENTRY( "PA", SPANISH, SPANISH_PANAMA )
452 LANG_SUB_ENTRY( "DO", SPANISH, SPANISH_DOMINICAN )
453 LANG_SUB_ENTRY( "VE", SPANISH, SPANISH_VENEZUELA )
454 LANG_SUB_ENTRY( "CO", SPANISH, SPANISH_COLOMBIA )
455 LANG_SUB_ENTRY( "PE", SPANISH, SPANISH_PERU )
456 LANG_SUB_ENTRY( "AR", SPANISH, SPANISH_ARGENTINA )
457 LANG_SUB_ENTRY( "EC", SPANISH, SPANISH_ECUADOR )
458 LANG_SUB_ENTRY( "CL", SPANISH, SPANISH_CHILE )
459 LANG_SUB_ENTRY( "UY", SPANISH, SPANISH_URUGUAY )
460 LANG_SUB_ENTRY( "PY", SPANISH, SPANISH_PARAGUAY )
461 LANG_SUB_ENTRY( "BO", SPANISH, SPANISH_BOLIVIA )
462 LANG_SUB_ENTRY( "HN", SPANISH, SPANISH_HONDURAS )
463 LANG_SUB_ENTRY( "NI", SPANISH, SPANISH_NICARAGUA )
464 LANG_SUB_ENTRY( "PR", SPANISH, SPANISH_PUERTO_RICO )
465 LANG_ENTRY_END( SPANISH )
466 /*x0b*/ LANG_ENTRY_BEGIN( "fi", FINNISH )
467 LANG_ENTRY_END( FINNISH )
468 /*x0c*/ LANG_ENTRY_BEGIN( "fr", FRENCH )
469 LANG_SUB_ENTRY( "FR", FRENCH, FRENCH )
470 LANG_SUB_ENTRY( "BE", FRENCH, FRENCH_BELGIAN )
471 LANG_SUB_ENTRY( "CA", FRENCH, FRENCH_CANADIAN )
472 LANG_SUB_ENTRY( "CH", FRENCH, FRENCH_SWISS )
473 LANG_SUB_ENTRY( "LU", FRENCH, FRENCH_LUXEMBOURG )
474 LANG_SUB_ENTRY( "MC", FRENCH, FRENCH_MONACO )
475 LANG_ENTRY_END( FRENCH )
476 /*x0d*/ LANG_ENTRY_BEGIN( "iw", HEBREW )
477 LANG_ENTRY_END( HEBREW )
478 /*x0e*/ LANG_ENTRY_BEGIN( "hu", HUNGARIAN )
479 LANG_ENTRY_END( HUNGARIAN )
480 /*x0f*/ LANG_ENTRY_BEGIN( "ic", ICELANDIC )
481 LANG_ENTRY_END( ICELANDIC )
482 /*x10*/ LANG_ENTRY_BEGIN( "it", ITALIAN )
483 LANG_SUB_ENTRY( "IT", ITALIAN, ITALIAN )
484 LANG_SUB_ENTRY( "CH", ITALIAN, ITALIAN_SWISS )
485 LANG_ENTRY_END( ITALIAN )
486 /*x11*/ LANG_ENTRY_BEGIN( "ja", JAPANESE )
487 LANG_ENTRY_END( JAPANESE )
488 /*x12*/ LANG_ENTRY_BEGIN( "ko", KOREAN )
490 if (!strcmp(charset,"JOHAB"))
491 LANG_DIALECT_ENTRY( KOREAN, KOREAN_JOHAB )
493 LANG_DIALECT_ENTRY( KOREAN, KOREAN )
494 LANG_ENTRY_END( KOREAN )
495 /*x13*/ LANG_ENTRY_BEGIN( "nl", DUTCH )
496 LANG_SUB_ENTRY( "NL", DUTCH, DUTCH )
497 LANG_SUB_ENTRY( "BE", DUTCH, DUTCH_BELGIAN )
498 LANG_SUB_ENTRY( "SR", DUTCH, DUTCH_SURINAM )
499 LANG_ENTRY_END( DUTCH )
500 /*x14*/ LANG_ENTRY_BEGIN( "no", NORWEGIAN )
502 if (!strcmp(dialect,"nynorsk"))
503 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_NYNORSK )
505 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_BOKMAL )
506 LANG_ENTRY_END( NORWEGIAN )
507 /*x15*/ LANG_ENTRY_BEGIN( "pl", POLISH )
508 LANG_ENTRY_END( POLISH )
509 /*x16*/ LANG_ENTRY_BEGIN( "pt", PORTUGUESE )
510 LANG_SUB_ENTRY( "BR", PORTUGUESE, PORTUGUESE_BRAZILIAN )
511 LANG_SUB_ENTRY( "PT", PORTUGUESE, PORTUGUESE )
512 LANG_ENTRY_END( PORTUGUESE )
513 /*x17*/ LANG_ENTRY_BEGIN( "rm", RHAETO_ROMANCE )
514 LANG_ENTRY_END( RHAETO_ROMANCE )
515 /*x18*/ LANG_ENTRY_BEGIN( "ro", ROMANIAN )
516 LANG_SUB_ENTRY( "RO", ROMANIAN, ROMANIAN )
517 LANG_SUB_ENTRY( "MD", ROMANIAN, ROMANIAN_MOLDAVIA )
518 LANG_ENTRY_END( ROMANIAN )
519 /*x19*/ LANG_ENTRY_BEGIN( "ru", RUSSIAN )
520 LANG_SUB_ENTRY( "RU", RUSSIAN, RUSSIAN )
521 LANG_SUB_ENTRY( "MD", RUSSIAN, RUSSIAN_MOLDAVIA )
522 LANG_ENTRY_END( RUSSIAN )
523 /*x1a*/ if (!strcmp(lang,"sh") || !strcmp(lang,"hr") || !strcmp(lang,"sr")) {
525 LANG_DIALECT_ENTRY( SERBO_CROATIAN, NEUTRAL)
526 if (!strcmp(charset,"ISO-8859-5"))
527 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN )
528 LANG_SUB_ENTRY( "HR", SERBO_CROATIAN, CROATIAN )
529 if (!strcmp(country,"YU") && !strcmp(charset,"ISO-8859-2"))
530 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
531 LANG_SUB_ENTRY( "YU", SERBO_CROATIAN, SERBIAN )
532 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
534 /*x1b*/ LANG_ENTRY_BEGIN( "sk", SLOVAK )
535 LANG_ENTRY_END( SLOVAK )
536 /*x1c*/ LANG_ENTRY_BEGIN( "sq", ALBANIAN )
537 LANG_ENTRY_END( ALBANIAN )
538 /*x1d*/ LANG_ENTRY_BEGIN( "sv", SWEDISH )
539 LANG_SUB_ENTRY( "SE", SWEDISH, SWEDISH )
540 LANG_SUB_ENTRY( "FI", SWEDISH, SWEDISH_FINLAND )
541 LANG_ENTRY_END( SWEDISH )
542 /*x1e*/ LANG_ENTRY_BEGIN( "th", THAI )
543 LANG_ENTRY_END( THAI )
544 /*x1f*/ LANG_ENTRY_BEGIN( "tr", TURKISH )
545 LANG_ENTRY_END( TURKISH )
546 /*x20*/ LANG_ENTRY_BEGIN( "ur", URDU )
547 LANG_ENTRY_END( URDU )
548 /*x21*/ LANG_ENTRY_BEGIN( "in", INDONESIAN )
549 LANG_ENTRY_END( INDONESIAN )
550 /*x22*/ LANG_ENTRY_BEGIN( "uk", UKRAINIAN )
551 LANG_ENTRY_END( UKRAINIAN )
552 /*x23*/ LANG_ENTRY_BEGIN( "be", BYELORUSSIAN )
553 LANG_ENTRY_END( BYELORUSSIAN )
554 /*x24*/ LANG_ENTRY_BEGIN( "sl", SLOVENIAN )
555 LANG_ENTRY_END( SLOVENIAN )
556 /*x25*/ LANG_ENTRY_BEGIN( "et", ESTONIAN )
557 LANG_ENTRY_END( ESTONIAN )
558 /*x26*/ LANG_ENTRY_BEGIN( "lv", LATVIAN )
559 LANG_ENTRY_END( LATVIAN )
560 /*x27*/ LANG_ENTRY_BEGIN( "lt", LITHUANIAN )
561 /* traditional sorting ? */
562 if (!strcmp(dialect,"classic") || !strcmp(dialect,"traditional"))
563 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN_CLASSIC )
565 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN )
566 LANG_ENTRY_END( LITHUANIAN )
567 /*x28*/ LANG_ENTRY_BEGIN( "mi", MAORI )
568 LANG_ENTRY_END( MAORI )
569 /*x29*/ LANG_ENTRY_BEGIN( "fa", FARSI )
570 LANG_ENTRY_END( FARSI )
571 /*x2a*/ LANG_ENTRY_BEGIN( "vi", VIETNAMESE )
572 LANG_ENTRY_END( VIETNAMESE )
573 /*x2b*/ LANG_ENTRY_BEGIN( "hy", ARMENIAN )
574 LANG_ENTRY_END( ARMENIAN )
575 /*x2c*/ LANG_ENTRY_BEGIN( "az", AZERI )
577 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
578 LANG_DIALECT_ENTRY( AZERI, AZERI_CYRILLIC )
580 LANG_DIALECT_ENTRY( AZERI, AZERI )
581 LANG_ENTRY_END( AZERI )
582 /*x2d*/ LANG_ENTRY_BEGIN( "eu", BASQUE )
583 LANG_ENTRY_END( BASQUE )
584 /*x2e*/ /*LANG_ENTRY_BEGIN( "??", SORBIAN )
585 LANG_ENTRY_END( SORBIAN ) */
586 /*x2f*/ LANG_ENTRY_BEGIN( "mk", MACEDONIAN )
587 LANG_ENTRY_END( MACEDONIAN )
588 /*x30*/ /*LANG_ENTRY_BEGIN( "??", SUTU )
589 LANG_ENTRY_END( SUTU ) */
590 /*x31*/ LANG_ENTRY_BEGIN( "ts", TSONGA )
591 LANG_ENTRY_END( TSONGA )
592 /*x32*/ /*LANG_ENTRY_BEGIN( "??", TSWANA )
593 LANG_ENTRY_END( TSWANA ) */
594 /*x33*/ /*LANG_ENTRY_BEGIN( "??", VENDA )
595 LANG_ENTRY_END( VENDA ) */
596 /*x34*/ LANG_ENTRY_BEGIN( "xh", XHOSA )
597 LANG_ENTRY_END( XHOSA )
598 /*x35*/ LANG_ENTRY_BEGIN( "zu", ZULU )
599 LANG_ENTRY_END( ZULU )
600 /*x36*/ LANG_ENTRY_BEGIN( "af", AFRIKAANS )
601 LANG_ENTRY_END( AFRIKAANS )
602 /*x37*/ LANG_ENTRY_BEGIN( "ka", GEORGIAN )
603 LANG_ENTRY_END( GEORGIAN )
604 /*x38*/ LANG_ENTRY_BEGIN( "fo", FAEROESE )
605 LANG_ENTRY_END( FAEROESE )
606 /*x39*/ LANG_ENTRY_BEGIN( "hi", HINDI )
607 LANG_ENTRY_END( HINDI )
608 /*x3a*/ LANG_ENTRY_BEGIN( "mt", MALTESE )
609 LANG_ENTRY_END( MALTESE )
610 /*x3b*/ /*LANG_ENTRY_BEGIN( "??", SAAMI )
611 LANG_ENTRY_END( SAAMI ) */
612 /*x3c*/ LANG_ENTRY_BEGIN( "ga", GAELIC )
613 LANG_DIALECT_ENTRY( GAELIC, GAELIC )
614 LANG_ENTRY_END( GAELIC )
615 /*x3c*/ LANG_ENTRY_BEGIN( "gd", GAELIC )
616 LANG_DIALECT_ENTRY( GAELIC, GAELIC_SCOTTISH )
617 LANG_ENTRY_END( GAELIC )
619 /*x3e*/ LANG_ENTRY_BEGIN( "ms", MALAY )
620 LANG_SUB_ENTRY( "MY", MALAY, MALAY )
621 LANG_SUB_ENTRY( "BN", MALAY, MALAY_BRUNEI_DARUSSALAM )
622 LANG_ENTRY_END( MALAY )
623 /*x3f*/ LANG_ENTRY_BEGIN( "kk", KAZAKH )
624 LANG_ENTRY_END( KAZAKH )
626 /*x41*/ LANG_ENTRY_BEGIN( "sw", SWAHILI )
627 LANG_ENTRY_END( SWAHILI )
629 /*x43*/ LANG_ENTRY_BEGIN( "uz", UZBEK )
631 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
632 LANG_DIALECT_ENTRY( UZBEK, UZBEK_CYRILLIC )
634 LANG_DIALECT_ENTRY( UZBEK, UZBEK )
635 LANG_ENTRY_END( UZBEK )
636 /*x44*/ LANG_ENTRY_BEGIN( "tt", TATAR )
637 LANG_ENTRY_END( TATAR )
638 /*x45*/ LANG_ENTRY_BEGIN( "bn", BENGALI )
639 LANG_ENTRY_END( BENGALI )
640 /*x46*/ LANG_ENTRY_BEGIN( "pa", PUNJABI )
641 LANG_ENTRY_END( PUNJABI )
642 /*x47*/ LANG_ENTRY_BEGIN( "gu", GUJARATI )
643 LANG_ENTRY_END( GUJARATI )
644 /*x48*/ LANG_ENTRY_BEGIN( "or", ORIYA )
645 LANG_ENTRY_END( ORIYA )
646 /*x49*/ LANG_ENTRY_BEGIN( "ta", TAMIL )
647 LANG_ENTRY_END( TAMIL )
648 /*x4a*/ LANG_ENTRY_BEGIN( "te", TELUGU )
649 LANG_ENTRY_END( TELUGU )
650 /*x4b*/ LANG_ENTRY_BEGIN( "kn", KANNADA )
651 LANG_ENTRY_END( KANNADA )
652 /*x4c*/ LANG_ENTRY_BEGIN( "ml", MALAYALAM )
653 LANG_ENTRY_END( MALAYALAM )
654 /*x4d*/ LANG_ENTRY_BEGIN( "as", ASSAMESE )
655 LANG_ENTRY_END( ASSAMESE )
656 /*x4e*/ LANG_ENTRY_BEGIN( "mr", MARATHI )
657 LANG_ENTRY_END( MARATHI )
658 /*x4f*/ LANG_ENTRY_BEGIN( "sa", SANSKRIT )
659 LANG_ENTRY_END( SANSKRIT )
661 /*x57*/ /*LANG_ENTRY_BEGIN( "??", KONKANI )
662 LANG_ENTRY_END( KONKANI ) */
664 LANG_ENTRY_BEGIN( "eo", ESPERANTO ) /* not official */
665 LANG_ENTRY_END( ESPERANTO )
666 LANG_ENTRY_BEGIN( "wa", WALON ) /* not official */
667 LANG_ENTRY_END( WALON )
671 end_MAIN_GetLanguageID:
672 if (Charset) free(charset);
678 /***********************************************************************
679 * MAIN_ParseLanguageOption
681 * Parse -language option.
683 void MAIN_ParseLanguageOption( char *arg )
685 const WINE_LANGUAGE_DEF *p = Languages;
687 /* for compatibility whith non-iso names previously used */
688 if (!strcmp("Sw",arg)) { strcpy(arg,"Sv"); FIXME_(system)("use 'Sv' instead of 'Sw'\n");}
689 if (!strcmp("Cz",arg)) { strcpy(arg,"Cs"); FIXME_(system)("use 'Cs' instead of 'Cz'\n");}
690 if (!strcmp("Po",arg)) { strcpy(arg,"Pt"); FIXME_(system)("use 'Pt' instead of 'Po'\n");}
692 Options.language = LANG_Xx; /* First (dummy) language */
695 if (!lstrcmpiA( p->name, arg ))
697 WINE_LanguageId = p->langid;
702 MESSAGE( "Invalid language specified '%s'. Supported languages are: ", arg );
703 for (p = Languages; p->name; p++) MESSAGE( "%s ", p->name );
709 /***********************************************************************
710 * MAIN_ParseModeOption
712 * Parse -mode option.
714 void MAIN_ParseModeOption( char *arg )
716 if (!lstrcmpiA("enhanced", arg)) Options.mode = MODE_ENHANCED;
717 else if (!lstrcmpiA("standard", arg)) Options.mode = MODE_STANDARD;
720 MESSAGE( "Invalid mode '%s' specified.\n", arg);
721 MESSAGE( "Valid modes are: 'standard', 'enhanced' (default).\n");
726 /***********************************************************************
729 * Parse command line options and open display.
731 static void MAIN_ParseOptions( int *argc, char *argv[] )
738 Options.programName = MAIN_GetProgramName( *argc, argv );
739 Options.argv0 = argv[0];
741 /* initialise Options.language to 0 to tell "no language choosen yet" */
742 Options.language = 0;
744 /* make sure there is no "." in Options.programName to confuse the X
745 resource database lookups */
746 if ((pcDot = strchr(Options.programName, '.'))) *pcDot = '\0';
748 for (i = 1; i < *argc; i++)
750 if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "-version" ))
752 MESSAGE( "%s\n", WINE_RELEASE_INFO );
755 if (!strcmp( argv[i], "-h" ) || !strcmp( argv[i], "-help" ))
763 /***********************************************************************
766 static void called_at_exit(void)
769 GDI_Driver->pFinalize();
771 USER_Driver->pFinalize();
777 /***********************************************************************
780 * Wine initialisation and command-line parsing
782 BOOL MAIN_WineInit( int *argc, char *argv[] )
786 #ifdef MALLOC_DEBUGGING
790 if (!(trace = getenv("MALLOC_TRACE")))
792 MESSAGE( "MALLOC_TRACE not set. No trace generated\n" );
796 MESSAGE( "malloc trace goes to %s\n", trace );
804 setlocale(LC_CTYPE,"");
805 gettimeofday( &tv, NULL);
806 MSG_WineStartTicks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
808 MAIN_ParseOptions(argc, argv);
810 #ifndef X_DISPLAY_MISSING
811 USER_Driver = &X11DRV_USER_Driver;
812 #else /* !defined(X_DISPLAY_MISSING) */
813 USER_Driver = &TTYDRV_USER_Driver;
814 #endif /* !defined(X_DISPLAY_MISSING) */
816 USER_Driver->pInitialize();
818 MONITOR_Initialize(&MONITOR_PrimaryMonitor);
820 atexit(called_at_exit);
824 /***********************************************************************
825 * MessageBeep16 (USER.104)
827 void WINAPI MessageBeep16( UINT16 i )
833 /***********************************************************************
834 * MessageBeep32 (USER32.390)
836 BOOL WINAPI MessageBeep( UINT i )
843 /***********************************************************************
846 BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
848 /* dwFreq and dwDur are ignored by Win95 */
854 /***********************************************************************
855 * GetTimerResolution (USER.14)
857 LONG WINAPI GetTimerResolution16(void)
862 /***********************************************************************
863 * SystemParametersInfo32A (USER32.540)
865 BOOL WINAPI SystemParametersInfoA( UINT uAction, UINT uParam,
866 LPVOID lpvParam, UINT fuWinIni )
872 *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
875 KEYBOARD_SetBeepActive(uParam);
879 *(INT *)lpvParam = GetSystemMetrics( SM_CXFRAME );
882 case SPI_GETDRAGFULLWINDOWS:
883 *(BOOL *) lpvParam = FALSE;
886 case SPI_SETDRAGFULLWINDOWS:
889 case SPI_GETFASTTASKSWITCH:
890 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
891 *(BOOL *) lpvParam = TRUE;
893 *(BOOL *) lpvParam = FALSE;
896 case SPI_GETGRIDGRANULARITY:
897 *(INT*)lpvParam=GetProfileIntA("desktop","GridGranularity",1);
900 case SPI_GETICONTITLEWRAP:
901 *(BOOL*)lpvParam=GetProfileIntA("desktop","IconTitleWrap",TRUE);
904 case SPI_GETKEYBOARDDELAY:
905 *(INT*)lpvParam=GetProfileIntA("keyboard","KeyboardDelay",1);
908 case SPI_GETKEYBOARDSPEED:
909 *(DWORD*)lpvParam=GetProfileIntA("keyboard","KeyboardSpeed",30);
912 case SPI_GETMENUDROPALIGNMENT:
913 *(BOOL*)lpvParam=GetSystemMetrics(SM_MENUDROPALIGNMENT); /* XXX check this */
916 case SPI_GETSCREENSAVEACTIVE:
917 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
918 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
919 *(BOOL*)lpvParam = TRUE;
921 *(BOOL*)lpvParam = FALSE;
924 case SPI_GETSCREENSAVETIMEOUT:
925 timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
927 timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
928 *(INT *) lpvParam = timeout * 1000;
931 case SPI_ICONHORIZONTALSPACING:
932 /* FIXME Get/SetProfileInt */
933 if (lpvParam == NULL)
934 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
936 *(INT*)lpvParam=GetSystemMetrics(SM_CXICONSPACING);
939 case SPI_ICONVERTICALSPACING:
940 /* FIXME Get/SetProfileInt */
941 if (lpvParam == NULL)
942 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
944 *(INT*)lpvParam=GetSystemMetrics(SM_CYICONSPACING);
947 case SPI_GETICONTITLELOGFONT: {
948 LPLOGFONTA lpLogFont = (LPLOGFONTA)lpvParam;
950 /* from now on we always have an alias for MS Sans Serif */
952 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
953 lpLogFont->lfFaceName, LF_FACESIZE );
954 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
955 lpLogFont->lfWidth = 0;
956 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
957 lpLogFont->lfWeight = FW_NORMAL;
958 lpLogFont->lfItalic = FALSE;
959 lpLogFont->lfStrikeOut = FALSE;
960 lpLogFont->lfUnderline = FALSE;
961 lpLogFont->lfCharSet = ANSI_CHARSET;
962 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
963 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
964 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
967 case SPI_GETWORKAREA:
968 SetRect( (RECT *)lpvParam, 0, 0,
969 GetSystemMetrics( SM_CXSCREEN ),
970 GetSystemMetrics( SM_CYSCREEN )
973 case SPI_GETNONCLIENTMETRICS:
975 #define lpnm ((LPNONCLIENTMETRICSA)lpvParam)
977 if( lpnm->cbSize == sizeof(NONCLIENTMETRICSA) )
978 { LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont);
980 /* FIXME: initialize geometry entries */
982 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
983 (LPVOID)&(lpnm->lfCaptionFont),0);
986 lpnm->iCaptionWidth = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 12;
987 lpnm->iCaptionHeight = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 12;
988 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfSmCaptionFont),0);
989 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
992 lpnm->iCaptionWidth = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 10;
993 lpnm->iCaptionHeight = (TWEAK_WineLook > WIN31_LOOK) ? 19 : 10;
995 /* menus, FIXME: names of wine.conf entrys are bogus */
997 lpnm->iMenuWidth = GetProfileIntA("Desktop","MenuWidth", 8); /* size of the menu buttons*/
998 lpnm->iMenuHeight = GetProfileIntA("Desktop","MenuHeight",
999 (TWEAK_WineLook > WIN31_LOOK) ? 8 : 16);
1001 GetProfileStringA("Desktop", "MenuFont",
1002 (TWEAK_WineLook > WIN31_LOOK) ? "MS Sans Serif": "System",
1003 lpLogFont->lfFaceName, LF_FACESIZE );
1005 lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 8);
1006 lpLogFont->lfWidth = 0;
1007 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1008 lpLogFont->lfWeight = (TWEAK_WineLook > WIN31_LOOK) ? FW_NORMAL : FW_BOLD;
1009 lpLogFont->lfItalic = FALSE;
1010 lpLogFont->lfStrikeOut = FALSE;
1011 lpLogFont->lfUnderline = FALSE;
1012 lpLogFont->lfCharSet = ANSI_CHARSET;
1013 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1014 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1015 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1017 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
1018 (LPVOID)&(lpnm->lfStatusFont),0);
1019 SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
1020 (LPVOID)&(lpnm->lfMessageFont),0);
1025 case SPI_GETANIMATION: {
1026 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
1028 /* Tell it "disabled" */
1029 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
1030 uParam = sizeof(ANIMATIONINFO);
1031 lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1035 case SPI_SETANIMATION: {
1036 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
1039 WARN_(system)("SPI_SETANIMATION ignored.\n");
1040 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
1041 uParam = sizeof(ANIMATIONINFO);
1045 case SPI_GETHIGHCONTRAST:
1047 LPHIGHCONTRASTA lpHighContrastA = (LPHIGHCONTRASTA)lpvParam;
1049 FIXME_(system)("SPI_GETHIGHCONTRAST not fully implemented\n");
1051 if ( lpHighContrastA->cbSize == sizeof( HIGHCONTRASTA ) )
1053 /* Indicate that there is no high contrast available */
1054 lpHighContrastA->dwFlags = 0;
1055 lpHighContrastA->lpszDefaultScheme = NULL;
1066 return SystemParametersInfo16(uAction,uParam,lpvParam,fuWinIni);
1072 /***********************************************************************
1073 * SystemParametersInfo16 (USER.483)
1075 BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
1076 LPVOID lpvParam, UINT16 fuWinIni )
1084 *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
1088 *(INT16 *)lpvParam = GetSystemMetrics16( SM_CXFRAME );
1091 case SPI_GETFASTTASKSWITCH:
1092 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
1093 *(BOOL16 *) lpvParam = TRUE;
1095 *(BOOL16 *) lpvParam = FALSE;
1098 case SPI_GETGRIDGRANULARITY:
1099 *(INT16 *) lpvParam = GetProfileIntA( "desktop",
1104 case SPI_GETICONTITLEWRAP:
1105 *(BOOL16 *) lpvParam = GetProfileIntA( "desktop",
1110 case SPI_GETKEYBOARDDELAY:
1111 *(INT16 *) lpvParam = GetProfileIntA( "keyboard",
1112 "KeyboardDelay", 1 );
1115 case SPI_GETKEYBOARDSPEED:
1116 *(WORD *) lpvParam = GetProfileIntA( "keyboard",
1121 case SPI_GETMENUDROPALIGNMENT:
1122 *(BOOL16 *) lpvParam = GetSystemMetrics16( SM_MENUDROPALIGNMENT ); /* XXX check this */
1125 case SPI_GETSCREENSAVEACTIVE:
1126 if(MONITOR_GetScreenSaveActive(&MONITOR_PrimaryMonitor) ||
1127 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
1128 *(BOOL16 *) lpvParam = TRUE;
1130 *(BOOL16 *) lpvParam = FALSE;
1133 case SPI_GETSCREENSAVETIMEOUT:
1134 timeout = MONITOR_GetScreenSaveTimeout(&MONITOR_PrimaryMonitor);
1136 timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
1137 *(INT16 *) lpvParam = timeout;
1140 case SPI_ICONHORIZONTALSPACING:
1141 /* FIXME Get/SetProfileInt */
1142 if (lpvParam == NULL)
1143 /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
1145 *(INT16 *)lpvParam = GetSystemMetrics16( SM_CXICONSPACING );
1148 case SPI_ICONVERTICALSPACING:
1149 /* FIXME Get/SetProfileInt */
1150 if (lpvParam == NULL)
1151 /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
1153 *(INT16 *)lpvParam = GetSystemMetrics16(SM_CYICONSPACING);
1157 KEYBOARD_SetBeepActive(uParam);
1160 case SPI_SETSCREENSAVEACTIVE:
1161 MONITOR_SetScreenSaveActive(&MONITOR_PrimaryMonitor, uParam);
1164 case SPI_SETSCREENSAVETIMEOUT:
1165 MONITOR_SetScreenSaveTimeout(&MONITOR_PrimaryMonitor, uParam);
1168 case SPI_SETDESKWALLPAPER:
1169 return (SetDeskWallPaper((LPSTR) lpvParam));
1172 case SPI_SETDESKPATTERN:
1173 if ((INT16)uParam == -1) {
1174 GetProfileStringA("Desktop", "Pattern",
1175 "170 85 170 85 170 85 170 85",
1176 buffer, sizeof(buffer) );
1177 return (DESKTOP_SetPattern((LPSTR) buffer));
1179 return (DESKTOP_SetPattern((LPSTR) lpvParam));
1182 case SPI_GETICONTITLELOGFONT:
1184 LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
1186 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1187 lpLogFont->lfFaceName, LF_FACESIZE );
1188 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
1189 lpLogFont->lfWidth = 0;
1190 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1191 lpLogFont->lfWeight = FW_NORMAL;
1192 lpLogFont->lfItalic = FALSE;
1193 lpLogFont->lfStrikeOut = FALSE;
1194 lpLogFont->lfUnderline = FALSE;
1195 lpLogFont->lfCharSet = ANSI_CHARSET;
1196 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1197 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1198 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1201 case SPI_GETNONCLIENTMETRICS:
1203 #define lpnm ((LPNONCLIENTMETRICS16)lpvParam)
1204 if( lpnm->cbSize == sizeof(NONCLIENTMETRICS16) )
1206 /* FIXME: initialize geometry entries */
1207 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1208 (LPVOID)&(lpnm->lfCaptionFont),0);
1209 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
1210 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1211 (LPVOID)&(lpnm->lfSmCaptionFont),0);
1212 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1213 (LPVOID)&(lpnm->lfMenuFont),0);
1214 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1215 (LPVOID)&(lpnm->lfStatusFont),0);
1216 SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
1217 (LPVOID)&(lpnm->lfMessageFont),0);
1219 else /* winfile 95 sets sbSize to 340 */
1220 SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
1224 case SPI_LANGDRIVER:
1226 case SPI_SETDOUBLECLKHEIGHT:
1227 case SPI_SETDOUBLECLICKTIME:
1228 case SPI_SETDOUBLECLKWIDTH:
1229 case SPI_SETFASTTASKSWITCH:
1230 case SPI_SETKEYBOARDDELAY:
1231 case SPI_SETKEYBOARDSPEED:
1232 WARN_(system)("Option %d ignored.\n", uAction);
1235 case SPI_GETWORKAREA:
1236 SetRect16( (RECT16 *)lpvParam, 0, 0,
1237 GetSystemMetrics16( SM_CXSCREEN ),
1238 GetSystemMetrics16( SM_CYSCREEN ) );
1242 WARN_(system)("Unknown option %d.\n", uAction);
1248 /***********************************************************************
1249 * SystemParametersInfo32W (USER32.541)
1251 BOOL WINAPI SystemParametersInfoW( UINT uAction, UINT uParam,
1252 LPVOID lpvParam, UINT fuWinIni )
1258 case SPI_SETDESKWALLPAPER:
1261 lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
1262 return SetDeskWallPaper(buffer);
1264 return SetDeskWallPaper(NULL);
1266 case SPI_SETDESKPATTERN:
1267 if ((INT) uParam == -1)
1269 GetProfileStringA("Desktop", "Pattern",
1270 "170 85 170 85 170 85 170 85",
1271 buffer, sizeof(buffer) );
1272 return (DESKTOP_SetPattern((LPSTR) buffer));
1276 lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
1277 return DESKTOP_SetPattern(buffer);
1279 return DESKTOP_SetPattern(NULL);
1281 case SPI_GETICONTITLELOGFONT:
1283 LPLOGFONTW lpLogFont = (LPLOGFONTW)lpvParam;
1284 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif",
1285 buffer, sizeof(buffer) );
1286 lstrcpynAtoW(lpLogFont->lfFaceName, buffer ,LF_FACESIZE);
1287 lpLogFont->lfHeight = 10;
1288 lpLogFont->lfWidth = 0;
1289 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1290 lpLogFont->lfWeight = FW_NORMAL;
1291 lpLogFont->lfItalic = lpLogFont->lfStrikeOut = lpLogFont->lfUnderline = FALSE;
1292 lpLogFont->lfCharSet = ANSI_CHARSET;
1293 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1294 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1295 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1298 case SPI_GETNONCLIENTMETRICS: {
1299 /* FIXME: implement correctly */
1300 LPNONCLIENTMETRICSW lpnm=(LPNONCLIENTMETRICSW)lpvParam;
1302 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfCaptionFont),0);
1303 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
1304 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfSmCaptionFont),0);
1305 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMenuFont),0);
1306 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfStatusFont),0);
1307 SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMessageFont),0);
1311 case SPI_GETHIGHCONTRAST:
1313 LPHIGHCONTRASTW lpHighContrastW = (LPHIGHCONTRASTW)lpvParam;
1315 FIXME_(system)("SPI_GETHIGHCONTRAST not fully implemented\n");
1317 if ( lpHighContrastW->cbSize == sizeof( HIGHCONTRASTW ) )
1319 /* Indicate that there is no high contrast available */
1320 lpHighContrastW->dwFlags = 0;
1321 lpHighContrastW->lpszDefaultScheme = NULL;
1332 return SystemParametersInfoA(uAction,uParam,lpvParam,fuWinIni);
1339 /***********************************************************************
1340 * FileCDR (KERNEL.130)
1342 FARPROC16 WINAPI FileCDR16(FARPROC16 x)
1344 FIXME_(file)("(0x%8x): stub\n", (int) x);
1345 return (FARPROC16)TRUE;